SceOled: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Module ==
== Module ==


=== Known NIDs ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! Name !! World !! Privilege !! NID
! Version !! World !! Privilege
|-
|-
| 1.69 || SceOled || Non-secure || Kernel || 0x5410837A
| 1.69-3.60 || Non-secure || Kernel
|}
|}


Line 23: Line 22:


TODO: move to [[OLED]].
TODO: move to [[OLED]].
PS Vita OLED models:
- AMS495QA01
- Other models?


* Datasheets:
* Datasheets:
Line 67: Line 70:
|-
|-
! Cmd
! Cmd
! Name
! Size
! Size
! Buf
! Buf
! Description
! Description
|-
|-
| 178
| 0x6
| 1
| GET_RED_CHANNEL
| 0x1
| Unknown
| Unknown
|-
| 0x7
| GET_GREEN_CHANNEL
| 0x1
| Unknown
| Unknown
|-
| 0x8
| GET_BLUE_CHANNEL
| 0x1
| Unknown
| Unknown
|-
| 0xA
| GET_POWER_MODE
| 0x1
| Unknown
| Unknown
|-
| 0xB
| GET_ADDRESS_MODE
| 0x1
| Unknown
| Unknown
|-
| 0xC
| GET_PIXEL_FORMAT
| 0x1
| Unknown
| Unknown
|-
| 0xD
| GET_DISPLAY_MODE
| 0x1
| Unknown
| Unknown
|-
| 0xF
| GET_DIAGNOSTIC_RESULT
| 0x1
| Unknown
| Unknown
|-
| 0x26
| SET_GAMMA_CURVE
| 0x1
| Unknown
| Unknown
|-
| 0x36
| SET_ADDRESS_MODE
| 0x1
| Unknown
| Unknown
|-
| 0x3A
| SET_PIXEL_FORMAT
| 0x1
| Unknown
| Unknown
|-
| 0xA1
| READ_DDB_START
| 0x5
| Unknown
| Unknown
|-
| 0xB0
| GLOBAL_PARAMETER
| 0x1
| Unknown
| Unknown
|-
| 0xB1
| ELVSS_CON
| 0x3
| Unknown
| Unknown
|-
| 0xB2
| TEMP_SWIRE
| 0x1
| Unknown
| Unknown
|-
| 0xB3
| SCR_CONTROL
| 0x1
| Unknown
| Unknown
|-
| 0xB4
| SCR_GAMMA
| 0x1
| Unknown
| Unknown
|-
| 0xB5
| SCR_LUT
| 0x1
| Unknown
| Unknown
|-
| 0xC0
| ACL_CONTROL
| 0x1
| Unknown
| Unknown
|-
| 0xC1
| ACL_PROFILE
| 0x1C
| Unknown
| Unknown
|-
| 0xC2
| ACL1_DUTY
| 0x1
| Unknown
| Unknown
|-
| 0xC3
| ACL1_ACWE
| 0x1
| Unknown
| Unknown
|-
| 0xC6
| SET_DISPLAY_1
| 0xB
| Unknown
| Unknown
|-
| 0xC7
| SET_DISPLAY_2
| 0x1
| Unknown
| Unknown
|-
| 0xC8
| SET_DISPLAY_3
| 0x1
| Unknown
| Unknown
|-
| 0xC9
| SET_DISPLAY_4
| 0x3
| Unknown
| Unknown
|-
| 0xD0
| SET_OTP1
| 0x1
| Unknown
| Unknown
|-
| 0xD1
| SET_OTP2
| 0x1
| Unknown
| Unknown
|-
| 0xD2
| SET_NORMAL_ADJUST_MTP
| 0x12
| Unknown
| Unknown
|-
| 0xD3
| SET_DARK_ADJUST_MTP
| 0x12
| Unknown
| Unknown
|-
| 0xF0
| PASSWD1
| 0x2
| Unknown
| Unknown
|-
| 0xF1
| PASSWD2
| 0x2
| Unknown
| Unknown
|-
| 0xF3
| MAIN_POWER_SEQUENCE
| 0x6
| Unknown
| Unknown
|-
| 0xF4
| SET_POWER_CONTROL_1
| 0x3
| Unknown
| Unknown
| Unknown
| Unknown
|-
|-
| 249
| 0xF5
| 1 or 22
| SET_POWER_CONTROL_2
| 0x5
| Unknown
| Unknown
|-
| 0xF6
| SET_DISPLAY_5
| 0x1
| Unknown
| Unknown
|-
| 0xF7
| GTCON
| 0x1
| Unknown
| Unknown
|-
| 0xF8
| SET_PANEL_CONTROL
| 0x13
| Unknown
| Unknown
|-
| 0xF9
| SET_NORMAL_GAMMA_CONTROL
| 0x16
| Unknown, for example <code><0x01, 0xCFBE9F9F, 0xCBC2C9D7, 0xDEE3E1BB, 0xFAD3D0D6, 0x002FE6ED, 0x2F></code> (Little-Endian)
| Unknown, for example <code><0x01, 0xCFBE9F9F, 0xCBC2C9D7, 0xDEE3E1BB, 0xFAD3D0D6, 0x002FE6ED, 0x2F></code> (Little-Endian)
| Change Brightness
| Change Brightness
|-
| 0xFA
| SET_DARK_GAMMA_CONTROL
| 0x16
| Unknown
| Unknown
|}
|}


