RTEMS 6.1-rc5
|
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... | |
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. | |
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:
anonymous enum |
anonymous enum |
anonymous enum |
_dsi_apb_status Status of APB to packet interface.
anonymous enum |
_dsi_rx_error_status Host receive error status.
anonymous enum |
_dsi_interrupt DSI interrupt.
anonymous enum |
enum _dsi_dpi_bllp_mode |
MIPI DPI interface color coding.
enum _dsi_dpi_video_mode |
enum _dsi_host_status |
DSI host controller status (status_out)
enum _dsi_rx_data_type |
DSI RX data type.
enum _dsi_tx_data_type |
DSI TX data type.
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.
base | MIPI 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.
void DSI_DeinitDphy | ( | const MIPI_DSI_Type * | base | ) |
Deinitializes the D-PHY.
Power down the D-PHY PLL and shut down D-PHY.
base | MIPI 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.
void DSI_GetDefaultConfig | ( | dsi_config_t * | config | ) |
Get the default configuration to initialize the MIPI DSI host.
The default value is:
config | Pointer 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.
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.
config | Pointer to the D-PHY configuration. |
txHsBitClk_Hz | High speed bit clock in Hz. |
txEscClk_Hz | Esc 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.
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.
base | MIPI DSI host peripheral base address. |
config | Pointer 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.
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.
base | MIPI DSI host peripheral base address. |
config | Pointer to the D-PHY configuration. |
refClkFreq_Hz | The REFCLK frequency in Hz. |
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.
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.
base | MIPI DSI host peripheral base address. |
payload | Pointer to the payload. |
payloadSize | Payload 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.
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.
base | MIPI DSI host peripheral base address. |
wordCount | For long packet, this is the byte count of the payload. For short packet, this is (data1 << 8) | data0. |
virtualChannel | Virtual channel. |
dataType | The packet data type, (DI). |
flags | The 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.
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.
base | MIPI DSI host peripheral base address. |
config | Pointer to the DPI interface configuration. |
numLanes | Lane number, should be same with the setting in dsi_dpi_config_t. |
dpiPixelClkFreq_Hz | The DPI pixel clock frequency in Hz. |
dsiHsBitClkFreq_Hz | The 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.
void DSI_TransferAbort | ( | const MIPI_DSI_Type * | base, |
dsi_handle_t * | handle | ||
) |
Abort current APB data transfer.
base | MIPI DSI host peripheral base address. |
handle | pointer 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.
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.
base | MIPI DSI host peripheral base address. |
xfer | Pointer to the transfer structure. |
kStatus_Success | Data transfer finished with no error. |
kStatus_Timeout | Transfer failed because of timeout. |
kStatus_DSI_RxDataError | RX data error, user could use DSI_GetRxErrorStatus to check the error details. |
kStatus_DSI_ErrorReportReceived | Error Report packet received, user could use DSI_GetAndClearHostStatus to check the error report status. |
kStatus_DSI_NotSupported | Transfer format not supported. |
kStatus_DSI_Fail | Transfer 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.
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.
base | MIPI DSI host peripheral base address. |
handle | Handle pointer. |
callback | Callback function. |
userData | User 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.
void DSI_TransferHandleIRQ | ( | const MIPI_DSI_Type * | base, |
dsi_handle_t * | handle | ||
) |
Interrupt handler for the DSI.
base | MIPI DSI host peripheral base address. |
handle | pointer 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.
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.
base | MIPI DSI host peripheral base address. |
handle | pointer to dsi_handle_t structure which stores the transfer state. |
xfer | Pointer to the transfer structure. |
kStatus_Success | Data transfer started successfully. |
kStatus_DSI_Busy | Failed to start transfer because DSI is busy with pervious transfer. |
kStatus_DSI_NotSupported | Transfer 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.
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.
base | MIPI DSI host peripheral base address. |
payload | Pointer to the payload. |
payloadSize | Payload 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.
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
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.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
.base | MIPI DSI host peripheral base address. |
payload | Pointer to the payload. |
payloadSize | Payload size in byte. |
sendDscCmd | If set to true, the DSC command is specified by dscCmd , otherwise the DSC command is included in the payload . |
dscCmd | The DSC command to send, only used when sendDscCmd is true. |