RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Data Structures
Mipi_dsi

Data Structures

struct  MIPI_DSI_Type
 MIPI DSI structure definition. More...
 
struct  _dsi_config
 MIPI DSI controller configuration. More...
 
struct  _dsi_dpi_config
 MIPI DSI controller DPI interface configuration. More...
 
struct  _dsi_dphy_config
 MIPI DSI D-PHY configuration. More...
 
struct  _dsi_transfer
 Structure for the data transfer. More...
 
struct  _dsi_handle
 MIPI DSI transfer handle structure. More...
 

Driver version

enum  { kStatus_DSI_Busy = MAKE_STATUS((int32_t)kStatusGroup_MIPI_DSI, 0) , kStatus_DSI_RxDataError = MAKE_STATUS((int32_t)kStatusGroup_MIPI_DSI, 1) , kStatus_DSI_ErrorReportReceived , kStatus_DSI_NotSupported = MAKE_STATUS((int32_t)kStatusGroup_MIPI_DSI, 3) }
 Error codes for the MIPI DSI driver. More...
 
enum  _dsi_dpi_color_coding {
  kDSI_Dpi16BitConfig1 = 0U , kDSI_Dpi16BitConfig2 = 1U , kDSI_Dpi16BitConfig3 = 2U , kDSI_Dpi18BitConfig1 = 3U ,
  kDSI_Dpi18BitConfig2 = 4U , kDSI_Dpi24Bit = 5U
}
 MIPI DPI interface color coding. More...
 
enum  _dsi_dpi_pixel_packet { kDSI_PixelPacket16Bit = 0U , kDSI_PixelPacket18Bit = 1U , kDSI_PixelPacket18BitLoosely = 2U , kDSI_PixelPacket24Bit = 3U }
 MIPI DSI pixel packet type send through DPI interface. More...
 
enum  { kDSI_DpiVsyncActiveLow = 0U , kDSI_DpiHsyncActiveLow = 0U , kDSI_DpiVsyncActiveHigh = (1U << 0U) , kDSI_DpiHsyncActiveHigh = (1U << 1U) }
 _dsi_dpi_polarity_flag DPI signal polarity. More...
 
enum  _dsi_dpi_video_mode { kDSI_DpiNonBurstWithSyncPulse = 0U , kDSI_DpiNonBurstWithSyncEvent = 1U , kDSI_DpiBurst = 2U }
 DPI video mode. More...
 
enum  _dsi_dpi_bllp_mode { kDSI_DpiBllpLowPower , kDSI_DpiBllpBlanking , kDSI_DpiBllpNull }
 Behavior in BLLP (Blanking or Low-Power Interval). More...
 
enum  {
  kDSI_ApbNotIdle = (1UL << 0U) , kDSI_ApbTxDone = (1UL << 1U) , kDSI_ApbRxControl = (1UL << 2U) , kDSI_ApbTxOverflow = (1UL << 3U) ,
  kDSI_ApbTxUnderflow = (1UL << 4U) , kDSI_ApbRxOverflow = (1UL << 5U) , kDSI_ApbRxUnderflow = (1UL << 6U) , kDSI_ApbRxHeaderReceived = (1UL << 7U) ,
  kDSI_ApbRxPacketReceived = (1UL << 8U)
}
 _dsi_apb_status Status of APB to packet interface. More...
 
enum  {
  kDSI_RxErrorEccOneBit = (1UL << 0U) , kDSI_RxErrorEccMultiBit = (1UL << 1U) , kDSI_RxErrorCrc = (1UL << 7U) , kDSI_RxErrorHtxTo = (1UL << 8U) ,
  kDSI_RxErrorLrxTo = (1UL << 9U) , kDSI_RxErrorBtaTo = (1UL << 10U)
}
 _dsi_rx_error_status Host receive error status. More...
 
enum  _dsi_host_status {
  kDSI_HostSoTError = (1UL << 0U) , kDSI_HostSoTSyncError = (1UL << 1U) , kDSI_HostEoTSyncError = (1UL << 2U) , kDSI_HostEscEntryCmdError = (1UL << 3U) ,
  kDSI_HostLpTxSyncError = (1UL << 4U) , kDSI_HostPeriphToError = (1UL << 5U) , kDSI_HostFalseControlError = (1UL << 6U) , kDSI_HostContentionDetected = (1UL << 7U) ,
  kDSI_HostEccErrorOneBit = (1UL << 8U) , kDSI_HostEccErrorMultiBit = (1UL << 9U) , kDSI_HostChecksumError = (1UL << 10U) , kDSI_HostInvalidDataType = (1UL << 11U) ,
  kDSI_HostInvalidVcId = (1UL << 12U) , kDSI_HostInvalidTxLength = (1UL << 13U) , kDSI_HostProtocalViolation = (1UL << 15U) , kDSI_HostResetTriggerReceived = (1UL << 16U) ,
  kDSI_HostTearTriggerReceived = (1UL << 17U) , kDSI_HostAckTriggerReceived = (1UL << 18U)
}
 DSI host controller status (status_out) More...
 
