![]() |
RZ/A Flexible Software Package Documentation
Release v3.4.0
|
|
Functions | |
fsp_err_t | R_MIPI_DSI_B_Open (mipi_dsi_ctrl_t *const p_api_ctrl, mipi_dsi_cfg_t const *const p_cfg) |
fsp_err_t | R_MIPI_DSI_B_Close (mipi_dsi_ctrl_t *const p_api_ctrl) |
fsp_err_t | R_MIPI_DSI_B_Start (mipi_dsi_ctrl_t *const p_api_ctrl) |
fsp_err_t | R_MIPI_DSI_B_UlpsEnter (mipi_dsi_ctrl_t *const p_api_ctrl, mipi_dsi_lane_t lane) |
fsp_err_t | R_MIPI_DSI_B_UlpsExit (mipi_dsi_ctrl_t *const p_api_ctrl, mipi_dsi_lane_t lane) |
fsp_err_t | R_MIPI_DSI_B_Stop (mipi_dsi_ctrl_t *const p_api_ctrl) |
fsp_err_t | R_MIPI_DSI_B_Command (mipi_dsi_ctrl_t *const p_api_ctrl, mipi_dsi_cmd_t *p_cmd) |
fsp_err_t | R_MIPI_DSI_B_StatusGet (mipi_dsi_ctrl_t *const p_api_ctrl, mipi_dsi_status_t *p_status) |
Driver for the MIPI DSI peripheral on RZ MPUs. This module implements the Display Interface.
The MIPI DSI peripheral consists of the Display Serial Interface (DSI-2) Host, physical layer (D-PHY), and supporting sub-systems. Together, these form a high-speed graphics serial bus that formats data from the LCDC layer and sends it to an external display. The DSI-2 and D-Phy support MIPI Alliance Specification 1.3.1 and 2.1 respectively.
The following features are available:
Feature | Options |
---|---|
Pixel formats | RGB888, RGB666 |
Number of lanes | Up to 4 |
Maximum resolution | See LCDC specifications |
Maximum bandwidth | Up to 1500 Mbps per high-speed lane |
Features:
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Configuration | Options | Default | Description |
---|---|---|---|
General > Name | Name must be a valid C symbol | g_mipi_phy0 | Module name. |
Transmission Rate (Mbps) |
| 1500 |
Configuration | Options | Default | Description |
---|---|---|---|
General > Name | Name must be a valid C symbol | g_mipi_dsi0 | Module name. |
Options > Data Scramble Enable |
| Disable | Data Scramble Enable. Do not enable unless peripheral has data scramble function. |
Options > EoTP Enable |
| Enable | Disable to support devices that do not support EoTP transmission. |
Options > ECC Check Enable |
| Enable | ECC Check support enable. |
Options > CRC Enable |
| ||
Options > Maximum Return Packet Size | Value must be an integer. | 1 | Specify the maximum return packet size to be received in LP-RX mode. |
Options > HS-TX Timeout Count (us) | Value must be an integer. | 0 | Set HS-TX Timeout (HTX_TO) value. (0 is disabled) |
Options > LP-RX Host Processor Timeout (us) | Value must be an integer. | 0 | Set LP-RX Timeout (LRX-H_TO) value. (0 is disabled) |
Options > Turnaround Acknowledge Timeout (us) | Value must be an integer. | 0 | Set Turnaround Acknowledge Timeout value. (0 is disabled) |
Options > Peripheral Response Timeout (us) | Value must be an integer. | 0 | Set Peripheral Response Timeout BTA value. (0 is disabled) |
Options > LP Write Response Timeout (us) | Value must be an integer. | 0 | Set Low Power Write Acknowledge Timeout value. (0 is disabled) |
Options > LP Read Response Timeout (us) | Value must be an integer. | 0 | Set Low Power Read Acknowledge Timeout value. (0 is disabled) |
Options > HS Write Response Timeout (us) | Value must be an integer. | 0 | Set High Speed Write Acknowledge Timeout value. (0 is disabled) |
Options > HS Read Response Timeout (us) | Value must be an integer. | 0 | Set High Speed Read Acknowledge Timeout value. (0 is disabled) |
Low Power > Ultra Low Power State Wakeup Period (us) | Value must be a positive integer or zero. | 1000 | Set ultra low power state wakeup period (us). |
Clock Lane > Continuous Mode |
| Enable | Enable or disable continuous clock mode. |
Data Lane > Number of Data Lanes | Value must be an integer. | 4 | Specify the number of data lanes. Note: not all data lanes are capable of HS operation. See Usage Notes for additional information. |
Video Mode > Pixel Packet > Sync Pulse |
| HSE and VSE are not transmitted | Select if HSE and VSE are transmitted. Disable for Burst Mode sequence or Non-Burst Mode with Sync Events. |
Video Mode > Pixel Packet > Virtual Channel ID | Value must be an integer. | 0 | Select the video mode virtual channel ID. |
Video Mode > Prevent LP Transition |
| Prevent LP transition during specified periods. | |
Video Mode > Delay Override (0 to disable) | Value must be an integer. | 0 | Override FSP calculated delay value (not recommended for most users). Delay for DSI Host between first data reception from display module until DSI output begins. (Unit: 32xUI). Set to 0 to use FSP calculated value (recommended). |
Interrupts > dsi_seq0 Interrupt Priority | Value must be an integer between 0 and 15 | 12 | Set the Low-Power Sequence command operation interrupt priority. |
Interrupts > dsi_seq1 Interrupt Priority | Value must be an integer between 0 and 15 | 12 | Set the High-Speed Sequence command operation interrupt priority. |
Interrupts > dsi_vin1 Interrupt Priority | Value must be an integer between 0 and 15 | 12 | Set the Video Input interrupt priority. |
Interrupts > dsi_rcv Interrupt Priority | Value must be an integer between 0 and 15 | 12 | Set the Receive interrupt priority. |
Interrupts > dsi_ferr Interrupt Priority | Value must be an integer between 0 and 15 | 12 | Set the Fatal Error interrupt priority. |
Interrupts > dsi_ppi Interrupt Priority | Value must be an integer between 0 and 15 | 12 | Set the PHY-Protocol Interface interrupt priority. |
Interrupts > Receive Interrupt Enable | Refer to the RZA Configuration tool for available options. | module.driver.mipi_dsi.rxie.btarend,module.driver.mipi_dsi.rxie.lrxhto,module.driver.mipi_dsi.rxie.tato,module.driver.mipi_dsi.rxie.rxresp,module.driver.mipi_dsi.rxie.rxeotp_msk,module.driver.mipi_dsi.rxie.rxte,module.driver.mipi_dsi.rxie.rxack,module.driver.mipi_dsi.rxie.extedet,module.driver.mipi_dsi.rxie.mlferr,module.driver.mipi_dsi.rxie.eccerrm,module.driver.mipi_dsi.rxie.unexerr,module.driver.mipi_dsi.rxie.wcerr,module.driver.mipi_dsi.rxie.crcerr,module.driver.mipi_dsi.rxie.iberr,module.driver.mipi_dsi.rxie.rxovferr,module.driver.mipi_dsi.rxie.prtoerr,module.driver.mipi_dsi.rxie.noreserr,module.driver.mipi_dsi.rxie.rsizeerr,module.driver.mipi_dsi.rxie.eccerrs,module.driver.mipi_dsi.rxie.rxake | Enable receive interrupts. |
Interrupts > Fatal Error Interrupt Enable |
| module.driver.mipi_dsi.ferrie.htxto,module.driver.mipi_dsi.ferrie.lrxhto,module.driver.mipi_dsi.ferrie.tato,module.driver.mipi_dsi.ferrie.escent,module.driver.mipi_dsi.ferrie.syncesc,module.driver.mipi_dsi.ferrie.ctrl,module.driver.mipi_dsi.ferrie.clp0,module.driver.mipi_dsi.ferrie.clp1 | Enable Fatal Error interrupts. |
Interrupts > Physical Lane Interrupt Enable |
| Enable Physical Lane interrupts. | |
Interrupts > Video Mode Interrupt Enable |
| module.driver.mipi_dsi.vmie.vbufudf,module.driver.mipi_dsi.vmie.vbufovf | Enable Video Mode interrupts. |
Interrupts > Sequence Channel 0 Interrupt Enable |
| module.driver.mipi_dsi.sqch0ie.aactfin,module.driver.mipi_dsi.sqch0ie.adesfin,module.driver.mipi_dsi.sqch0ie.txiberr,module.driver.mipi_dsi.sqch0ie.rxferr,module.driver.mipi_dsi.sqch0ie.rxfail,module.driver.mipi_dsi.sqch0ie.rxpfail,module.driver.mipi_dsi.sqch0ie.rxcorerr,module.driver.mipi_dsi.sqch0ie.rxake | Enable Sequence Channel 0 interrupts. |
Interrupts > Sequence Channel 1 Interrupt Enable |
| module.driver.mipi_dsi.sqch1ie.aactfin,module.driver.mipi_dsi.sqch1ie.adesfin,module.driver.mipi_dsi.sqch1ie.sizeerr,module.driver.mipi_dsi.sqch1ie.txiberr,module.driver.mipi_dsi.sqch1ie.rxferr,module.driver.mipi_dsi.sqch1ie.rxfail,module.driver.mipi_dsi.sqch1ie.rxpfail,module.driver.mipi_dsi.sqch1ie.rxcorerr,module.driver.mipi_dsi.sqch1ie.rxake | Enable Sequence Channel 1 interrupts. |
Interrupts > Callback | Name must be a valid C symbol | mipi_dsi0_callback | A user callback function. If this callback function is provided it is called from the interrupt service routine (ISR) each time any interrupt occurs. |
Interrupts > Callback Context | Name must be a valid C symbol | NULL | Pointer to the context structure to be passed through the callback argument. |
Manual Entry | Set the delay value inside DSI Host until the transfer begins. (Unit: 32xUI). |
Communication to the external display occurs via one or more data lanes and one clock lane. Each of these lanes has dedicated pins. Lane 0 is capable of low-power data transfer and bidirectional communication with a display. Lane 1,2,3 are capable of low-power or high-speed data transfer to the external display.
The DSI-2 Host consumes data from the LCDC module and prepares it for output via the D-PHY and connections to the display.
MIPI DSI is capable of several operating modes: Non-Burst Mode with Sync Pulse, Non-Burst Mode with Sync Event, and Burst Mode. Each operational mode is achieved by configuring the peripheral with specific timimg and option settings.
Non-Burst Mode with Sync Pulse:
Non-Burst Mode with Sync Event:
Burst Mode:
The DSI-2 Host supports two basic types of operations: Command Mode and Video Mode. While a data lane is in Low-Power (LP) operation, Command Mode may be used for bi-directional communication with a connected display using a pre-defined set of command descriptors.
Two internal channels may be used for command mode operations, available for all physical lane configurations. Channel-0 supports only LP mode (LP-TX, LP-RX), while Channel-1 supports LP mode (LP-TX, LP-RX) and HS mode (HS-TX).
There are two basic packet formats, short and long. Each format may be transmitted in high-speed or low-power modes. Packets may be followed by a Bus Turn-Around (BTA) request for reading information from the display. Once configured and started, video packets are transmitted automatically, until video output is stopped.
In addition to the full set of MIPI DSI commands, the application may trigger any of four special commands by setting flags in the message structure. These special commands are Reset Signal, Initial Skew Calibration, Periodic Skew Calibration, and No-Operation.
The application is notified of Acknowledge and Error Reporting (AwER) via an optional receive interrupt event. The most recent and accumulated AwER data may be retrieved by calling R_MIPI_DSI_B_StatusGet(). The application may send a MIPI_DSI_CMD_FLAG_BTA_NO_WRITE message with tx size of zero to request AwER from the peripheral.
Ultra-low Power State (ULPS) may be actived when HS and LP operations are not occurring. Clock and Data lanes may be transitioned into ULPS independently from each other.
Developers should be aware of the following limitations when using the MIPI DSI API:
When enabled, Interrupts will invoke the configured callback function. Low-power and High-Speed command status should be determined by checking Sequence 0 and Sequence 1 events, respectively. See the DSI Error Handling section of the user manual for information about how to handle error events.
Especially for use with display middleware such as emWin or GUIX, the callback will be invoked with post-open and pre-video-start events. Depending on your hardware, it may be necessary to use these events to configure the display.
This is a basic example showing the minimum code required to initialize and start the MIPI DSI module.
Data Structures | |
struct | mipi_dsi_b_irq_cfg_t |
struct | mipi_dsi_b_extended_cfg_t |
struct | mipi_dsi_b_instance_ctrl_t |
Enumerations | |
enum | mipi_dsi_clock_state_t |
struct mipi_dsi_b_irq_cfg_t |
struct mipi_dsi_b_extended_cfg_t |
Extended configuration structure for MIPI DSI.
Data Fields | ||
---|---|---|
mipi_dsi_b_irq_cfg_t | dsi_seq0 | Sequence 0 interrupt. |
mipi_dsi_b_irq_cfg_t | dsi_seq1 | Sequence 1 interrupt. |
mipi_dsi_b_irq_cfg_t | dsi_ferr | DSI Fatal Error interrupt. |
mipi_dsi_b_irq_cfg_t | dsi_ppi | D-PHY PPI interrupt. |
mipi_dsi_b_irq_cfg_t | dsi_rcv | Receive interrupt. |
mipi_dsi_b_irq_cfg_t | dsi_vin1 | Video Input Operation interrupt. |
uint32_t | dsi_rxie | Receive interrupt enable configuration. |
uint32_t | dsi_ferrie | Fatal error interrupt enable configuration. |
uint32_t | dsi_plie | Physical lane interrupt enable configuration. |
uint32_t | dsi_vmie | Video mode interrupt enable configuration. |
uint32_t | dsi_sqch0ie | Sequence Channel 0 interrupt enable configuration. |
uint32_t | dsi_sqch1ie | Sequence Channel 1 interrupt enable configuration. |
struct mipi_dsi_b_instance_ctrl_t |
MIPI DSI instance control block.
Data Fields | |
uint32_t | open |
Interface is open. | |
bool | data_ulps_active |
Data lane ULPS status. | |
bool | clock_ulps_active |
Data lane ULPS status. | |
bool | video_started |
If video started or not. | |
mipi_dsi_clock_state_t | clock_state |
Clock state. | |
mipi_dsi_lane_t | ulps_status |
Ultra-low Power State active status. | |
mipi_dsi_cfg_t const * | p_cfg |
Pointer to configuration structure used to open the interface. | |
void(* | p_callback )(mipi_dsi_callback_args_t *) |
Pointer to callback that is called when an adc_event_t occurs. | |
void const * | p_context |
Pointer to context to be passed into callback function. | |
mipi_dsi_callback_args_t * | p_callback_memory |
Pointer to non-secure memory that can be used to pass arguments to a callback in non-secure memory. | |
fsp_err_t R_MIPI_DSI_B_Open | ( | mipi_dsi_ctrl_t *const | p_api_ctrl, |
mipi_dsi_cfg_t const *const | p_cfg | ||
) |
Initialize the MIPI DSI peripheral.
FSP_SUCCESS | The channel was successfully opened. |
FSP_ERR_ASSERTION | One or both of the parameters was NULL. |
FSP_ERR_ALREADY_OPEN | The instance is already opened. |
FSP_ERR_INVALID_STATE | Display module must be opened before DSI. |
fsp_err_t R_MIPI_DSI_B_Close | ( | mipi_dsi_ctrl_t *const | p_api_ctrl | ) |
Close MIPI DSI and display data instances, disable interrupts, and power-off the module.
FSP_SUCCESS | The channel is successfully closed. |
FSP_ERR_ASSERTION | p_api_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Instance is not open. |
FSP_ERR_IN_USE | Operation in progress and must be stopped before closing. |
fsp_err_t R_MIPI_DSI_B_Start | ( | mipi_dsi_ctrl_t *const | p_api_ctrl | ) |
Start video output. Initialize Video Output Registers Perform sequence steps from section 34.4.2.4.(1) in RZ/A3M hardware manual.
FSP_SUCCESS | Data is successfully written to the D/A Converter. |
FSP_ERR_ASSERTION | p_api_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Instance is not open. |
FSP_ERR_IN_USE | The physical interface is currently in use. |
FSP_ERR_INVALID_STATE | DSI is already in video mode. |
fsp_err_t R_MIPI_DSI_B_UlpsEnter | ( | mipi_dsi_ctrl_t *const | p_api_ctrl, |
mipi_dsi_lane_t | lane | ||
) |
Enter Ultra-low Power State (ULPS).
FSP_SUCCESS | Information read successfully. |
FSP_ERR_ASSERTION | p_api_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Instance is not open. |
FSP_ERR_INVALID_MODE | Invalid mode for transition. |
FSP_ERR_INVALID_ARGUMENT | Invalid input parameter. |
fsp_err_t R_MIPI_DSI_B_UlpsExit | ( | mipi_dsi_ctrl_t *const | p_api_ctrl, |
mipi_dsi_lane_t | lane | ||
) |
Exit Ultra-low Power State (ULPS).
FSP_SUCCESS | Information read successfully. |
FSP_ERR_ASSERTION | p_api_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Instance is not open. |
FSP_ERR_INVALID_ARGUMENT | Invalid input parameter. |
fsp_err_t R_MIPI_DSI_B_Stop | ( | mipi_dsi_ctrl_t *const | p_api_ctrl | ) |
Stop video output.
FSP_SUCCESS | Data is successfully written to the D/A Converter. |
FSP_ERR_ASSERTION | p_api_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Instance is not open. |
FSP_ERR_IN_USE | DSI cannot be closed while ULPS is active. |
fsp_err_t R_MIPI_DSI_B_Command | ( | mipi_dsi_ctrl_t *const | p_api_ctrl, |
mipi_dsi_cmd_t * | p_cmd | ||
) |
Send a command to the peripheral device.
FSP_SUCCESS | Command(s) queued successfully. |
FSP_ERR_ASSERTION | p_api_ctrl is NULL. cmd_id specifies a long packet but p_data is NULL. |
FSP_ERR_NOT_OPEN | Instance is not open. |
FSP_ERR_IN_USE | The physical interface is currently in use or video mode is in operation. |
FSP_ERR_INVALID_POINTER | Invalid pointer provided |
FSP_ERR_INVALID_ARGUMENT | Invalid message configuration |
FSP_ERR_INVALID_CHANNEL | Invalid channel for provided message configuration |
fsp_err_t R_MIPI_DSI_B_StatusGet | ( | mipi_dsi_ctrl_t *const | p_api_ctrl, |
mipi_dsi_status_t * | p_status | ||
) |
Provide information about current MIPI DSI status.
Note: Acknowledge and Error Status is only cleared when read by calling this function.
FSP_SUCCESS | Information read successfully. |
FSP_ERR_ASSERTION | p_api_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Instance is not open. |