MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

Data Structures

struct  lcdic_config_t
 LCDIC configuration. More...
 
union  lcdic_trx_cmd_t
 LCDIC TRX command. More...
 
struct  lcdic_repeat_tx_xfer_t
 LCDIC repeat data TX transfer structure. More...
 
struct  lcdic_tx_xfer_t
 LCDIC data array TX transfer structure. More...
 
struct  lcdic_rx_xfer_t
 LCDIC data array RX transfer structure. More...
 
struct  lcdic_xfer_t
 LCDIC transfer structure. More...
 
struct  lcdic_handle_t
 LCDIC handle structure. More...
 

Macros

#define LCDIC_RESET_STATE_DELAY   130u
 Delay used in LCDIC_ResetState. More...
 

Typedefs

typedef void(* lcdic_transfer_callback_t )(LCDIC_Type *base, lcdic_handle_t *handle, status_t status, void *userData)
 LCDIC transfer callback function. More...
 
typedef void(* lcdic_transfer_irq_handler_t )(LCDIC_Type *base, void *handle)
 Typedef for transactional APIs IRQ handler. More...
 
typedef void(* lcdic_reset_done_callback_t )(LCDIC_Type *base)
 Typedef for reset sequence sent done callback. More...
 

Enumerations

enum  lcdic_mode_t {
  kLCDIC_3WireSPI = 0U,
  kLCDIC_4WireSPI = LCDIC_CTRL_SPI_MD_MASK,
  kLCDIC_I8080 = LCDIC_CTRL_LCDIC_MD_MASK
}
 LCDIC mode. More...
 
enum  lcdic_endian_t {
  kLCDIC_BigEndian = 0U,
  kLCDIC_LittleEndian
}
 LCDIC byte order data endian. More...
 
enum  lcdic_rx_threshold_t {
  kLCDIC_RxThreshold0Word = 0U,
  kLCDIC_RxThreshold1Word
}
 LCDIC RX FIFO threshold. More...
 
enum  lcdic_tx_threshold_t {
  kLCDIC_TxThreshold0Word = 0U,
  kLCDIC_TxThreshold1Word,
  kLCDIC_TxThreshold2Word,
  kLCDIC_TxThreshold3Word,
  kLCDIC_TxThreshold4Word,
  kLCDIC_TxThreshold5Word,
  kLCDIC_TxThreshold6Word,
  kLCDIC_TxThreshold7Word
}
 LCDIC TX FIFO threshold. More...
 
enum  lcdic_reset_polarity_t {
  kLCDIC_ResetActiveLow = 0U,
  kLCDIC_ResetActiveHigh
}
 LCDIC reset signal polarity. More...
 
enum  {
  kLCDIC_I8080_CsActiveLow = 0U,
  kLCDIC_I8080_CsActiveHigh = LCDIC_I8080_CTRL0_CS_POL_MASK,
  kLCDIC_I8080_DcCmdLow = 0U,
  kLCDIC_I8080_DcCmdHigh = LCDIC_I8080_CTRL0_DC_POL_MASK,
  kLCDIC_I8080_RdActiveLow = 0U,
  kLCDIC_I8080_RdActiveHigh = LCDIC_I8080_CTRL0_RD_POL_MASK,
  kLCDIC_I8080_WrActiveLow = 0U,
  kLCDIC_I8080_WrActiveHigh = LCDIC_I8080_CTRL0_WR_POL_MASK,
  kLCDIC_I8080_CsEnableIdleOff = LCDIC_I8080_CTRL0_EN_IDLE_OFF_MASK,
  kLCDIC_I8080_CsEnableDcSwitchOff = LCDIC_I8080_CTRL0_EN_DC_OFF_MASK
}
 LCDIC I8080 control flags. More...
 
enum  {
  kLCDIC_SPI_MsbFirst = 0U,
  kLCDIC_SPI_LsbFirst = LCDIC_SPI_CTRL_SDAT_ENDIAN_MASK,
  kLCDIC_SPI_ClkActiveHigh = 0U,
  kLCDIC_SPI_ClkActiveLow = LCDIC_SPI_CTRL_CPOL_MASK,
  kLCDIC_SPI_ClkPhaseFirstEdge = 0U,
  kLCDIC_SPI_ClkPhaseSecondEdge = LCDIC_SPI_CTRL_CPHA_MASK,
  kLCDIC_SPI_DcCmdLow = 0U,
  kLCDIC_SPI_DcCmdHigh = LCDIC_SPI_CTRL_DC_POL_MASK
}
 LCDIC SPI mode control flags. More...
 
enum  _lcdic_interrupt { , kLCDIC_AllInterrupt }
 LCDIC interrupts. More...
 
enum  { , kLCDIC_AllFlag }
 LCDIC status flags. More...
 
enum  {
  kLCDIC_TeNoSync = 0,
  kLCDIC_TeRisingEdgeSync,
  kLCDIC_TeFallingEdgeSync
}
 LCDIC TE sync mode. More...
 
enum  {
  kLCDIC_ShortTimeout = 0,
  kLCDIC_LongTimeout
}
 LCDIC TRX command timeout mode. More...
 
enum  {
  kLCDIC_DataFormatByte = 0,
  kLCDIC_DataFormatHalfWord,
  kLCDIC_DataFormatWord
}
 LCDIC data format. More...
 
enum  {
  kLCDIC_Command = 0,
  kLCDIC_Data
}
 LCDIC data or command. More...
 