enum  {
  kDSI_InterruptGroup1ApbNotIdle = (1UL << 0U) , kDSI_InterruptGroup1ApbTxDone = (1UL << 1U) , kDSI_InterruptGroup1ApbRxControl = (1UL << 2U) , kDSI_InterruptGroup1ApbTxOverflow = (1UL << 3U) ,
  kDSI_InterruptGroup1ApbTxUnderflow = (1UL << 4U) , kDSI_InterruptGroup1ApbRxOverflow = (1UL << 5U) , kDSI_InterruptGroup1ApbRxUnderflow = (1UL << 6U) , kDSI_InterruptGroup1ApbRxHeaderReceived = (1UL << 7U) ,
  kDSI_InterruptGroup1ApbRxPacketReceived = (1UL << 8U) , kDSI_InterruptGroup1SoTError = (1UL << 9U) , kDSI_InterruptGroup1SoTSyncError = (1UL << 10U) , kDSI_InterruptGroup1EoTSyncError = (1UL << 11U) ,
  kDSI_InterruptGroup1EscEntryCmdError = (1UL << 12U) , kDSI_InterruptGroup1LpTxSyncError = (1UL << 13U) , kDSI_InterruptGroup1PeriphToError = (1UL << 14U) , kDSI_InterruptGroup1FalseControlError = (1UL << 15U) ,
  kDSI_InterruptGroup1ContentionDetected = (1UL << 16U) , kDSI_InterruptGroup1EccErrorOneBit = (1UL << 17U) , kDSI_InterruptGroup1EccErrorMultiBit = (1UL << 18U) , kDSI_InterruptGroup1ChecksumError = (1UL << 19U) ,
  kDSI_InterruptGroup1InvalidDataType = (1UL << 20U) , kDSI_InterruptGroup1InvalidVcId = (1UL << 21U) , kDSI_InterruptGroup1InvalidTxLength = (1UL << 22U) , kDSI_InterruptGroup1ProtocalViolation = (1UL << 24U) ,
  kDSI_InterruptGroup1ResetTriggerReceived = (1UL << 25U) , kDSI_InterruptGroup1TearTriggerReceived = (1UL << 26U) , kDSI_InterruptGroup1AckTriggerReceived = (1UL << 27U) , kDSI_InterruptGroup1HtxTo = (1UL << 29U) ,
  kDSI_InterruptGroup1LrxTo = (1UL << 30U) , kDSI_InterruptGroup1BtaTo = (1UL << 31U) , kDSI_InterruptGroup2EccOneBit = (1UL << 0U) , kDSI_InterruptGroup2EccMultiBit = (1UL << 1U) ,
  kDSI_InterruptGroup2CrcError = (1UL << 2U)
}
 _dsi_interrupt DSI interrupt. More...
 
enum  _dsi_tx_data_type {
  kDSI_TxDataVsyncStart = 0x01U , kDSI_TxDataVsyncEnd = 0x11U , kDSI_TxDataHsyncStart = 0x21U , kDSI_TxDataHsyncEnd = 0x31U ,
  kDSI_TxDataEoTp = 0x08U , kDSI_TxDataCmOff = 0x02U , kDSI_TxDataCmOn = 0x12U , kDSI_TxDataShutDownPeriph = 0x22U ,
  kDSI_TxDataTurnOnPeriph = 0x32U , kDSI_TxDataGenShortWrNoParam = 0x03U , kDSI_TxDataGenShortWrOneParam = 0x13U , kDSI_TxDataGenShortWrTwoParam = 0x23U ,
  kDSI_TxDataGenShortRdNoParam = 0x04U , kDSI_TxDataGenShortRdOneParam = 0x14U , kDSI_TxDataGenShortRdTwoParam = 0x24U , kDSI_TxDataDcsShortWrNoParam = 0x05U ,
  kDSI_TxDataDcsShortWrOneParam = 0x15U , kDSI_TxDataDcsShortRdNoParam = 0x06U , kDSI_TxDataSetMaxReturnPktSize = 0x37U , kDSI_TxDataNull = 0x09U ,
  kDSI_TxDataBlanking = 0x19U , kDSI_TxDataGenLongWr = 0x29U , kDSI_TxDataDcsLongWr = 0x39U , kDSI_TxDataLooselyPackedPixel20BitYCbCr = 0x0CU ,
  kDSI_TxDataPackedPixel24BitYCbCr = 0x1CU , kDSI_TxDataPackedPixel16BitYCbCr = 0x2CU , kDSI_TxDataPackedPixel30BitRGB = 0x0DU , kDSI_TxDataPackedPixel36BitRGB = 0x1DU ,
  kDSI_TxDataPackedPixel12BitYCrCb = 0x3DU , kDSI_TxDataPackedPixel16BitRGB = 0x0EU , kDSI_TxDataPackedPixel18BitRGB = 0x1EU , kDSI_TxDataLooselyPackedPixel18BitRGB = 0x2EU ,
  kDSI_TxDataPackedPixel24BitRGB = 0x3EU
}
 DSI TX data type. More...
 
enum  _dsi_rx_data_type {
  kDSI_RxDataAckAndErrorReport = 0x02U , kDSI_RxDataEoTp = 0x08U , kDSI_RxDataGenShortRdResponseOneByte = 0x11U , kDSI_RxDataGenShortRdResponseTwoByte = 0x12U ,
  kDSI_RxDataGenLongRdResponse = 0x1AU , kDSI_RxDataDcsLongRdResponse = 0x1CU , kDSI_RxDataDcsShortRdResponseOneByte = 0x21U , kDSI_RxDataDcsShortRdResponseTwoByte = 0x22U
}
 DSI RX data type. More...
 