Line 92: Line 326:
|}
|}


<source lang="c">int sceOledWaitReadyForDriver();</source>
Waits until the OLED has been initialized.


Waits until the OLED has been initialized.
<source lang="c">int sceOledWaitReadyForDriver(void);</source>


=== SceOledForDriver_26F9EEA8 ===
=== SceOledForDriver_26F9EEA8_oled_disable ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 103: Line 337:
| 3.60 || 0x26F9EEA8
| 3.60 || 0x26F9EEA8
|}
|}
Disables the OLED by clearing the GPIO bus 0 port 0.


<source lang="c">int SceOledForDriver_26F9EEA8_oled_disable(void);</source>
<source lang="c">int SceOledForDriver_26F9EEA8_oled_disable(void);</source>


Disables the OLED by clearing the GPIO bus 0 port 0.
=== SceOledForDriver_2F0C4B67_send_cmd ===
 
=== SceOledForDriver_2F0C4B67 ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 115: Line 349:
| 3.60 || 0x2F0C4B67
| 3.60 || 0x2F0C4B67
|}
|}
Sends a command to the OLED (via SPI).


<source lang="c">int SceOledForDriver_2F0C4B67_send_cmd(u8 cmd, void *buffer, int size);</source>
<source lang="c">int SceOledForDriver_2F0C4B67_send_cmd(u8 cmd, void *buffer, int size);</source>
Sends a command to the OLED (via SPI).


=== sceOledGetBrightnessForDriver ===
=== sceOledGetBrightnessForDriver ===
Line 128: Line 362:
|}
|}


<source lang="c">int ceOledGetBrightnessForDriver();</source>
Get the wide brightness value (<code>0-65536</code>).


Get the wide brightness value (<code>0-65536</code>).
<source lang="c">int sceOledGetBrightnessForDriver(void);</source>


=== sceOledDisplayOnForDriver ===
=== sceOledDisplayOnForDriver ===
Line 140: Line 374:
|}
|}


<source lang="c">int sceOledDisplayOnForDriver();</source>
<source lang="c">int sceOledDisplayOnForDriver(void);</source>


=== sceOledGetDisplayColorSpaceModeForDriver ===
=== sceOledGetDisplayColorSpaceModeForDriver ===
Line 152: Line 386:
<source lang="c">int sceOledGetDisplayColorSpaceModeForDriver(void);</source>
<source lang="c">int sceOledGetDisplayColorSpaceModeForDriver(void);</source>


=== SceOledForDriver_6B1E0B52 ===
=== SceOledForDriver_6B1E0B52_oled_enable ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 159: Line 393:
| 3.60 || 0x6B1E0B52
| 3.60 || 0x6B1E0B52
|}
|}
Enables the OLED by setting the GPIO bus 0 port 0.


<source lang="c">int SceOledForDriver_6B1E0B52_oled_enable(void);</source>
<source lang="c">int SceOledForDriver_6B1E0B52_oled_enable(void);</source>


Enables the OLED by setting the GPIO bus 0 port 0.
=== SceOledForDriver_9F4ABDDC_get_status ===
 
=== SceOledForDriver_9F4ABDDC ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x9F4ABDDC
| 0.940-3.60 || 0x9F4ABDDC
|}
|}