enum  {
  kLCDIC_RX = 0,
  kLCDIC_TX
}
 LCDIC TX or RX. More...
 
enum  lcdic_xfer_mode_t {
  kLCDIC_XferCmdOnly = 0,
  kLCDIC_XferSendRepeatData,
  kLCDIC_XferSendDataArray,
  kLCDIC_XferReceiveDataArray
}
 LCDIC transfer mode. More...
 

Driver version

#define FSL_LCDIC_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))
 

Initialization and deinitialization

status_t LCDIC_Init (LCDIC_Type *base, const lcdic_config_t *config)
 Initialize the LCDIC. More...
 
void LCDIC_Deinit (LCDIC_Type *base)
 De-initialize the LCDIC. More...
 
void LCDIC_GetDefaultConfig (lcdic_config_t *config)
 Get the default configuration for to initialize the LCDIC. More...
 
void LCDIC_ResetState (LCDIC_Type *base)
 Reset the LCDIC. More...
 

Interrupts

static void LCDIC_EnableInterrupts (LCDIC_Type *base, uint32_t interrupts)
 Enables LCDIC interrupts. More...
 
static void LCDIC_DisableInterrupts (LCDIC_Type *base, uint32_t interrupts)
 Disable LCDIC interrupts. More...
 
static uint32_t LCDIC_GetInterruptStatus (LCDIC_Type *base)
 Get LCDIC interrupt pending status. More...
 
static uint32_t LCDIC_GetInterruptRawStatus (LCDIC_Type *base)
 Get LCDIC raw interrupt status. More...
 
static void LCDIC_ClearInterruptStatus (LCDIC_Type *base, uint32_t interrupts)
 Clear LCDIC interrupt status. More...
 
static uint32_t LCDIC_GetStatusFlags (LCDIC_Type *base)
 Get LCDIC status flags. More...
 
static uint32_t LCDIC_GetProcessingTrxCmd (LCDIC_Type *base)
 Get current on-going LCDIC TRX-CMD. More...
 

FIFO

static void LCDIC_SetTxThreshold (LCDIC_Type *base, lcdic_tx_threshold_t threshold)
 Set TX FIFO threshold. More...
 
static void LCDIC_SetRxThreshold (LCDIC_Type *base, lcdic_rx_threshold_t threshold)
 Set RX FIFO threshold. More...
 
status_t LCDIC_WriteTxFifoBlocking (LCDIC_Type *base, const uint32_t *data, uint32_t dataLen_Word)
 Write the TX FIFO using blocking way. More...
 
status_t LCDIC_ReadRxFifoBlocking (LCDIC_Type *base, uint32_t *data, uint32_t dataLen_Word)
 Read the RX FIFO using blocking way. More...
 

Misc Operations

static void LCDIC_SendResetSequence (LCDIC_Type *base)
 Send reset sequence to the reset pin. More...
 
void LCDIC_SetResetSequenceDoneCallback (lcdic_reset_done_callback_t callback)
 Set the callback called when reset sequence sent done. More...
 
static void LCDIC_EnableDMA (LCDIC_Type *base, bool enable)
 Enable or disable to trigger DMA. More...
 

Blocking transfer

status_t LCDIC_SendCommandBlocking (LCDIC_Type *base, uint8_t cmd)
 Send command using blocking way. More...
 
status_t LCDIC_SendRepeatDataBlocking (LCDIC_Type *base, const lcdic_repeat_tx_xfer_t *xfer)
 Send repeat data using blocking way. More...
 
status_t LCDIC_SendDataArrayBlocking (LCDIC_Type *base, const lcdic_tx_xfer_t *xfer)
 Send data array using blocking way. More...
 
status_t LCDIC_ReadDataArrayBlocking (LCDIC_Type *base, const lcdic_rx_xfer_t *xfer)
 Read data array using blocking way. More...
 
status_t LCDC_TransferBlocking (LCDIC_Type *base, const lcdic_xfer_t *xfer)
 LCDIC data transfer using blocking way. More...
 

Transactional APIs

status_t LCDIC_TransferCreateHandle (LCDIC_Type *base, lcdic_handle_t *handle, lcdic_transfer_callback_t callback, void *userData)
 Initializes the LCDIC driver handle, which is used in transactional functions. More...
 
status_t LCDIC_TransferNonBlocking (LCDIC_Type *base, lcdic_handle_t *handle, lcdic_xfer_t *xfer)
 Transfer data using IRQ. More...
 
status_t LCDIC_SendCommandNonBlocking (LCDIC_Type *base, lcdic_handle_t *handle, uint8_t cmd)
 Send command using interrupt-driven way. More...
 
status_t LCDIC_SendRepeatDataNonBlocking (LCDIC_Type *base, lcdic_handle_t *handle, const lcdic_repeat_tx_xfer_t *xfer)
 Send repeat data using interrupt-driven way. More...
 
status_t LCDIC_SendDataArrayNonBlocking (LCDIC_Type *base, lcdic_handle_t *handle, const lcdic_tx_xfer_t *xfer)
 Send data array using interrupt-driven way. More...
 
status_t LCDIC_ReadDataArrayNonBlocking (LCDIC_Type *base, lcdic_handle_t *handle, const lcdic_rx_xfer_t *xfer)
 Read data array using interrupt-driven way. More...
 
void LCDIC_TransferHandleIRQ (LCDIC_Type *base, void *handle)
 LCDIC IRQ handler function. More...
 
