vitasdk
Documentation of the vitasdk

Exports for Kernel. More...

Enumerations

enum  SceLcdErrorCode { SCE_LCD_ERROR_INVALID_ARGUMENT = 0x803F0C02 , SCE_LCD_ERROR_INITIALIZATION_FAILED = 0x803F0C03 , SCE_LCD_ERROR_NOT_READY = 0x803F0C04 , SCE_LCD_ERROR_INVALID_STATE = 0x803F0C05 }
 LCD driver error codes observed on FW 3.60. More...
 
enum  SceLcdColorSpaceMode { SCE_LCD_COLOR_SPACE_MODE_0 = 0 , SCE_LCD_COLOR_SPACE_MODE_1 = 1 }
 LCD color-space modes. More...
 

Functions

 VITASDK_BUILD_ASSERT_EQ (4, SceLcdErrorCode)
 
 VITASDK_BUILD_ASSERT_EQ (1, SceLcdColorSpaceMode)
 
int ksceLcdDisplayOff (void)
 Queue the LCD display-off sequence.
 
int ksceLcdDisplayOn (void)
 Queue the LCD display-on sequence.
 
SceUInt32 ksceLcdGetBrightness (void)
 Get the exact wide-brightness value most recently accepted by the driver.
 
int ksceLcdGetDDB (SceUInt16 *supplier_id, SceUInt16 *supplier_elective_data)
 Get the Device Descriptor Block values cached during LCD initialization.
 
SceLcdColorSpaceMode ksceLcdGetDisplayColorSpaceMode (void)
 Get the cached LCD color-space mode.
 
int ksceLcdSetBrightness (SceUInt32 brightness)
 Set the wide LCD brightness (0 through 0x10000).
 
int ksceLcdSetDisplayColorSpaceMode (SceLcdColorSpaceMode mode)
 Set the LCD color-space mode.
 
int ksceLcdWaitReady (void)
 Wait until the asynchronous LCD initialization attempt has completed.
 

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:

#include <psp2kern/lcd.h>


Link the library to the executable:

SceLcdForDriver_stub



Enumeration Type Documentation

◆ SceLcdErrorCode

LCD driver error codes observed on FW 3.60.

Enumerator
SCE_LCD_ERROR_INVALID_ARGUMENT 
SCE_LCD_ERROR_INITIALIZATION_FAILED 
SCE_LCD_ERROR_NOT_READY 
SCE_LCD_ERROR_INVALID_STATE 

◆ SceLcdColorSpaceMode

LCD color-space modes.

Their effects on the image are unknown.

Enumerator
SCE_LCD_COLOR_SPACE_MODE_0 
SCE_LCD_COLOR_SPACE_MODE_1 

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/2]

VITASDK_BUILD_ASSERT_EQ ( 4  ,
SceLcdErrorCode   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/2]

VITASDK_BUILD_ASSERT_EQ ( 1  ,
SceLcdColorSpaceMode   
)

◆ ksceLcdDisplayOff()

int ksceLcdDisplayOff ( void  )

Queue the LCD display-off sequence.

The sequence sends DCS display-off command 0x28, waits 128 ms, sends sleep-in command 0x10, and waits 96 ms. The cached brightness and target backlight level are set to 0. If the backlight controller is initialized, an update is also queued for its worker. Errors from individual SPI commands are not returned.

Returns
0 on success, SCE_LCD_ERROR_INVALID_STATE if another command sequence is pending, or an error from the backlight work queue.

◆ ksceLcdDisplayOn()

int ksceLcdDisplayOn ( void  )

Queue the LCD display-on sequence.

The common sequence waits 64 ms, sends DCS sleep-out command 0x11, waits 208 ms, sends panel-specific setup and the cached color-space commands, sends display-on command 0x29, and waits 16 ms. One panel-data path also waits 64 ms immediately before the cached mode commands. It does not restore the cached brightness. Errors from individual SPI commands are not returned.

Returns
0 on success, or SCE_LCD_ERROR_INVALID_STATE if another command sequence is pending.

◆ ksceLcdGetBrightness()

SceUInt32 ksceLcdGetBrightness ( void  )

Get the exact wide-brightness value most recently accepted by the driver.

◆ ksceLcdGetDDB()

int ksceLcdGetDDB ( SceUInt16 *  supplier_id,
SceUInt16 *  supplier_elective_data 
)

Get the Device Descriptor Block values cached during LCD initialization.

Initialization reads five bytes with MIPI DSI command 0xA1. It accepts a reply only when the fifth byte is 0xFF and the first 16-bit value is zero. Either output pointer may be NULL.

Parameters
[out]supplier_id- Receives the first 16-bit DDB value when non-NULL.
[out]supplier_elective_data- Receives the second 16-bit DDB value when non-NULL. This value selects a panel display-on command sequence on FW 3.60.
Returns
0 on success, SCE_LCD_ERROR_NOT_READY while initialization is pending, or SCE_LCD_ERROR_INITIALIZATION_FAILED after a failed panel probe.

◆ ksceLcdGetDisplayColorSpaceMode()

SceLcdColorSpaceMode ksceLcdGetDisplayColorSpaceMode ( void  )

Get the cached LCD color-space mode.

◆ ksceLcdSetBrightness()

int ksceLcdSetBrightness ( SceUInt32  brightness)

Set the wide LCD brightness (0 through 0x10000).

Valid values range from 0 through 0x10000. Zero queues the display-off sequence when the panel is on. A nonzero value queues the display-on sequence when the panel is off. A value of 1 maps to backlight level 0x19. Values from 2 through 0x10000 map to one of 17 table entries ranging from 0x1F through 0xFF, while the exact requested value remains available through ksceLcdGetBrightness.

Once initialized, the backlight controller is updated through I2C register 0x05. Changing from off to on also writes 1 to register 0x0E; changing from on to off writes 0. Errors from individual SPI and I2C commands are not returned.

Parameters
[in]brightness- Wide brightness from 0 through 0x10000.
Returns
0 on success, SCE_LCD_ERROR_INVALID_ARGUMENT for a larger value, SCE_LCD_ERROR_INVALID_STATE if another panel command sequence is pending, or an error from the backlight work queue.

◆ ksceLcdSetDisplayColorSpaceMode()

int ksceLcdSetDisplayColorSpaceMode ( SceLcdColorSpaceMode  mode)

Set the LCD color-space mode.

If the panel is off, the new mode is cached without sending a command. If it is on, the driver sends vendor commands B0 04, C9 00/01, and B0 03. Their effect on the image is unknown. Errors from individual SPI commands are not returned.

Parameters
[in]mode- One of SceLcdColorSpaceMode.
Returns
0 on success, SCE_LCD_ERROR_INVALID_ARGUMENT for an unsupported mode, or SCE_LCD_ERROR_INVALID_STATE if another command sequence is pending.

◆ ksceLcdWaitReady()

int ksceLcdWaitReady ( void  )

Wait until the asynchronous LCD initialization attempt has completed.

This function busy-waits without a timeout and returns 0 for both successful and failed initialization. Call ksceLcdGetDDB to check whether it succeeded.

Returns
0 after initialization succeeds or fails.