<source lang="c">int SceOledForDriver_9F4ABDDC_is_disabled(void);</source>
Returns the OLED status by reading the GPIO bus 0 port 0.


Returns the OLED status by reading the GPIO bus 0 port 0.
<source lang="c">int SceOledForDriver_9F4ABDDC_get_status(void);</source>


=== sceOledDisplayOffForDriver ===
=== sceOledDisplayOffForDriver ===
Line 184: Line 418:
|}
|}


<source lang="c">int sceOledDisplayOffForDriver();</source>
<source lang="c">int sceOledDisplayOffForDriver(void);</source>


=== sceOledGetDDBForDriver ===
=== sceOledGetDDBForDriver ===
Line 193: Line 427:
| 3.60 || 0xC9D5987C
| 3.60 || 0xC9D5987C
|}
|}
Returns the Device Descriptor Block (DDB), read with MIPI DSI command <code>read_DDB_start</code> (<code>0xA1</code>).


<source lang="c">int sceOledGetDDBForDriver(unsigned short *supplier_id, unsigned short *supplier_elective_data);</source>
<source lang="c">int sceOledGetDDBForDriver(unsigned short *supplier_id, unsigned short *supplier_elective_data);</source>
Returns the Device Descriptor Block (DDB), read with MIPI DSI command <code>read_DDB_start</code> (<code>0xA1</code>).


=== sceOledSetDisplayColorSpaceModeForDriver ===
=== sceOledSetDisplayColorSpaceModeForDriver ===
Line 208: Line 442:
<source lang="c">int sceOledSetDisplayColorSpaceModeForDriver(int mode);</source>
<source lang="c">int sceOledSetDisplayColorSpaceModeForDriver(int mode);</source>


=== SceOledForDriver_E30604CC ===
=== SceOledForDriver_E30604CC_dispatch_cmd_list ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 215: Line 449:
| 3.60 || 0xE30604CC
| 3.60 || 0xE30604CC
|}
|}
Dispatches the OLED cmd list (using SceOledForDriver_2F0C4B67_send_cmd).


<source lang="c">int SceOledForDriver_E30604CC_dispatch_cmd_list(void);</source>
<source lang="c">int SceOledForDriver_E30604CC_dispatch_cmd_list(void);</source>
Dispatches the OLED cmd list (using ksceOledForDriver_2F0C4B67).


=== sceOledSetBrightnessForDriver ===
=== sceOledSetBrightnessForDriver ===
Line 227: Line 461:
| 3.60 || 0xF9624C47
| 3.60 || 0xF9624C47
|}
|}
<source lang="c">int sceOledSetBrightnessForDriver(unsigned int brightness);</source>


Set the brightness (brightness needs to be in the range <code>0-65536</code>). <code>0</code> means screen turned off, <code>1</code> means screen dimmed (like if you wait for a long time without touching your screen).
Set the brightness (brightness needs to be in the range <code>0-65536</code>). <code>0</code> means screen turned off, <code>1</code> means screen dimmed (like if you wait for a long time without touching your screen).


The brightness has actually 17 different values: 1 special value for <code>brightness=0</code>, and 16 different values for the rest (<code>real_value=brightness/4096</code>).
The brightness has actually 17 different values: 1 special value for <code>brightness=0</code>, and 16 different values for the rest (<code>real_value=brightness/4096</code>).
<source lang="c">int sceOledSetBrightnessForDriver(SceUInt32 brightness);</source>


=== SceOledForDriver_ED2D6F19_set_status ===
=== SceOledForDriver_ED2D6F19_set_status ===
Line 242: Line 476:
|}
|}


Used to enable (status = 1), and to disable (status = 0).
Used to enable or disable.


<source lang="C">
<source lang="C">
// a1: 0 or 1
// status: 0: disable, 1: enable
int SceOledForDriver_ED2D6F19_set_status(int status);
int SceOledForDriver_ED2D6F19_set_status(int status);
</source>
</source>
Line 261: Line 495:
<source lang="C">int SceOledForDriver_DDB1412B_reset(void);</source>
<source lang="C">int SceOledForDriver_DDB1412B_reset(void);</source>


=== SceOledForDriver_3C990F53 ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.996 || 0x3C990F53
|-
| 3.60 || not present
|}