void LCDIC_TransferInstallIRQHandler (uint32_t instance, void *handle, lcdic_transfer_irq_handler_t handler)
 Install the IRQ handler. More...
 

Helper functions

uint32_t LCDIC_GetInstance (LCDIC_Type *base)
 Get the instance from the base address. More...
 
IRQn_Type LCDIC_GetIRQn (uint32_t instance)
 Get IRQn for specific instance. More...
 
uint32_t LCDIC_FillByteToWord (const uint8_t *bytes, uint8_t len)
 Get data from byte array, and fill to 4-byte word. More...
 
void LCDIC_ExtractByteFromWord (uint32_t word, uint8_t *bytes, uint8_t len)
 Get data from 4-byte, and fill to byte array. More...
 
status_t LCDIC_PrepareSendCommand (LCDIC_Type *base, uint8_t cmd)
 Prepare the command sending. More...
 
status_t LCDIC_PrepareSendRepeatData (LCDIC_Type *base, const lcdic_repeat_tx_xfer_t *xfer)
 Prepare the repeat data sending. More...
 
status_t LCDIC_PrepareSendDataArray (LCDIC_Type *base, const lcdic_tx_xfer_t *xfer, uint32_t *xferSizeWordAligned, uint8_t *xferSizeWordUnaligned, uint32_t *wordUnalignedData)
 Prepare sending data array. More...
 
status_t LCDIC_PrepareReadDataArray (LCDIC_Type *base, const lcdic_rx_xfer_t *xfer, uint32_t *xferSizeWordAligned, uint8_t *xferSizeWordUnaligned)
 Prepare reading data array. More...
 

Data Structure Documentation

struct lcdic_config_t

Data Fields

lcdic_mode_t mode
 LCDIC work mode. More...
 
lcdic_endian_t endian
 Data endian. More...
 
lcdic_rx_threshold_t rxThreshold
 RX FIFO threshold. More...
 
lcdic_tx_threshold_t txThreshold
 TX FIFO threshold. More...
 
uint8_t timerRatio0
 Valid range: 0~15. More...
 
uint8_t timerRatio1
 Valid range: 0~15. More...
 
uint8_t resetPulseWidth_Timer0
 Reset pulse width, in the unit of timer0 period. More...
 
uint8_t resetSequence
 Reset sequence, it is a 8-bit value sent to reset pin from LSB. More...
 
uint8_t resetSequencePulseNum
 Reset sequence pulse number, valid range is 1 ~ 8. More...
 
lcdic_reset_polarity_t resetPolarity
 Reset signal polarity. More...
 
uint8_t i8080CtrlFlags
 I8080 control flags, it is OR'ed value of _lcdic_i8080_ctrl_flags. More...
 
uint8_t csWaitTime
 Minimum CS inactive pulse width. More...
 
uint8_t csSetupTime
 Minimum CS setup time before WR/RD. More...
 
uint8_t csHoldTime
 Minimum CS hold time after WR/RD. More...
 
uint8_t dcSetupTime
 Minimum DC setup time before WR/RD/CS. More...
 
uint8_t dcHoldTime
 Minimum DC hold time after WR/RD/CS. More...
 
uint8_t writeDataSetupTime
 Minimum write data setup time after WR active. More...
 
uint8_t writeDataHoldTime
 Minimum write data setup time before WR active. More...
 
uint8_t writeEnableActiveWidth
 Minmum write enable active pulse width. More...
 
uint8_t writeEnableInactiveWidth
 Minmum write enable inactive pulse width. More...
 
uint8_t readEnableActiveWidth
 Minmum read enable active pulse width. More...
 
uint8_t readEnableInactiveWidth
 Minmum read enable inactive pulse width. More...
 
uint8_t spiCtrlFlags
 SPI control flags, it is OR'ed value of _lcdic_spi_ctrl_flags. More...
 
uint8_t teTimeoutTime_Timer1
 Tearing effect timeout time. More...
 
uint8_t teSyncWaitTime_Timer1
 Tearing effect signal synchronization wait time. More...
 
uint8_t cmdShortTimeout_Timer0
 Command short timeout. More...
 
uint8_t cmdLongTimeout_Timer1
 Command long timeout. More...
 

Field Documentation

lcdic_mode_t lcdic_config_t::mode
lcdic_endian_t lcdic_config_t::endian
lcdic_rx_threshold_t lcdic_config_t::rxThreshold
lcdic_tx_threshold_t lcdic_config_t::txThreshold
uint8_t lcdic_config_t::timerRatio0

freq(timer0) = freq(lcdic_clk) / (2 ^ timerRatio0).

uint8_t lcdic_config_t::timerRatio1

freq(timer1) = freq(timer0) / (2 ^ timerRatio1).

uint8_t lcdic_config_t::resetPulseWidth_Timer0

Valid range 1 ~ 64.

uint8_t lcdic_config_t::resetSequence
uint8_t lcdic_config_t::resetSequencePulseNum
lcdic_reset_polarity_t lcdic_config_t::resetPolarity
uint8_t lcdic_config_t::i8080CtrlFlags
uint8_t lcdic_config_t::csWaitTime

T(csw)=T(lcdic_clk)*csWaitTime, valid range 0-7.

uint8_t lcdic_config_t::csSetupTime

T(css)=T(lcdic_clk)*csSetupTime, valid range 0-255.