enum  { kDSI_TransferUseHighSpeed = (1U << 0U) , kDSI_TransferPerformBTA = (1U << 1U) }
 _dsi_transfer_flags DSI transfer control flags. More...
 
typedef struct _dsi_config dsi_config_t
 MIPI DSI controller configuration.
 
typedef enum _dsi_dpi_color_coding dsi_dpi_color_coding_t
 MIPI DPI interface color coding.
 
typedef enum _dsi_dpi_pixel_packet dsi_dpi_pixel_packet_t
 MIPI DSI pixel packet type send through DPI interface.
 
typedef enum _dsi_dpi_video_mode dsi_dpi_video_mode_t
 DPI video mode.
 
typedef enum _dsi_dpi_bllp_mode dsi_dpi_bllp_mode_t
 Behavior in BLLP (Blanking or Low-Power Interval).
 
typedef struct _dsi_dpi_config dsi_dpi_config_t
 MIPI DSI controller DPI interface configuration.
 
typedef struct _dsi_dphy_config dsi_dphy_config_t
 MIPI DSI D-PHY configuration.
 
typedef enum _dsi_tx_data_type dsi_tx_data_type_t
 DSI TX data type.
 
typedef enum _dsi_rx_data_type dsi_rx_data_type_t
 DSI RX data type.
 
typedef struct _dsi_transfer dsi_transfer_t
 Structure for the data transfer.
 
typedef struct _dsi_handle dsi_handle_t
 MIPI DSI transfer handle.
 
typedef void(* dsi_callback_t) (const MIPI_DSI_Type *base, dsi_handle_t *handle, status_t status, void *userData)
 MIPI DSI callback for finished transfer.
 
#define FSL_MIPI_DSI_DRIVER_VERSION   (MAKE_VERSION(2, 2, 3))
 
#define FSL_DSI_TX_MAX_PAYLOAD_BYTE   (64U * 4U)
 
#define FSL_DSI_RX_MAX_PAYLOAD_BYTE   (64U * 4U)
 

MIPI_DSI host initialization.

void DSI_Init (const MIPI_DSI_Type *base, const dsi_config_t *config)
 Initializes an MIPI DSI host with the user configuration.
 
void DSI_Deinit (const MIPI_DSI_Type *base)
 Deinitializes an MIPI DSI host.
 
void DSI_GetDefaultConfig (dsi_config_t *config)
 Get the default configuration to initialize the MIPI DSI host.
 

DPI interface

void DSI_SetDpiConfig (const MIPI_DSI_Type *base, const dsi_dpi_config_t *config, uint8_t numLanes, uint32_t dpiPixelClkFreq_Hz, uint32_t dsiHsBitClkFreq_Hz)
 Configure the DPI interface core.
 

D-PHY configuration.

uint32_t DSI_InitDphy (const MIPI_DSI_Type *base, const dsi_dphy_config_t *config, uint32_t refClkFreq_Hz)
 Initializes the D-PHY.
 
void DSI_DeinitDphy (const MIPI_DSI_Type *base)
 Deinitializes the D-PHY.
 
void DSI_GetDphyDefaultConfig (dsi_dphy_config_t *config, uint32_t txHsBitClk_Hz, uint32_t txEscClk_Hz)
 Get the default D-PHY configuration.
 

MIPI DSI APB

void DSI_SetApbPacketControl (const MIPI_DSI_Type *base, uint16_t wordCount, uint8_t virtualChannel, dsi_tx_data_type_t dataType, uint8_t flags)
 Configure the APB packet to send.
 
void DSI_WriteApbTxPayload (const MIPI_DSI_Type *base, const uint8_t *payload, uint16_t payloadSize)
 Fill the long APB packet payload.
 
void DSI_WriteApbTxPayloadExt (const MIPI_DSI_Type *base, const uint8_t *payload, uint16_t payloadSize, bool sendDscCmd, uint8_t dscCmd)
 Extended function to fill the payload to TX FIFO.
 
void DSI_ReadApbRxPayload (const MIPI_DSI_Type *base, uint8_t *payload, uint16_t payloadSize)
 Read the long APB packet payload.
 
status_t DSI_TransferBlocking (const MIPI_DSI_Type *base, dsi_transfer_t *xfer)
 APB data transfer using blocking method.
 

Transactional

status_t DSI_TransferCreateHandle (const MIPI_DSI_Type *base, dsi_handle_t *handle, dsi_callback_t callback, void *userData)
 Create the MIPI DSI handle.
 
status_t DSI_TransferNonBlocking (const MIPI_DSI_Type *base, dsi_handle_t *handle, dsi_transfer_t *xfer)
 APB data transfer using interrupt method.
 
void DSI_TransferAbort (const MIPI_DSI_Type *base, dsi_handle_t *handle)
 Abort current APB data transfer.
 
void DSI_TransferHandleIRQ (const MIPI_DSI_Type *base, dsi_handle_t *handle)
 Interrupt handler for the DSI.
 

Detailed Description

Typedef Documentation

◆ dsi_callback_t

typedef void(* dsi_callback_t) (const MIPI_DSI_Type *base, dsi_handle_t *handle, status_t status, void *userData)

MIPI DSI callback for finished transfer.

When transfer finished, one of these status values will be passed to the user:

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Error codes for the MIPI DSI driver.

Enumerator
kStatus_DSI_Busy 

DSI is busy.

