SceOled: Difference between revisions
CelesteBlue (talk | contribs) Tags: mobile edit mobile web edit |
|||
Line 186: | Line 186: | ||
<source lang="c">int sceOledDisplayOffForDriver();</source> | <source lang="c">int sceOledDisplayOffForDriver();</source> | ||
=== | === sceOledGetDDBForDriver === | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 194: | Line 194: | ||
|} | |} | ||
<source lang="c">int | <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>). | Returns the Device Descriptor Block (DDB), read with MIPI DSI command <code>read_DDB_start</code> (<code>0xA1</code>). |
Revision as of 01:18, 29 December 2018
Module
Known NIDs
Version | Name | World | Privilege | NID |
---|---|---|---|---|
1.69 | SceOled | Non-secure | Kernel | 0x5410837A |
Libraries
Known NIDs
Version | Name | World | Visibility | NID |
---|---|---|---|---|
1.69 | SceOledForDriver | Non-secure | Kernel | 0x60C7478A |
Resources
TODO: move to OLED.
- Datasheets:
- AMS495QA04 (very useful: hardware + driver API): File:AMS495QA04 Ver2.0 20121113 201509238327.pdf
- AMS495QA01 (hardware, not very useful): File:AMS495QA01 datasheet.pdf
- Baremetal OLED usage: https://github.com/xerpi/vita-baremetal-sample/blob/master/src/oled.c
- Linux driver of a similar screen: http://elixir.free-electrons.com/linux/latest/source/drivers/gpu/drm/panel/panel-samsung-ld9040.c#L37
- Some interesting paper explaining how the gamma lookup table is generated: http://proceedings.spiedigitallibrary.org/proceeding.aspx?articleid=1343918
- DCS documentation: https://www.tonylabs.com/wp-content/uploads/MIPI_DCS_specification_v1.02.00.pdf
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 | Size | Buf | Description |
---|---|---|---|
178 | 1 | Unknown | Unknown |
249 | 1 or 22 | Unknown, for example <0x01, 0xCFBE9F9F, 0xCBC2C9D7, 0xDEE3E1BB, 0xFAD3D0D6, 0x002FE6ED, 0x2F> (Little-Endian)
|
Change Brightness |
SceOledForDriver
sceOledWaitReadyForDriver
Version | NID |
---|---|
3.60 | 0x0CC6BCB4 |
int sceOledWaitReadyForDriver();
Waits until the OLED has been initialized.
SceOledForDriver_26F9EEA8
Version | NID |
---|---|
3.60 | 0x26F9EEA8 |
int SceOledForDriver_26F9EEA8_oled_disable(void);
Disables the OLED by clearing the GPIO bus 0 port 0.
SceOledForDriver_2F0C4B67
Version | NID |
---|---|
3.60 | 0x2F0C4B67 |
int SceOledForDriver_2F0C4B67_send_cmd(u8 cmd, void *buffer, int size);
Sends a command to the OLED (via SPI).
sceOledGetBrightnessForDriver
Version | NID |
---|---|
3.60 | 0x43EF811A |
int ceOledGetBrightnessForDriver();
Get the wide brightness value (0-65536
).
sceOledDisplayOnForDriver
Version | NID |
---|---|
3.60 | 0x4C7836C7 |
int sceOledDisplayOnForDriver();
sceOledGetDisplayColorSpaceModeForDriver
Version | NID |
---|---|
3.60 | 0x4F8A1D4A |
int sceOledGetDisplayColorSpaceModeForDriver(void);
SceOledForDriver_6B1E0B52
Version | NID |
---|---|
3.60 | 0x6B1E0B52 |
int SceOledForDriver_6B1E0B52_oled_enable(void);
Enables the OLED by setting the GPIO bus 0 port 0.
SceOledForDriver_9F4ABDDC
Version | NID |
---|---|
3.60 | 0x9F4ABDDC |
int SceOledForDriver_9F4ABDDC_is_disabled(void);
Returns the OLED status by reading the GPIO bus 0 port 0.
sceOledDisplayOffForDriver
Version | NID |
---|---|
3.60 | 0xBC84602E |
int sceOledDisplayOffForDriver();
sceOledGetDDBForDriver
Version | NID |
---|---|
3.60 | 0xC9D5987C |
int sceOledGetDDBForDriver(unsigned short *supplier_id, unsigned short *supplier_elective_data);
Returns the Device Descriptor Block (DDB), read with MIPI DSI command read_DDB_start
(0xA1
).
sceOledSetDisplayColorSpaceModeForDriver
Version | NID |
---|---|
3.60 | 0xDABBD9D3 |
int sceOledSetDisplayColorSpaceModeForDriver(int mode);
SceOledForDriver_E30604CC
Version | NID |
---|---|
3.60 | 0xE30604CC |
int SceOledForDriver_E30604CC_dispatch_cmd_list(void);
Dispatches the OLED cmd list (using ksceOledForDriver_2F0C4B67).
sceOledSetBrightnessForDriver
Version | NID |
---|---|
3.60 | 0xF9624C47 |
int sceOledSetBrightnessForDriver(unsigned int brightness);
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
).