uint8_t lcdic_config_t::csHoldTime

T(csh)=T(lcdic_clk)*csHoldTime, valid range 0-7.

uint8_t lcdic_config_t::dcSetupTime

T(dcs)=T(lcdic_clk)*dsSetupTime, valid range 0-7.

uint8_t lcdic_config_t::dcHoldTime

T(dch)=T(lcdic_clk)*dsHoldTime, valid range 0-7.

uint8_t lcdic_config_t::writeDataSetupTime

T(wdh)=T(lcdic_clk)*writeDataSetupTime, valid range 0-7.

uint8_t lcdic_config_t::writeDataHoldTime

T(wds)=T(lcdic_clk)*writeDataHoldTime, valid range 0-7.

uint8_t lcdic_config_t::writeEnableActiveWidth

T(waw)=T(lcdic_clk)*writeEnableActiveWidth, valid range 0-63.

uint8_t lcdic_config_t::writeEnableInactiveWidth

T(wiw)=T(lcdic_clk)*writeEnableInactiveWidth, valid range 0-63.

uint8_t lcdic_config_t::readEnableActiveWidth

T(raw)=T(lcdic_clk)*readEnableActiveWidth, valid range 0-255.

uint8_t lcdic_config_t::readEnableInactiveWidth

T(riw)=T(lcdic_clk)*readEnableInactiveWidth, valid range 0-255.

uint8_t lcdic_config_t::spiCtrlFlags
uint8_t lcdic_config_t::teTimeoutTime_Timer1

T(te_to)=T(timer1)*teTimeoutTime_Timer1.

uint8_t lcdic_config_t::teSyncWaitTime_Timer1

T(tew)=T(timer1)*teSyncWaitTime_Timer1.

uint8_t lcdic_config_t::cmdShortTimeout_Timer0

T(cmd_short_to)=T(timer0)*cmdShortTimeout_Timer0.

uint8_t lcdic_config_t::cmdLongTimeout_Timer1

T(cmd_long_to)=T(timer1)*cmdLongTimeout_Timer1.

union lcdic_trx_cmd_t

Field Documentation

uint32_t lcdic_trx_cmd_t::dataLen
uint32_t lcdic_trx_cmd_t::dummyCount
uint32_t lcdic_trx_cmd_t::useAutoRepeat
uint32_t lcdic_trx_cmd_t::teSyncMode
uint32_t lcdic_trx_cmd_t::trxTimeoutMode
uint32_t lcdic_trx_cmd_t::dataFormat
uint32_t lcdic_trx_cmd_t::enableCmdDoneInt
uint32_t lcdic_trx_cmd_t::cmdOrData
uint32_t lcdic_trx_cmd_t::trx
struct lcdic_repeat_tx_xfer_t

Data Fields

uint8_t cmd
 Command. More...
 
uint8_t teSyncMode
 TE sync mode, see _lcdic_te_sync_mode. More...
 
uint8_t trxTimeoutMode
 TRX command timeout mode, see _lcdic_trx_timeout_mode. More...
 
uint8_t dataFormat
 Data format, see _lcdic_data_format. More...
 
uint32_t dataLen
 Data length. More...
 
uint32_t txRepeatData
 The repeat data. More...
 

Field Documentation

uint8_t lcdic_repeat_tx_xfer_t::cmd
uint8_t lcdic_repeat_tx_xfer_t::teSyncMode
uint8_t lcdic_repeat_tx_xfer_t::trxTimeoutMode
uint8_t lcdic_repeat_tx_xfer_t::dataFormat
uint32_t lcdic_repeat_tx_xfer_t::dataLen
uint32_t lcdic_repeat_tx_xfer_t::txRepeatData
struct lcdic_tx_xfer_t

Data Fields

uint8_t cmd
 Command. More...
 
uint8_t teSyncMode
 TE sync mode, see _lcdic_te_sync_mode. More...
 
uint8_t trxTimeoutMode
 TRX command timeout mode, see _lcdic_trx_timeout_mode. More...
 
uint8_t dataFormat
 Data format, see _lcdic_data_format. More...
 
uint32_t dataLen
 Data length. More...
 
const uint8_t * txData
 The data to send. More...
 

Field Documentation

uint8_t lcdic_tx_xfer_t::cmd
uint8_t lcdic_tx_xfer_t::teSyncMode
uint8_t lcdic_tx_xfer_t::trxTimeoutMode
uint8_t lcdic_tx_xfer_t::dataFormat
uint32_t lcdic_tx_xfer_t::dataLen
const uint8_t* lcdic_tx_xfer_t::txData
struct lcdic_rx_xfer_t

Data Fields

uint8_t cmd
 Command. More...
 
uint8_t dummyCount
 Dummy cycle between TX and RX, only used for SPI mode. More...
 
uint8_t trxTimeoutMode
 TRX command timeout mode, see _lcdic_trx_timeout_mode. More...
 
uint8_t dataFormat
 Data format, see _lcdic_data_format. More...
 
uint32_t dataLen
 Data length. More...
 
uint8_t * rxData
 Pointer to the data receive array. More...
 

Field Documentation

uint8_t lcdic_rx_xfer_t::cmd
uint8_t lcdic_rx_xfer_t::dummyCount
uint8_t lcdic_rx_xfer_t::trxTimeoutMode
uint8_t lcdic_rx_xfer_t::dataFormat
uint32_t lcdic_rx_xfer_t::dataLen
uint8_t* lcdic_rx_xfer_t::rxData
struct lcdic_xfer_t