kStatus_DSI_RxDataError 

Read data error.

kStatus_DSI_ErrorReportReceived 

Error report package received.

kStatus_DSI_NotSupported 

The transfer type not supported.

◆ anonymous enum

anonymous enum

_dsi_dpi_polarity_flag DPI signal polarity.

Enumerator
kDSI_DpiVsyncActiveLow 

VSYNC active low.

kDSI_DpiHsyncActiveLow 

HSYNC active low.

kDSI_DpiVsyncActiveHigh 

VSYNC active high.

kDSI_DpiHsyncActiveHigh 

HSYNC active high.

◆ anonymous enum

anonymous enum

_dsi_apb_status Status of APB to packet interface.

Enumerator
kDSI_ApbNotIdle 

State machine not idle

kDSI_ApbTxDone 

Tx packet done

kDSI_ApbRxControl 

DPHY direction 0 - tx had control, 1 - rx has control

kDSI_ApbTxOverflow 

TX fifo overflow

kDSI_ApbTxUnderflow 

TX fifo underflow

kDSI_ApbRxOverflow 

RX fifo overflow

kDSI_ApbRxUnderflow 

RX fifo underflow

kDSI_ApbRxHeaderReceived 

RX packet header has been received

kDSI_ApbRxPacketReceived 

All RX packet payload data has been received

◆ anonymous enum

anonymous enum

_dsi_rx_error_status Host receive error status.

Enumerator
kDSI_RxErrorEccOneBit 

ECC single bit error detected.

kDSI_RxErrorEccMultiBit 

ECC multi bit error detected.

kDSI_RxErrorCrc 

CRC error detected.

kDSI_RxErrorHtxTo 

High Speed forward TX timeout detected.

kDSI_RxErrorLrxTo 

Reverse Low power data receive timeout detected.

kDSI_RxErrorBtaTo 

BTA timeout detected.

◆ anonymous enum

anonymous enum

_dsi_interrupt DSI interrupt.

Enumerator
kDSI_InterruptGroup1ApbNotIdle 

State machine not idle

kDSI_InterruptGroup1ApbTxDone 

Tx packet done

kDSI_InterruptGroup1ApbRxControl 

DPHY direction 0 - tx control, 1 - rx control

kDSI_InterruptGroup1ApbTxOverflow 

TX fifo overflow

kDSI_InterruptGroup1ApbTxUnderflow 

TX fifo underflow

kDSI_InterruptGroup1ApbRxOverflow 

RX fifo overflow

kDSI_InterruptGroup1ApbRxUnderflow 

RX fifo underflow

kDSI_InterruptGroup1ApbRxHeaderReceived 

RX packet header has been received

kDSI_InterruptGroup1ApbRxPacketReceived 

All RX packet payload data has been received

kDSI_InterruptGroup1SoTError 

SoT error from peripheral error report.

kDSI_InterruptGroup1SoTSyncError 

SoT Sync error from peripheral error report.

kDSI_InterruptGroup1EoTSyncError 

EoT Sync error from peripheral error report.

kDSI_InterruptGroup1EscEntryCmdError 

Escape Mode Entry Command Error from peripheral error report.

kDSI_InterruptGroup1LpTxSyncError 

Low-power transmit Sync Error from peripheral error report.

kDSI_InterruptGroup1PeriphToError 

Peripheral timeout error from peripheral error report.

kDSI_InterruptGroup1FalseControlError 

False control error from peripheral error report.

kDSI_InterruptGroup1ContentionDetected 

Contention detected from peripheral error report.

kDSI_InterruptGroup1EccErrorOneBit 

Single bit ECC error (corrected) from peripheral error report.

kDSI_InterruptGroup1EccErrorMultiBit 

Multi bit ECC error (not corrected) from peripheral error report.

kDSI_InterruptGroup1ChecksumError 

Checksum error from peripheral error report.

kDSI_InterruptGroup1InvalidDataType 

DSI data type not recognized.

kDSI_InterruptGroup1InvalidVcId 

DSI VC ID invalid.

kDSI_InterruptGroup1InvalidTxLength 

Invalid transmission length.

kDSI_InterruptGroup1ProtocalViolation 

DSI protocal violation.

kDSI_InterruptGroup1ResetTriggerReceived 

Reset trigger received.

kDSI_InterruptGroup1TearTriggerReceived 

Tear effect trigger receive.

kDSI_InterruptGroup1AckTriggerReceived 

Acknowledge trigger message received.

kDSI_InterruptGroup1HtxTo 

High speed TX timeout.

kDSI_InterruptGroup1LrxTo 

Low power RX timeout.

kDSI_InterruptGroup1BtaTo 

Host BTA timeout.

kDSI_InterruptGroup2EccOneBit 

Sinle bit ECC error.

kDSI_InterruptGroup2EccMultiBit 

Multi bit ECC error.

kDSI_InterruptGroup2CrcError 

CRC error.

◆ anonymous enum

anonymous enum

_dsi_transfer_flags DSI transfer control flags.

Enumerator
kDSI_TransferUseHighSpeed 

Use high speed mode or not.

kDSI_TransferPerformBTA 

Perform BTA or not.

◆ _dsi_dpi_bllp_mode

Behavior in BLLP (Blanking or Low-Power Interval).

Enumerator
kDSI_DpiBllpLowPower 

LP mode used in BLLP periods.

kDSI_DpiBllpBlanking 