Returns 0 on success.
<source lang="C">int SceOledForDriver_3C990F53(void);</source>
[[Category:ARM]]
[[Category:Kernel]]
[[Category:Modules]]
[[Category:Modules]]
[[Category:Kernel]]
[[Category:Library]]

Latest revision as of 21:23, 1 May 2023

Module

Version World Privilege
1.69-3.60 Non-secure Kernel

Libraries

Known NIDs

Version Name World Visibility NID
1.69 SceOledForDriver Non-secure Kernel 0x60C7478A

Resources

TODO: move to OLED.

PS Vita OLED models: - AMS495QA01 - Other models?

Types

enum SceOledError {
    SCE_OLED_ERROR_INVALID_BRIGHTNESS_VALUE = 0x803F0A02,
    SCE_OLED_ERROR_INVALID_READY_STATUS = 0x803F0A03,
    SCE_OLED_ERROR_NOT_READY = 0x803F0A04,
    SCE_OLED_ERROR_INTERNAL = 0x803F0A05
};

enum SceOledStatus {
    SCE_OLED_STATUS_NOT_READY = 0,
    SCE_OLED_STATUS_READY = 1,
    SCE_OLED_STATUS_ERROR = 2
};

struct SceOledCmd {
    unsigned char cmd,
    unsigned char size,
    unsigned char buf[size]
}

A cmd_queue is a contiguous array of SceOledCmd of different sizes. To get the next SceOledCmd of a queue, do:

struct SceOledCmd *cur_cmd = ...
struct SceOledCmd *next_cmd = &(cur_cmd->buf) + cur_cmd->size;

if (next_cmd->cmd == 0 || next_cmd->cmd == 255) {...} // End of queue

Available commands

Cmd Name Size Buf Description
0x6 GET_RED_CHANNEL 0x1 Unknown Unknown
0x7 GET_GREEN_CHANNEL 0x1 Unknown Unknown
0x8 GET_BLUE_CHANNEL 0x1 Unknown Unknown
0xA GET_POWER_MODE 0x1 Unknown Unknown
0xB GET_ADDRESS_MODE 0x1 Unknown Unknown
0xC GET_PIXEL_FORMAT 0x1 Unknown Unknown
0xD GET_DISPLAY_MODE 0x1 Unknown Unknown
0xF GET_DIAGNOSTIC_RESULT 0x1 Unknown Unknown
0x26 SET_GAMMA_CURVE 0x1 Unknown Unknown
0x36 SET_ADDRESS_MODE 0x1 Unknown Unknown
0x3A SET_PIXEL_FORMAT 0x1 Unknown Unknown
0xA1 READ_DDB_START 0x5 Unknown Unknown
0xB0 GLOBAL_PARAMETER 0x1 Unknown Unknown
0xB1 ELVSS_CON 0x3 Unknown Unknown
0xB2 TEMP_SWIRE 0x1 Unknown Unknown
0xB3 SCR_CONTROL 0x1 Unknown Unknown
0xB4 SCR_GAMMA 0x1 Unknown Unknown
0xB5 SCR_LUT 0x1 Unknown Unknown
0xC0 ACL_CONTROL 0x1 Unknown Unknown
0xC1 ACL_PROFILE 0x1C Unknown Unknown
0xC2 ACL1_DUTY 0x1 Unknown Unknown
0xC3 ACL1_ACWE 0x1 Unknown Unknown
0xC6 SET_DISPLAY_1 0xB Unknown Unknown
0xC7 SET_DISPLAY_2 0x1 Unknown Unknown
0xC8 SET_DISPLAY_3 0x1 Unknown Unknown
0xC9 SET_DISPLAY_4 0x3 Unknown Unknown
0xD0 SET_OTP1 0x1 Unknown Unknown
0xD1 SET_OTP2 0x1 Unknown Unknown
0xD2 SET_NORMAL_ADJUST_MTP 0x12 Unknown Unknown
0xD3 SET_DARK_ADJUST_MTP 0x12 Unknown Unknown
0xF0 PASSWD1 0x2 Unknown Unknown
0xF1 PASSWD2 0x2 Unknown Unknown
0xF3 MAIN_POWER_SEQUENCE 0x6 Unknown Unknown
0xF4 SET_POWER_CONTROL_1 0x3 Unknown Unknown
0xF5 SET_POWER_CONTROL_2 0x5 Unknown Unknown
0xF6 SET_DISPLAY_5 0x1 Unknown Unknown
0xF7 GTCON 0x1 Unknown Unknown
0xF8 SET_PANEL_CONTROL 0x13 Unknown Unknown
0xF9 SET_NORMAL_GAMMA_CONTROL 0x16 Unknown, for example <0x01, 0xCFBE9F9F, 0xCBC2C9D7, 0xDEE3E1BB, 0xFAD3D0D6, 0x002FE6ED, 0x2F> (Little-Endian) Change Brightness
0xFA SET_DARK_GAMMA_CONTROL 0x16 Unknown Unknown