Data Fields

lcdic_xfer_mode_t mode
 Transfer mode. More...
 
uint8_t cmdToSendOnly
 Command to send in mode kLCDIC_XferCmdOnly. More...
 
lcdic_repeat_tx_xfer_t repeatTxXfer
 For mode kLCDIC_XferSendRepeatData. More...
 
lcdic_tx_xfer_t txXfer
 For mode kLCDIC_XferSendDataArray. More...
 
lcdic_rx_xfer_t rxXfer
 For mode kLCDIC_XferReceiveDataArray. More...
 

Field Documentation

lcdic_xfer_mode_t lcdic_xfer_t::mode
uint8_t lcdic_xfer_t::cmdToSendOnly
lcdic_repeat_tx_xfer_t lcdic_xfer_t::repeatTxXfer
lcdic_tx_xfer_t lcdic_xfer_t::txXfer
lcdic_rx_xfer_t lcdic_xfer_t::rxXfer
struct _lcdic_handle

Data Fields

volatile bool xferInProgress
 Transfer in progress. More...
 
lcdic_xfer_mode_t xferMode
 On-going transfer mode. More...
 
lcdic_transfer_callback_t callback
 Callback function. More...
 
void * userData
 LCDIC callback function parameter. More...
 
uint32_t xferSizeWordAligned
 4-byte aligned part of the transfer size. More...
 
uint8_t xferSizeWordUnaligned
 4-byte unaligned part of the transfer size. More...
 
uint32_t tmpData
 Temp data for driver internal use. More...
 
const uint8_t * txData
 Data array to send. More...
 
uint8_t * rxData
 RX data array. More...
 

Field Documentation

volatile bool lcdic_handle_t::xferInProgress
lcdic_xfer_mode_t lcdic_handle_t::xferMode
lcdic_transfer_callback_t lcdic_handle_t::callback
void* lcdic_handle_t::userData
const uint8_t* lcdic_handle_t::txData
uint8_t* lcdic_handle_t::rxData
uint32_t lcdic_handle_t::xferSizeWordAligned
uint8_t lcdic_handle_t::xferSizeWordUnaligned
uint32_t lcdic_handle_t::tmpData

Macro Definition Documentation

#define LCDIC_RESET_STATE_DELAY   130u

This should be larger than 5 * core clock / LCDIC function clock.

Typedef Documentation

typedef void(* lcdic_transfer_callback_t)(LCDIC_Type *base, lcdic_handle_t *handle, status_t status, void *userData)

The status is kStatus_Success when transfer finished successfully, it is kStatus_Timeout when timeout happened.

typedef void(* lcdic_transfer_irq_handler_t)(LCDIC_Type *base, void *handle)
typedef void(* lcdic_reset_done_callback_t)(LCDIC_Type *base)

Enumeration Type Documentation

Enumerator
kLCDIC_3WireSPI 

3-wire SPI mode.

kLCDIC_4WireSPI 

4-wire SPI mode.

kLCDIC_I8080 

I8080 mode.

Enumerator
kLCDIC_BigEndian 

Big endian.

kLCDIC_LittleEndian 

Little endian.

RX threshold interrupt happens if the occupied word number in RX FIFO is bigger than the threshold value.

Enumerator
kLCDIC_RxThreshold0Word 

0 word.

kLCDIC_RxThreshold1Word 

1 word.

TX threshold interrupt happens if the empty word number in TX FIFO is bigger than the threshold value.

Enumerator
kLCDIC_TxThreshold0Word 

0 word.

kLCDIC_TxThreshold1Word 

1 word.

kLCDIC_TxThreshold2Word 

2 word.

kLCDIC_TxThreshold3Word 

3 word.

kLCDIC_TxThreshold4Word 

4 word.

kLCDIC_TxThreshold5Word 

5 word.

kLCDIC_TxThreshold6Word 

6 word.

kLCDIC_TxThreshold7Word 

7 word.

Enumerator
kLCDIC_ResetActiveLow 

Active low.

kLCDIC_ResetActiveHigh 

Active high.

anonymous enum

Enumerator
kLCDIC_I8080_CsActiveLow 

CS active low.

kLCDIC_I8080_CsActiveHigh 

CS active high.

kLCDIC_I8080_DcCmdLow 

DC 0 means command, while 1 means data.

kLCDIC_I8080_DcCmdHigh 

DC 1 means command, while 0 means data.

kLCDIC_I8080_RdActiveLow 

RD active low.

kLCDIC_I8080_RdActiveHigh 

RD active high.

kLCDIC_I8080_WrActiveLow 

WR active low.

kLCDIC_I8080_WrActiveHigh 

WR active high.

kLCDIC_I8080_CsEnableIdleOff 

CS off while no transmission.

kLCDIC_I8080_CsEnableDcSwitchOff 

CS off while DC switches.

anonymous enum

Enumerator
kLCDIC_SPI_MsbFirst 

MSB(bit 7) sent and received first.

kLCDIC_SPI_LsbFirst 

LSB(bit 0) sent and received first.

kLCDIC_SPI_ClkActiveHigh 

CPOL=0.

Clock active-high (idle low)

kLCDIC_SPI_ClkActiveLow 

CPOL=1.

Clock active-low (idle high)

kLCDIC_SPI_ClkPhaseFirstEdge 

CPHA=0.