Blanking packets used in BLLP periods.

kDSI_DpiBllpNull 

Null packets used in BLLP periods.

◆ _dsi_dpi_color_coding

MIPI DPI interface color coding.

Enumerator
kDSI_Dpi16BitConfig1 

16-bit configuration 1. RGB565: XXXXXXXX_RRRRRGGG_GGGBBBBB.

kDSI_Dpi16BitConfig2 

16-bit configuration 2. RGB565: XXXRRRRR_XXGGGGGG_XXXBBBBB.

kDSI_Dpi16BitConfig3 

16-bit configuration 3. RGB565: XXRRRRRX_XXGGGGGG_XXBBBBBX.

kDSI_Dpi18BitConfig1 

18-bit configuration 1. RGB666: XXXXXXRR_RRRRGGGG_GGBBBBBB.

kDSI_Dpi18BitConfig2 

18-bit configuration 2. RGB666: XXRRRRRR_XXGGGGGG_XXBBBBBB.

kDSI_Dpi24Bit 

24-bit.

◆ _dsi_dpi_pixel_packet

MIPI DSI pixel packet type send through DPI interface.

Enumerator
kDSI_PixelPacket16Bit 

16 bit RGB565.

kDSI_PixelPacket18Bit 

18 bit RGB666 packed.

kDSI_PixelPacket18BitLoosely 

18 bit RGB666 loosely packed into three bytes.

kDSI_PixelPacket24Bit 

24 bit RGB888, each pixel uses three bytes.

◆ _dsi_dpi_video_mode

DPI video mode.

Enumerator
kDSI_DpiNonBurstWithSyncPulse 

Non-Burst mode with Sync Pulses.

kDSI_DpiNonBurstWithSyncEvent 

Non-Burst mode with Sync Events.

kDSI_DpiBurst 

Burst mode.

◆ _dsi_host_status

DSI host controller status (status_out)

Enumerator
kDSI_HostSoTError 

SoT error from peripheral error report.

kDSI_HostSoTSyncError 

SoT Sync error from peripheral error report.

kDSI_HostEoTSyncError 

EoT Sync error from peripheral error report.

kDSI_HostEscEntryCmdError 

Escape Mode Entry Command Error from peripheral error report.

kDSI_HostLpTxSyncError 

Low-power transmit Sync Error from peripheral error report.

kDSI_HostPeriphToError 

Peripheral timeout error from peripheral error report.

kDSI_HostFalseControlError 

False control error from peripheral error report.

kDSI_HostContentionDetected 

Contention detected from peripheral error report.

kDSI_HostEccErrorOneBit 

Single bit ECC error (corrected) from peripheral error report.

kDSI_HostEccErrorMultiBit 

Multi bit ECC error (not corrected) from peripheral error report.

kDSI_HostChecksumError 

Checksum error from peripheral error report.

kDSI_HostInvalidDataType 

DSI data type not recognized.

kDSI_HostInvalidVcId 

DSI VC ID invalid.

kDSI_HostInvalidTxLength 

Invalid transmission length.

kDSI_HostProtocalViolation 

DSI protocal violation.

kDSI_HostResetTriggerReceived 

Reset trigger received.

kDSI_HostTearTriggerReceived 

Tear effect trigger receive.

kDSI_HostAckTriggerReceived 

Acknowledge trigger message received.

◆ _dsi_rx_data_type

DSI RX data type.

Enumerator
kDSI_RxDataAckAndErrorReport 

Acknowledge and Error Report

kDSI_RxDataEoTp 

End of Transmission packet.

kDSI_RxDataGenShortRdResponseOneByte 

Generic Short READ Response, 1 byte returned.

kDSI_RxDataGenShortRdResponseTwoByte 

Generic Short READ Response, 2 byte returned.

kDSI_RxDataGenLongRdResponse 

Generic Long READ Response.

kDSI_RxDataDcsLongRdResponse 

DCS Long READ Response.

kDSI_RxDataDcsShortRdResponseOneByte 

DCS Short READ Response, 1 byte returned.

kDSI_RxDataDcsShortRdResponseTwoByte 

DCS Short READ Response, 2 byte returned.

◆ _dsi_tx_data_type

DSI TX data type.

Enumerator
kDSI_TxDataVsyncStart 

V Sync start.

kDSI_TxDataVsyncEnd 

V Sync end.

kDSI_TxDataHsyncStart 

H Sync start.

kDSI_TxDataHsyncEnd 

H Sync end.

kDSI_TxDataEoTp 

End of transmission packet.

kDSI_TxDataCmOff 

Color mode off.

kDSI_TxDataCmOn 

Color mode on.

kDSI_TxDataShutDownPeriph 

Shut down peripheral.

kDSI_TxDataTurnOnPeriph 

Turn on peripheral.

kDSI_TxDataGenShortWrNoParam 

Generic Short WRITE, no parameters.

kDSI_TxDataGenShortWrOneParam 

Generic Short WRITE, one parameter.

kDSI_TxDataGenShortWrTwoParam 

Generic Short WRITE, two parameter.

kDSI_TxDataGenShortRdNoParam 

Generic Short READ, no parameters.

kDSI_TxDataGenShortRdOneParam 

Generic Short READ, one parameter.

kDSI_TxDataGenShortRdTwoParam 

Generic Short READ, two parameter.

kDSI_TxDataDcsShortWrNoParam 