SceOledForDriver

sceOledWaitReadyForDriver

Version NID
3.60 0x0CC6BCB4

Waits until the OLED has been initialized.

int sceOledWaitReadyForDriver(void);

SceOledForDriver_26F9EEA8_oled_disable

Version NID
3.60 0x26F9EEA8

Disables the OLED by clearing the GPIO bus 0 port 0.

int SceOledForDriver_26F9EEA8_oled_disable(void);

SceOledForDriver_2F0C4B67_send_cmd

Version NID
3.60 0x2F0C4B67

Sends a command to the OLED (via SPI).

int SceOledForDriver_2F0C4B67_send_cmd(u8 cmd, void *buffer, int size);

sceOledGetBrightnessForDriver

Version NID
3.60 0x43EF811A

Get the wide brightness value (0-65536).

int sceOledGetBrightnessForDriver(void);

sceOledDisplayOnForDriver

Version NID
3.60 0x4C7836C7
int sceOledDisplayOnForDriver(void);

sceOledGetDisplayColorSpaceModeForDriver

Version NID
3.60 0x4F8A1D4A
int sceOledGetDisplayColorSpaceModeForDriver(void);

SceOledForDriver_6B1E0B52_oled_enable

Version NID
3.60 0x6B1E0B52

Enables the OLED by setting the GPIO bus 0 port 0.

int SceOledForDriver_6B1E0B52_oled_enable(void);

SceOledForDriver_9F4ABDDC_get_status

Version NID
0.940-3.60 0x9F4ABDDC

Returns the OLED status by reading the GPIO bus 0 port 0.

int SceOledForDriver_9F4ABDDC_get_status(void);

sceOledDisplayOffForDriver

Version NID
3.60 0xBC84602E
int sceOledDisplayOffForDriver(void);

sceOledGetDDBForDriver

Version NID
3.60 0xC9D5987C

Returns the Device Descriptor Block (DDB), read with MIPI DSI command read_DDB_start (0xA1).

int sceOledGetDDBForDriver(unsigned short *supplier_id, unsigned short *supplier_elective_data);

sceOledSetDisplayColorSpaceModeForDriver

Version NID
3.60 0xDABBD9D3
int sceOledSetDisplayColorSpaceModeForDriver(int mode);

SceOledForDriver_E30604CC_dispatch_cmd_list

Version NID
3.60 0xE30604CC

Dispatches the OLED cmd list (using SceOledForDriver_2F0C4B67_send_cmd).

int SceOledForDriver_E30604CC_dispatch_cmd_list(void);

sceOledSetBrightnessForDriver

Version NID
3.60 0xF9624C47

Set the brightness (brightness needs to be in the range 0-65536). 0 means screen turned off, 1 means screen dimmed (like if you wait for a long time without touching your screen).

The brightness has actually 17 different values: 1 special value for brightness=0, and 16 different values for the rest (real_value=brightness/4096).

int sceOledSetBrightnessForDriver(SceUInt32 brightness);

SceOledForDriver_ED2D6F19_set_status

Version NID
0.940-3.60 0xED2D6F19

Used to enable or disable.

// status: 0: disable, 1: enable
int SceOledForDriver_ED2D6F19_set_status(int status);

SceOledForDriver_DDB1412B_reset

Version NID
0.940-3.60 0xDDB1412B

Used to reset.

int SceOledForDriver_DDB1412B_reset(void);

SceOledForDriver_3C990F53

Version NID
0.996 0x3C990F53
3.60 not present

Returns 0 on success.

int SceOledForDriver_3C990F53(void);