Data sample at first clock edge.

kLCDIC_SPI_ClkPhaseSecondEdge 

CPHA=1.

Data sample at second clock edge.

kLCDIC_SPI_DcCmdLow 

DC 0 means command, while 1 means data.

kLCDIC_SPI_DcCmdHigh 

DC 1 means command, while 0 means data.

Enumerator
kLCDIC_AllInterrupt 

All interrupts.

anonymous enum

Enumerator
kLCDIC_AllFlag 

All flags.

anonymous enum

Enumerator
kLCDIC_TeNoSync 

Don't need to sync.

kLCDIC_TeRisingEdgeSync 

Sync to TE rising edge.

kLCDIC_TeFallingEdgeSync 

Sync to TE falling edge.

anonymous enum

Enumerator
kLCDIC_ShortTimeout 

Using short timeout.

kLCDIC_LongTimeout 

Using long timeout.

anonymous enum

Enumerator
kLCDIC_DataFormatByte 

Byte.

kLCDIC_DataFormatHalfWord 

Half word (2-byte).

kLCDIC_DataFormatWord 

Word (4-byte).

anonymous enum

Enumerator
kLCDIC_Command 

Command.

kLCDIC_Data 

Data.

anonymous enum

Enumerator
kLCDIC_RX 

RX.

kLCDIC_TX 

TX.

Enumerator
kLCDIC_XferCmdOnly 

Only send command.

kLCDIC_XferSendRepeatData 

Send repeat data.

kLCDIC_XferSendDataArray 

Send data array.

kLCDIC_XferReceiveDataArray 

Receive data array.

Function Documentation

status_t LCDIC_Init ( LCDIC_Type *  base,
const lcdic_config_t config 
)

This function initializes the LCDIC to work, it configues the LCDIC according to the configue structure and enables the module. After calling this function, the peripheral is ready to work.

Parameters
baseLCDIC peripheral base address.
Return values
kStatus_SuccessInitialize successfully.
void LCDIC_Deinit ( LCDIC_Type *  base)

This function disables the LCDIC, and disables peripheral clock if necessary.

Parameters
baseLCDIC peripheral base address.
void LCDIC_GetDefaultConfig ( lcdic_config_t config)

The default configuration value is:

config->mode = kLCDIC_3WireSPI;
config->endian = kLCDIC_BigEndian;
config->rxThreshold = kLCDIC_RxThreshold0Word;
config->txThreshold = kLCDIC_TxThreshold3Word;
config->timerRatio0 = 8;
config->timerRatio1 = 9;
config->resetPulseWidth_Timer0 = 20;
config->resetSequence = 0;
config->resetSequencePulseNum = 1;
config->resetPolarity = kLCDIC_ResetActiveLow;
config->csWaitTime = 2;
config->csSetupTime = 2;
config->csHoldTime = 2;
config->dcSetupTime = 2;
config->dcHoldTime = 2;
config->writeDataSetupTime = 2;
config->writeDataHoldTime = 2;
config->writeEnableActiveWidth = 6;
config->writeEnableInactiveWidth = 6;
config->readEnableActiveWidth = 15;
config->readEnableInactiveWidth = 15;
config->spiCtrlFlags =
config->teTimeoutTime_Timer1 = 16;
config->teSyncWaitTime_Timer1 = 0;
config->cmdShortTimeout_Timer0 = 1;
config->cmdLongTimeout_Timer1 = 16;
Parameters
configPointer to the LCDIC configuration.
void LCDIC_ResetState ( LCDIC_Type *  base)

This function resets the LCDIC state. After calling this function, all data in TX_FIFO and RX_FIFO will be cleared and all transactions on LCD interface will restart despite of formal status.

The configurations will not be reset.

Parameters
baseLCDIC peripheral base address.
static void LCDIC_EnableInterrupts ( LCDIC_Type *  base,
uint32_t  interrupts 
)
inlinestatic
Parameters
baseLCDIC peripheral base address.
interruptsThe interrupts to enable, pass in as OR'ed value of _lcdic_interrupt.
static void LCDIC_DisableInterrupts ( LCDIC_Type *  base,
uint32_t  interrupts 
)
inlinestatic
Parameters
baseLCDIC peripheral base address.
interruptsThe interrupts to disable, pass in as OR'ed value of _lcdic_interrupt.
static uint32_t LCDIC_GetInterruptStatus ( LCDIC_Type *  base)
inlinestatic
Parameters
baseLCDIC peripheral base address.
Returns
The interrupt pending status.
Note
The interrupt must be enabled, otherwise the interrupt flags will not assert.
static uint32_t LCDIC_GetInterruptRawStatus ( LCDIC_Type *  base)
inlinestatic

This function gets the raw interrupt pending flags, it is not affected by interrupt enabled status.