DCS Short WRITE, no parameters.

kDSI_TxDataDcsShortWrOneParam 

DCS Short WRITE, one parameter.

kDSI_TxDataDcsShortRdNoParam 

DCS Short READ, no parameters.

kDSI_TxDataSetMaxReturnPktSize 

Set the Maximum Return Packet Size.

kDSI_TxDataNull 

Null Packet, no data.

kDSI_TxDataBlanking 

Blanking Packet, no data.

kDSI_TxDataGenLongWr 

Generic long write.

kDSI_TxDataDcsLongWr 

DCS Long Write/write_LUT Command Packet.

kDSI_TxDataLooselyPackedPixel20BitYCbCr 

Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 Format.

kDSI_TxDataPackedPixel24BitYCbCr 

Packed Pixel Stream, 24-bit YCbCr, 4:2:2 Format.

kDSI_TxDataPackedPixel16BitYCbCr 

Packed Pixel Stream, 16-bit YCbCr, 4:2:2 Format.

kDSI_TxDataPackedPixel30BitRGB 

Packed Pixel Stream, 30-bit RGB, 10-10-10 Format.

kDSI_TxDataPackedPixel36BitRGB 

Packed Pixel Stream, 36-bit RGB, 12-12-12 Format.

kDSI_TxDataPackedPixel12BitYCrCb 

Packed Pixel Stream, 12-bit YCbCr, 4:2:0 Format.

kDSI_TxDataPackedPixel16BitRGB 

Packed Pixel Stream, 16-bit RGB, 5-6-5 Format.

kDSI_TxDataPackedPixel18BitRGB 

Packed Pixel Stream, 18-bit RGB, 6-6-6 Format.

kDSI_TxDataLooselyPackedPixel18BitRGB 

Loosely Packed Pixel Stream, 18-bit RGB, 6-6-6 Format.

kDSI_TxDataPackedPixel24BitRGB 

Packed Pixel Stream, 24-bit RGB, 8-8-8 Format.

Function Documentation

◆ DSI_Deinit()

void DSI_Deinit ( const MIPI_DSI_Type base)

Deinitializes an MIPI DSI host.

This function should be called after all bother MIPI DSI driver functions.

Parameters
baseMIPI DSI host peripheral base address.

brief Deinitializes an MIPI DSI host.

This function should be called after all bother MIPI DSI driver functions.

param base MIPI DSI host peripheral base address.

◆ DSI_DeinitDphy()

void DSI_DeinitDphy ( const MIPI_DSI_Type base)

Deinitializes the D-PHY.

Power down the D-PHY PLL and shut down D-PHY.

Parameters
baseMIPI DSI host peripheral base address.

brief Deinitializes the D-PHY

Power down the D-PHY PLL and shut down D-PHY.

param base MIPI DSI host peripheral base address.

◆ DSI_GetDefaultConfig()

void DSI_GetDefaultConfig ( dsi_config_t config)

Get the default configuration to initialize the MIPI DSI host.

The default value is:

config->numLanes = 4;
config->enableNonContinuousHsClk = false;
config->enableTxUlps = false;
config->autoInsertEoTp = true;
config->numExtraEoTp = 0;
config->htxTo_ByteClk = 0;
config->lrxHostTo_ByteClk = 0;
config->btaTo_ByteClk = 0;
Definition: deflate.c:114
Parameters
configPointer to a user-defined configuration structure.

brief Get the default configuration to initialize the MIPI DSI host.

The default value is: code config->numLanes = 4; config->enableNonContinuousHsClk = false; config->enableTxUlps = false; config->autoInsertEoTp = true; config->numExtraEoTp = 0; config->htxTo_ByteClk = 0; config->lrxHostTo_ByteClk = 0; config->btaTo_ByteClk = 0; endcode

param config Pointer to a user-defined configuration structure.

◆ DSI_GetDphyDefaultConfig()

void DSI_GetDphyDefaultConfig ( dsi_dphy_config_t config,
uint32_t  txHsBitClk_Hz,
uint32_t  txEscClk_Hz 
)

Get the default D-PHY configuration.

Gets the default D-PHY configuration, the timing parameters are set according to D-PHY specification. User could use the configuration directly, or change some parameters according to the special device.

Parameters
configPointer to the D-PHY configuration.
txHsBitClk_HzHigh speed bit clock in Hz.
txEscClk_HzEsc clock in Hz.

brief Get the default D-PHY configuration.

Gets the default D-PHY configuration, the timing parameters are set according to D-PHY specification. User could use the configuration directly, or change some parameters according to the special device.

param config Pointer to the D-PHY configuration. param txHsBitClk_Hz High speed bit clock in Hz. param txEscClk_Hz Esc clock in Hz.

◆ DSI_Init()

void DSI_Init ( const MIPI_DSI_Type base,
const dsi_config_t config 
)

Initializes an MIPI DSI host with the user configuration.

This function initializes the MIPI DSI host with the configuration, it should be called first before other MIPI DSI driver functions.

Parameters
baseMIPI DSI host peripheral base address.
configPointer to a user-defined configuration structure.

brief Initializes an MIPI DSI host with the user configuration.

This function initializes the MIPI DSI host with the configuration, it should be called first before other MIPI DSI driver functions.

param base MIPI DSI host peripheral base address. param config Pointer to a user-defined configuration structure.

◆ DSI_InitDphy()

uint32_t DSI_InitDphy ( const MIPI_DSI_Type base,
const dsi_dphy_config_t config,
uint32_t  refClkFreq_Hz 
)

Initializes the D-PHY.

This function configures the D-PHY timing and setups the D-PHY PLL based on user configuration. The configuration structure could be got by the function DSI_GetDphyDefaultConfig.

For some platforms there is not dedicated D-PHY PLL, indicated by the macro FSL_FEATURE_MIPI_DSI_NO_DPHY_PLL. For these platforms, the refClkFreq_Hz is useless.

Parameters
baseMIPI DSI host peripheral base address.
configPointer to the D-PHY configuration.
refClkFreq_HzThe REFCLK frequency in Hz.
Returns
The actual D-PHY PLL output frequency. If could not configure the PLL to the target frequency, the return value is 0.

brief Initializes the D-PHY

This function configures the D-PHY timing and setups the D-PHY PLL based on user configuration. The configuration structure could be got by the function ref DSI_GetDphyDefaultConfig.

param base MIPI DSI host peripheral base address. param config Pointer to the D-PHY configuration. param refClkFreq_Hz The REFCLK frequency in Hz. return The actual D-PHY PLL output frequency. If could not configure the PLL to the target frequency, the return value is 0.

◆ DSI_ReadApbRxPayload()

void DSI_ReadApbRxPayload ( const MIPI_DSI_Type base,
uint8_t *  payload,
uint16_t  payloadSize 
)

Read the long APB packet payload.

Read the long packet payload from RX FIFO. This function reads directly but does not check the RX FIFO status. Upper layer should make sure there are available data.

Parameters
baseMIPI DSI host peripheral base address.
payloadPointer to the payload.
payloadSizePayload size in byte.

brief Read the long APB packet payload.

Read the long packet payload from RX FIFO. This function reads directly but does not check the RX FIFO status. Upper layer should make sure there are available data.

param base MIPI DSI host peripheral base address. param payload Pointer to the payload. param payloadSize Payload size in byte.

◆ DSI_SetApbPacketControl()

void DSI_SetApbPacketControl ( const MIPI_DSI_Type base,
uint16_t  wordCount,
uint8_t  virtualChannel,
dsi_tx_data_type_t  dataType,
uint8_t  flags 
)

Configure the APB packet to send.

This function configures the next APB packet transfer. After configuration, the packet transfer could be started with function DSI_SendApbPacket. If the packet is long packet, Use DSI_WriteApbTxPayload to fill the payload before start transfer.

Parameters
baseMIPI DSI host peripheral base address.
wordCountFor long packet, this is the byte count of the payload. For short packet, this is (data1 << 8) | data0.
virtualChannelVirtual channel.
dataTypeThe packet data type, (DI).
flagsThe transfer control flags, see _dsi_transfer_flags.

brief Configure the APB packet to send.

This function configures the next APB packet transfer. After configuration, the packet transfer could be started with function ref DSI_SendApbPacket. If the packet is long packet, Use ref DSI_WriteApbTxPayload to fill the payload before start transfer.

param base MIPI DSI host peripheral base address. param wordCount For long packet, this is the byte count of the payload. For short packet, this is (data1 << 8) | data0. param virtualChannel Virtual channel. param dataType The packet data type, (DI). param flags The transfer control flags, see ref _dsi_transfer_flags.

◆ DSI_SetDpiConfig()

void DSI_SetDpiConfig ( const MIPI_DSI_Type base,
const dsi_dpi_config_t config,
uint8_t  numLanes,
uint32_t  dpiPixelClkFreq_Hz,
uint32_t  dsiHsBitClkFreq_Hz 
)

Configure the DPI interface core.

This function sets the DPI interface configuration, it should be used in video mode.

Parameters
baseMIPI DSI host peripheral base address.
configPointer to the DPI interface configuration.
numLanesLane number, should be same with the setting in dsi_dpi_config_t.
dpiPixelClkFreq_HzThe DPI pixel clock frequency in Hz.
dsiHsBitClkFreq_HzThe DSI high speed bit clock frequency in Hz. It is the same with DPHY PLL output.

brief Configure the DPI interface core.

This function sets the DPI interface configuration, it should be used in video mode.

param base MIPI DSI host peripheral base address. param config Pointer to the DPI interface configuration. param numLanes Lane number, should be same with the setting in ref dsi_dpi_config_t. param dpiPixelClkFreq_Hz The DPI pixel clock frequency in Hz. param dsiHsBitClkFreq_Hz The DSI high speed bit clock frequency in Hz. It is the same with DPHY PLL output.

◆ DSI_TransferAbort()

void DSI_TransferAbort ( const MIPI_DSI_Type base,
dsi_handle_t handle 
)

Abort current APB data transfer.

Parameters
baseMIPI DSI host peripheral base address.
handlepointer to dsi_handle_t structure which stores the transfer state.

brief Abort current APB data transfer.

param base MIPI DSI host peripheral base address. param handle pointer to dsi_handle_t structure which stores the transfer state.

◆ DSI_TransferBlocking()

status_t DSI_TransferBlocking ( const MIPI_DSI_Type base,
dsi_transfer_t xfer 
)

APB data transfer using blocking method.

Perform APB data transfer using blocking method. This function waits until all data send or received, or timeout happens.

When using this API to read data, the actually read data count could be got from xfer->rxDataSize.