Parameters
baseLCDIC peripheral base address.
Returns
The raw interrupt status.
static void LCDIC_ClearInterruptStatus ( LCDIC_Type *  base,
uint32_t  interrupts 
)
inlinestatic
Parameters
baseLCDIC peripheral base address.
interruptsThe interrupt status to clear , pass in as OR'ed value of _lcdic_interrupt.
static uint32_t LCDIC_GetStatusFlags ( LCDIC_Type *  base)
inlinestatic
Note
The interval between two times calling this function shall be larger than one LCDIC function clock.
Parameters
baseLCDIC peripheral base address.
Returns
The status flags, it is OR'ed value of _lcdic_flags.
static uint32_t LCDIC_GetProcessingTrxCmd ( LCDIC_Type *  base)
inlinestatic
Note
The interval between two times calling this function shall be larger than one LCDIC function clock.
Parameters
baseLCDIC peripheral base address.
Returns
The TRX-CMD on-going.
static void LCDIC_SetTxThreshold ( LCDIC_Type *  base,
lcdic_tx_threshold_t  threshold 
)
inlinestatic
Parameters
baseLCDIC peripheral base address.
thresholdTX threshold.
static void LCDIC_SetRxThreshold ( LCDIC_Type *  base,
lcdic_rx_threshold_t  threshold 
)
inlinestatic
Parameters
baseLCDIC peripheral base address.
thresholdRX threshold.
status_t LCDIC_WriteTxFifoBlocking ( LCDIC_Type *  base,
const uint32_t *  data,
uint32_t  dataLen_Word 
)

This function waits for empty slot in TX FIFO and fill the data to TX FIFO.

Parameters
baseLCDIC peripheral base address.
dataData to send, the data length must be dividable by 4.
dataLen_WordData length in word.
Return values
kStatus_SuccessWrite successfully.
kStatus_TimeoutTimeout happened.
status_t LCDIC_ReadRxFifoBlocking ( LCDIC_Type *  base,
uint32_t *  data,
uint32_t  dataLen_Word 
)

This function waits for valid data in RX FIFO and read them.

Parameters
baseLCDIC peripheral base address.
dataArray for received data, the data length must be dividable by 4.
dataLen_WordData length in word.
Return values
kStatus_SuccessRead successfully.
kStatus_TimeoutTimeout happened.
static void LCDIC_SendResetSequence ( LCDIC_Type *  base)
inlinestatic

The function sends reset to reset pin, to reset the external panel. The reset sequence parameters are configued by lcdic_config_t.

Parameters
baseLCDIC peripheral base address.
void LCDIC_SetResetSequenceDoneCallback ( lcdic_reset_done_callback_t  callback)
Parameters
callbackThe callback to set.
static void LCDIC_EnableDMA ( LCDIC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseLCDIC peripheral base address.
enableUse true to enable, false to disable.
status_t LCDIC_SendCommandBlocking ( LCDIC_Type *  base,
uint8_t  cmd 
)

This function sends out command and waits until send finished.

Parameters
baseLCDIC peripheral base address.
cmdCommand to send.
Return values
kStatus_SuccessCommand sent successfully.
status_t LCDIC_SendRepeatDataBlocking ( LCDIC_Type *  base,
const lcdic_repeat_tx_xfer_t xfer 
)

This function sends out command and the repeat data, then waits until send finished or timeout happened.

Parameters
baseLCDIC peripheral base address.
xferPointer to the transfer configuration.
Return values
kStatus_SuccessSent successfully.
kStatus_TimeoutTimeout happened.
kStatus_InvalidArgumentInvalid argument.
status_t LCDIC_SendDataArrayBlocking ( LCDIC_Type *  base,
const lcdic_tx_xfer_t xfer 
)

This function sends out command and the data array, then waits until send finished or timeout happened.

Parameters
baseLCDIC peripheral base address.
xferPointer to the transfer configuration.
Return values
kStatus_SuccessSent successfully.
kStatus_TimeoutTimeout happened.
kStatus_InvalidArgumentInvalid argument.
status_t LCDIC_ReadDataArrayBlocking ( LCDIC_Type *  base,
const lcdic_rx_xfer_t xfer 
)

This function sends out command and read the data array, then waits until send finished or timeout happened.

Parameters
baseLCDIC peripheral base address.
xferPointer to the transfer configuration.
Return values
kStatus_SuccessSent successfully.
kStatus_TimeoutTimeout happened.
kStatus_InvalidArgumentInvalid argument.
status_t LCDC_TransferBlocking ( LCDIC_Type *  base,
const lcdic_xfer_t xfer 
)

This function sends command only, or sends repeat data, or sends data array, or reads data array based on the transfer structure. It uses blocking way, only returns when transfer successed or failed.

Parameters
baseLCDIC peripheral base address.
xferPointer to the transfer configuration.
Return values
kStatus_SuccessSent successfully.
kStatus_TimeoutTimeout happened.
kStatus_InvalidArgumentInvalid argument.
status_t LCDIC_TransferCreateHandle ( LCDIC_Type *  base,
lcdic_handle_t *  handle,
lcdic_transfer_callback_t  callback,
void *  userData 
)
Parameters
baseLCDIC peripheral base address.
handlePointer to the lcdic_handle_t structure to store the transfer state.
callbackThe callback function.
userDataThe parameter of the callback function.
Return values
kStatus_SuccessSuccessfully created the handle.
status_t LCDIC_TransferNonBlocking ( LCDIC_Type *  base,
lcdic_handle_t *  handle,
lcdic_xfer_t xfer 
)

This function transfer data using IRQ. This is a non-blocking function, which returns right away. When all data is sent out/received, or timeout happened, the callback function is called.

Parameters
baseLCDIC peripheral base address.
handlePointer to the lcdic_handle_t structure to store the transfer state.
xferLCDIC transfer structure.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_BusyLCDIC driver is busy with another transfer.
status_t LCDIC_SendCommandNonBlocking ( LCDIC_Type *  base,
lcdic_handle_t *  handle,
uint8_t  cmd 
)
Parameters
baseLCDIC peripheral base address.
handlePointer to the lcdic_handle_t structure to store the transfer state.
cmdCommand to send.
Return values
kStatus_SuccessCommand sent successfully.
kStatus_BusyLCDIC driver is busy with another transfer.
status_t LCDIC_SendRepeatDataNonBlocking ( LCDIC_Type *  base,
lcdic_handle_t *  handle,
const lcdic_repeat_tx_xfer_t xfer 
)
Parameters
baseLCDIC peripheral base address.
handlePointer to the lcdic_handle_t structure to store the transfer state.
xferLCDIC transfer structure.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_BusyLCDIC driver is busy with another transfer.
status_t LCDIC_SendDataArrayNonBlocking ( LCDIC_Type *  base,
lcdic_handle_t *  handle,
const lcdic_tx_xfer_t xfer 
)
Parameters
baseLCDIC peripheral base address.
handlePointer to the lcdic_handle_t structure to store the transfer state.
xferLCDIC transfer structure.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_BusyLCDIC driver is busy with another transfer.
status_t LCDIC_ReadDataArrayNonBlocking ( LCDIC_Type *  base,
lcdic_handle_t *  handle,
const lcdic_rx_xfer_t xfer 
)
Parameters
baseLCDIC peripheral base address.
handlePointer to the lcdic_handle_t structure to store the transfer state.
xferLCDIC transfer structure.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_BusyLCDIC driver is busy with another transfer.
void LCDIC_TransferHandleIRQ ( LCDIC_Type *  base,
void *  handle 
)

IRQ handler to work with LCDIC_TransferNonBlocking.

Parameters
baseLCDIC peripheral base address.
handlePointer to the lcdic_handle_t structure to store the transfer state.
void LCDIC_TransferInstallIRQHandler ( uint32_t  instance,
void *  handle,
lcdic_transfer_irq_handler_t  handler 
)

Install IRQ handler for specific instance.

Parameters
instanceLCDIC instance.
handleDriver handle, it will be used as IRQ handler parameter.
handlerIRQ handler to instance.
uint32_t LCDIC_GetInstance ( LCDIC_Type *  base)
Parameters
baseLCDIC peripheral base address
Returns
The LCDIC module instance
IRQn_Type LCDIC_GetIRQn ( uint32_t  instance)
Parameters
instanceLCDIC instance.
Returns
The LCDIC IRQn.
uint32_t LCDIC_FillByteToWord ( const uint8_t *  bytes,
uint8_t  len 
)

LCDIC data registers only accept 4-byte data, but the user passed data might be not 4-byte size aligned. This function is used to construct the unaligned part to a word, to write to LCDIC register.

Parameters
bytesThe byte array.
lenLength of the byte array.
Returns
The construct word.
void LCDIC_ExtractByteFromWord ( uint32_t  word,
uint8_t *  bytes,
uint8_t  len 
)

LCDIC data registers only accept 4-byte data, but the user passed data might be not 4-byte size aligned. This function is used to get desired bytes from the word read from LCDIC register, and save to the user data array.

Parameters
wordWord data read from LCDIC register.
bytesThe byte array.
lenLength of the byte array.
status_t LCDIC_PrepareSendCommand ( LCDIC_Type *  base,
uint8_t  cmd 
)

Fill the TRX command and command to TX FIFO, after calling this function, user should wait for transfer done by checking status or IRQ.

Parameters
baseLCDIC peripheral base address.
cmdCommand to send.
Return values
kStatus_SuccessOperation successed.
status_t LCDIC_PrepareSendRepeatData ( LCDIC_Type *  base,
const lcdic_repeat_tx_xfer_t xfer 
)

Fill the required data to TX FIFO, after calling this function, user should wait for transfer done by checking status or IRQ.

Parameters
baseLCDIC peripheral base address.
xferTransfer structure.
Return values
kStatus_SuccessOperation successed.
kStatus_InvalidArgumentInvalid argument.
status_t LCDIC_PrepareSendDataArray ( LCDIC_Type *  base,
const lcdic_tx_xfer_t xfer,
uint32_t *  xferSizeWordAligned,
uint8_t *  xferSizeWordUnaligned,
uint32_t *  wordUnalignedData 
)

Fill the required command data to TX FIFO, after calling this function, user should fill the xfer->txData to TX FIFO based on FIFO status.

Parameters
baseLCDIC peripheral base address.
xferTransfer structure.
xferSizeWordAlignedThe word size aligned part of the transfer data.
xferSizeWordUnalignedThe word size unaligned part of the transfer data.
wordUnalignedDataWord to save the word size unaligned data, it should be sent after all word size aligned data write finished.
Return values
kStatus_SuccessOperation successed.
kStatus_InvalidArgumentInvalid argument.
status_t LCDIC_PrepareReadDataArray ( LCDIC_Type *  base,
const lcdic_rx_xfer_t xfer,
uint32_t *  xferSizeWordAligned,
uint8_t *  xferSizeWordUnaligned 
)

Fill the required command data to TX FIFO, after calling this function, user should read RX FIFO to xfer->rxData based on FIFO status.

Parameters
baseLCDIC peripheral base address.
xferTransfer structure.
xferSizeWordAlignedThe word size aligned part of the transfer data.
xferSizeWordUnalignedThe word size unaligned part of the transfer data.
Return values
kStatus_SuccessOperation successed.
kStatus_InvalidArgumentInvalid argument.