Parameters
baseMIPI DSI host peripheral base address.
xferPointer to the transfer structure.
Return values
kStatus_SuccessData transfer finished with no error.
kStatus_TimeoutTransfer failed because of timeout.
kStatus_DSI_RxDataErrorRX data error, user could use DSI_GetRxErrorStatus to check the error details.
kStatus_DSI_ErrorReportReceivedError Report packet received, user could use DSI_GetAndClearHostStatus to check the error report status.
kStatus_DSI_NotSupportedTransfer format not supported.
kStatus_DSI_FailTransfer failed for other reasons.

brief APB data transfer using blocking method.

Perform APB data transfer using blocking method. This function waits until all data send or received, or timeout happens.

param base MIPI DSI host peripheral base address. param xfer Pointer to the transfer structure. retval kStatus_Success Data transfer finished with no error. retval kStatus_Timeout Transfer failed because of timeout. retval kStatus_DSI_RxDataError RX data error, user could use ref DSI_GetRxErrorStatus to check the error details. retval kStatus_DSI_ErrorReportReceived Error Report packet received, user could use ref DSI_GetAndClearHostStatus to check the error report status. retval kStatus_DSI_NotSupported Transfer format not supported. retval kStatus_DSI_Fail Transfer failed for other reasons.

◆ DSI_TransferCreateHandle()

status_t DSI_TransferCreateHandle ( const MIPI_DSI_Type base,
dsi_handle_t handle,
dsi_callback_t  callback,
void *  userData 
)

Create the MIPI DSI handle.

This function initializes the MIPI DSI handle which can be used for other transactional APIs.

Parameters
baseMIPI DSI host peripheral base address.
handleHandle pointer.
callbackCallback function.
userDataUser data.

brief Create the MIPI DSI handle.

This function initializes the MIPI DSI handle which can be used for other transactional APIs.

param base MIPI DSI host peripheral base address. param handle Handle pointer. param callback Callback function. param userData User data.

◆ DSI_TransferHandleIRQ()

void DSI_TransferHandleIRQ ( const MIPI_DSI_Type base,
dsi_handle_t handle 
)

Interrupt handler for the DSI.

Parameters
baseMIPI DSI host peripheral base address.
handlepointer to dsi_handle_t structure which stores the transfer state.

brief Interrupt handler for the DSI.

param base MIPI DSI host peripheral base address. param handle pointer to dsi_handle_t structure which stores the transfer state.

◆ DSI_TransferNonBlocking()

status_t DSI_TransferNonBlocking ( const MIPI_DSI_Type base,
dsi_handle_t handle,
dsi_transfer_t xfer 
)

APB data transfer using interrupt method.

Perform APB data transfer using interrupt method, when transfer finished, upper layer could be informed through callback function.

When using this API to read data, the actually read data count could be got from handle->xfer->rxDataSize after read finished.

Parameters
baseMIPI DSI host peripheral base address.
handlepointer to dsi_handle_t structure which stores the transfer state.
xferPointer to the transfer structure.
Return values
kStatus_SuccessData transfer started successfully.
kStatus_DSI_BusyFailed to start transfer because DSI is busy with pervious transfer.
kStatus_DSI_NotSupportedTransfer format not supported.

brief APB data transfer using interrupt method.

Perform APB data transfer using interrupt method, when transfer finished, upper layer could be informed through callback function.

param base MIPI DSI host peripheral base address. param handle pointer to dsi_handle_t structure which stores the transfer state. param xfer Pointer to the transfer structure.

retval kStatus_Success Data transfer started successfully. retval kStatus_DSI_Busy Failed to start transfer because DSI is busy with pervious transfer. retval kStatus_DSI_NotSupported Transfer format not supported.

◆ DSI_WriteApbTxPayload()

void DSI_WriteApbTxPayload ( const MIPI_DSI_Type base,
const uint8_t *  payload,
uint16_t  payloadSize 
)

Fill the long APB packet payload.

Write the long packet payload to TX FIFO.

Parameters
baseMIPI DSI host peripheral base address.
payloadPointer to the payload.
payloadSizePayload size in byte.

brief Fill the long APB packet payload.

Write the long packet payload to TX FIFO.

param base MIPI DSI host peripheral base address. param payload Pointer to the payload. param payloadSize Payload size in byte.

◆ DSI_WriteApbTxPayloadExt()

void DSI_WriteApbTxPayloadExt ( const MIPI_DSI_Type base,
const uint8_t *  payload,
uint16_t  payloadSize,
bool  sendDscCmd,
uint8_t  dscCmd 
)

Extended function to fill the payload to TX FIFO.

Write the long packet payload to TX FIFO. This function could be used in two ways

  1. Include the DSC command in parameter payload. In this case, the DSC command is the first byte of payload. The parameter sendDscCmd is set to false, the dscCmd is not used. This function is the same as DSI_WriteApbTxPayload when used in this way.
  2. The DSC command in not in parameter payload, but specified by parameter dscCmd. In this case, the parameter sendDscCmd is set to true, the dscCmd is the DSC command to send. The payload is sent after dscCmd.
Parameters
baseMIPI DSI host peripheral base address.
payloadPointer to the payload.
payloadSizePayload size in byte.
sendDscCmdIf set to true, the DSC command is specified by dscCmd, otherwise the DSC command is included in the payload.
dscCmdThe DSC command to send, only used when sendDscCmd is true.