MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
FlexIO MCU Interface LCD Driver

Overview

The MCUXpresso SDK provides a peripheral driver for LCD (8080 or 6800 interface) function using Flexible I/O module of MCUXpresso SDK devices.

The FlexIO LCD driver supports both 8-bit and 16-bit data bus, 8080 and 6800 interface. User could change the macro FLEXIO_MCULCD_DATA_BUS_WIDTH to choose 8-bit data bus or 16-bit data bus.

The FlexIO LCD driver supports three kinds of data transfer:

  1. Send a data array. For example, send the LCD image data to the LCD controller.
  2. Send a value many times. For example, send 0 many times to clean the LCD screen.
  3. Read data into a data array. For example, read image from LCD controller.

The FlexIO LCD driver includes functional APIs and transactional APIs.
Functional APIs are feature/property target low level APIs. Functional APIs can be used for FlexIO LCD initialization/configuration/operation for optimization/customization purpose. Using the functional API requires the knowledge of the FlexIO LCD peripheral and how to organize functional APIs to meet the application requirements. All functional API use the peripheral base address as the first parameter. FlexIO LCD functional operation groups provide the functional APIs set.
Transactional APIs are transaction target high level APIs. The transactional APIs can be used to enable the peripheral and also in the application if the code size and performance of transactional APIs can satisfy requirements. If the code size and performance are critical requirements, see the transactional API implementation and write custom code.
Transactional APIs support asynchronous transfer. This means that the function FLEXIO_MCULCD_TransferNonBlocking sets up an interrupt for data transfer. When the transfer completes, the upper layer is notified through a callback function with the kStatus_FLEXIO_MCULCD_Idle status.

Typical use case

FlexIO LCD send/receive using functional APIs

This example shows how to send command, or write and read data using the functional APIs. The data bus is 16-bit.

uint16_t dataToSend[] = { ... };
uint16_t dataToReceive[] = { ... };
FLEXIO_MCULCD_Type flexioLcdDev;
flexio_MCULCD_transfer_t xfer;
flexio_MCULCD_config_t config;
FLEXIO_MCULCD_Init(&flexioLcdDev, &config, 120000000);
// Method 1:
FLEXIO_MCULCD_WriteCommandBlocking(&flexioLcdDev, command1);
// Method 2:
xfer.command = command1;
xfer.dataCount = 0; // Only send command, no data transfer.
FLEXIO_MCULCD_TransferBlocking(&flexioLcdDev, &xfer);
// Method 1:
FLEXIO_MCULCD_WriteCommandBlocking(&flexioLcdDev, command2);
FLEXIO_MCULCD_WriteDataArrayBlocking(&flexioLcdDev, dataToSend, sizeof(dataToSend));
// Method 2:
xfer.command = command2;
xfer.dataAddrOrSameValue = (uint32_t)dataToSend;
xfer.dataCount = sizeof(dataToSend);
FLEXIO_MCULCD_TransferBlocking(&flexioLcdDev, &xfer);
// Method 1:
FLEXIO_MCULCD_WriteCommandBlocking(&flexioLcdDev, command2);
FLEXIO_MCULCD_WriteSameValueBlocking(&flexioLcdDev, value, 1000); // Send value 1000 times
// Method 2:
xfer.command = command2;
xfer.dataAddrOrSameValue = value;
xfer.dataCount = 1000;
FLEXIO_MCULCD_TransferBlocking(&flexioLcdDev, &xfer);
// Method 1:
FLEXIO_MCULCD_WriteCommandBlocking(&flexioLcdDev, command3);
FLEXIO_MCULCD_ReadDataArrayBlocking(&flexioLcdDev, dataToReceive, sizeof(dataToReceive));
// Method 2:
xfer.command = command3;
xfer.dataAddrOrSameValue = (uint32_t)dataToReceive;
xfer.dataCount = sizeof(dataToReceive);
FLEXIO_MCULCD_TransferBlocking(&flexioLcdDev, &xfer);

FlexIO LCD send/receive using interrupt transactional APIs

flexio_MCULCD_handle_t handle;
volatile bool completeFlag = false;
void flexioLcdCallback(FLEXIO_MCULCD_Type *base, flexio_MCULCD_handle_t *handle, status_t status, void *userData)
{
{
completeFlag = true;
}
}
void main(void)
{
// Init the FlexIO LCD driver.
// Create the transactional handle.
FLEXIO_MCULCD_TransferCreateHandle(&flexioLcdDev, &handle, flexioLcdCallback, NULL);
xfer.command = command1;
xfer.dataCount = 0; // Only send command, no data transfer.
completeFlag = false;
FLEXIO_MCULCD_TransferNonBlocking(&flexioLcdDev, &xfer);
// When only send method, it is not necessary to wait for the callback,
// because the command is sent using a blocking method internally. The
// command has been sent out after the function FLEXIO_MCULCD_TransferNonBlocking
// returns.
while (!completeFlag)
{
}
xfer.command = command2;
xfer.dataAddrOrSameValue = (uint32_t)dataToSend;
xfer.dataCount = sizeof(dataToSend);
completeFlag = false;
FLEXIO_MCULCD_TransferNonBlocking(&flexioLcdDev, &handle, &xfer);
while (!completeFlag)
{
}
xfer.command = command2;
xfer.dataAddrOrSameValue = value;
xfer.dataCount = 1000;
completeFlag = false;
FLEXIO_MCULCD_TransferNonBlocking(&flexioLcdDev, &handle, &xfer);
while (!completeFlag)
{
}
xfer.command = command3;
xfer.dataAddrOrSameValue = (uint32_t)dataToReceive;
xfer.dataCount = sizeof(dataToReceive);
completeFlag = false;
FLEXIO_MCULCD_TransferNonBlocking(&flexioLcdDev, &handle, &xfer);
while (!completeFlag)
{
}
}

Modules

 FlexIO eDMA MCU Interface LCD Driver
 SDK provide eDMA transactional APIs to transfer data using eDMA, the eDMA method is similar with interrupt transactional method.
 

Data Structures

struct  FLEXIO_MCULCD_Type
 Define FlexIO MCULCD access structure typedef. More...
 
struct  flexio_mculcd_config_t
 Define FlexIO MCULCD configuration structure. More...
 
struct  flexio_mculcd_transfer_t
 Define FlexIO MCULCD transfer structure. More...
 
struct  flexio_mculcd_handle_t
 Define FlexIO MCULCD handle structure. More...
 

Macros

#define FLEXIO_MCULCD_WAIT_COMPLETE_TIME   512
 The delay time to wait for FLEXIO transmit complete. More...
 
#define FLEXIO_MCULCD_DATA_BUS_WIDTH   16
 The data bus width, must be 8 or 16.
 

Typedefs

typedef void(* flexio_mculcd_pin_func_t )(bool set)
 Function to set or clear the CS and RS pin. More...
 
typedef void(* flexio_mculcd_transfer_callback_t )(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, status_t status, void *userData)
 FlexIO MCULCD callback for finished tranfer. More...
 

Enumerations

enum  _flexio_mculcd_status {
  kStatus_FLEXIO_MCULCD_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 0),
  kStatus_FLEXIO_MCULCD_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 1),
  kStatus_FLEXIO_MCULCD_Error = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 2)
}
 FlexIO LCD transfer status. More...
 
enum  flexio_mculcd_bus_t {
  kFLEXIO_MCULCD_8080,
  kFLEXIO_MCULCD_6800
}
 Define FlexIO MCULCD bus type. More...
 
enum  _flexio_mculcd_interrupt_enable {
  kFLEXIO_MCULCD_TxEmptyInterruptEnable = (1U << 0U),
  kFLEXIO_MCULCD_RxFullInterruptEnable = (1U << 1U)
}
 Define FlexIO MCULCD interrupt mask. More...
 
enum  _flexio_mculcd_status_flags {
  kFLEXIO_MCULCD_TxEmptyFlag = (1U << 0U),
  kFLEXIO_MCULCD_RxFullFlag = (1U << 1U)
}
 Define FlexIO MCULCD status mask. More...
 
enum  _flexio_mculcd_dma_enable {
  kFLEXIO_MCULCD_TxDmaEnable = 0x1U,
  kFLEXIO_MCULCD_RxDmaEnable = 0x2U
}
 Define FlexIO MCULCD DMA mask. More...
 
enum  flexio_mculcd_transfer_mode_t {
  kFLEXIO_MCULCD_ReadArray,
  kFLEXIO_MCULCD_WriteArray,
  kFLEXIO_MCULCD_WriteSameValue
}
 Transfer mode. More...
 

Driver version

#define FSL_FLEXIO_MCULCD_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 FlexIO MCULCD driver version 2.0.0. More...
 

FlexIO MCULCD Configuration

status_t FLEXIO_MCULCD_Init (FLEXIO_MCULCD_Type *base, flexio_mculcd_config_t *config, uint32_t srcClock_Hz)
 Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO MCULCD hardware, and configures the FlexIO MCULCD with FlexIO MCULCD configuration. More...
 
void FLEXIO_MCULCD_Deinit (FLEXIO_MCULCD_Type *base)
 Resets the FLEXIO_MCULCD timer and shifter configuration. More...
 
void FLEXIO_MCULCD_GetDefaultConfig (flexio_mculcd_config_t *config)
 Gets the default configuration to configure the FlexIO MCULCD. More...
 

Status

uint32_t FLEXIO_MCULCD_GetStatusFlags (FLEXIO_MCULCD_Type *base)
 Gets FlexIO MCULCD status flags. More...
 
void FLEXIO_MCULCD_ClearStatusFlags (FLEXIO_MCULCD_Type *base, uint32_t mask)
 Clears FlexIO MCULCD status flags. More...
 

Interrupts

void FLEXIO_MCULCD_EnableInterrupts (FLEXIO_MCULCD_Type *base, uint32_t mask)
 Enables the FlexIO MCULCD interrupt. More...
 
void FLEXIO_MCULCD_DisableInterrupts (FLEXIO_MCULCD_Type *base, uint32_t mask)
 Disables the FlexIO MCULCD interrupt. More...
 

DMA Control

static void FLEXIO_MCULCD_EnableTxDMA (FLEXIO_MCULCD_Type *base, bool enable)
 Enables/disables the FlexIO MCULCD transmit DMA. More...
 
static void FLEXIO_MCULCD_EnableRxDMA (FLEXIO_MCULCD_Type *base, bool enable)
 Enables/disables the FlexIO MCULCD receive DMA. More...
 
static uint32_t FLEXIO_MCULCD_GetTxDataRegisterAddress (FLEXIO_MCULCD_Type *base)
 Gets the FlexIO MCULCD transmit data register address. More...
 
static uint32_t FLEXIO_MCULCD_GetRxDataRegisterAddress (FLEXIO_MCULCD_Type *base)
 Gets the FlexIO MCULCD receive data register address. More...
 

Bus Operations

status_t FLEXIO_MCULCD_SetBaudRate (FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)
 Set desired baud rate. More...
 
void FLEXIO_MCULCD_SetSingleBeatWriteConfig (FLEXIO_MCULCD_Type *base)
 Configures the FLEXIO MCULCD to multiple beats write mode. More...
 
void FLEXIO_MCULCD_ClearSingleBeatWriteConfig (FLEXIO_MCULCD_Type *base)
 Clear the FLEXIO MCULCD multiple beats write mode configuration. More...
 
void FLEXIO_MCULCD_SetSingleBeatReadConfig (FLEXIO_MCULCD_Type *base)
 Configures the FLEXIO MCULCD to multiple beats read mode. More...
 
void FLEXIO_MCULCD_ClearSingleBeatReadConfig (FLEXIO_MCULCD_Type *base)
 Clear the FLEXIO MCULCD multiple beats read mode configuration. More...
 
void FLEXIO_MCULCD_SetMultiBeatsWriteConfig (FLEXIO_MCULCD_Type *base)
 Configures the FLEXIO MCULCD to multiple beats write mode. More...
 
void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig (FLEXIO_MCULCD_Type *base)
 Clear the FLEXIO MCULCD multiple beats write mode configuration. More...
 
void FLEXIO_MCULCD_SetMultiBeatsReadConfig (FLEXIO_MCULCD_Type *base)
 Configures the FLEXIO MCULCD to multiple beats read mode. More...
 
void FLEXIO_MCULCD_ClearMultiBeatsReadConfig (FLEXIO_MCULCD_Type *base)
 Clear the FLEXIO MCULCD multiple beats read mode configuration. More...
 
static void FLEXIO_MCULCD_Enable (FLEXIO_MCULCD_Type *base, bool enable)
 Enables/disables the FlexIO MCULCD module operation. More...
 
uint32_t FLEXIO_MCULCD_ReadData (FLEXIO_MCULCD_Type *base)
 Read data from the FLEXIO MCULCD RX shifter buffer. More...
 
static void FLEXIO_MCULCD_WriteData (FLEXIO_MCULCD_Type *base, uint32_t data)
 Write data into the FLEXIO MCULCD TX shifter buffer. More...
 
static void FLEXIO_MCULCD_StartTransfer (FLEXIO_MCULCD_Type *base)
 Assert the nCS to start transfer. More...
 
static void FLEXIO_MCULCD_StopTransfer (FLEXIO_MCULCD_Type *base)
 De-assert the nCS to stop transfer. More...
 
void FLEXIO_MCULCD_WaitTransmitComplete (void)
 Wait for transmit data send out finished. More...
 
void FLEXIO_MCULCD_WriteCommandBlocking (FLEXIO_MCULCD_Type *base, uint32_t command)
 Send command in blocking way. More...
 
void FLEXIO_MCULCD_WriteDataArrayBlocking (FLEXIO_MCULCD_Type *base, void *data, size_t size)
 Send data array in blocking way. More...
 
void FLEXIO_MCULCD_ReadDataArrayBlocking (FLEXIO_MCULCD_Type *base, void *data, size_t size)
 Read data into array in blocking way. More...
 
void FLEXIO_MCULCD_WriteSameValueBlocking (FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size)
 Send the same value many times in blocking way. More...
 
void FLEXIO_MCULCD_TransferBlocking (FLEXIO_MCULCD_Type *base, flexio_mculcd_transfer_t *xfer)
 Performs a polling transfer. More...
 

Transactional

status_t FLEXIO_MCULCD_TransferCreateHandle (FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, flexio_mculcd_transfer_callback_t callback, void *userData)
 Initializes the FlexIO MCULCD handle, which is used in transactional functions. More...
 
status_t FLEXIO_MCULCD_TransferNonBlocking (FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, flexio_mculcd_transfer_t *xfer)
 Transfer data using IRQ. More...
 
void FLEXIO_MCULCD_TransferAbort (FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle)
 Aborts the data transfer, which used IRQ. More...
 
status_t FLEXIO_MCULCD_TransferGetCount (FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, size_t *count)
 Gets the data transfer status which used IRQ. More...
 
void FLEXIO_MCULCD_TransferHandleIRQ (void *base, void *handle)
 FlexIO MCULCD IRQ handler function. More...
 

Data Structure Documentation

struct FLEXIO_MCULCD_Type

Data Fields

FLEXIO_Type * flexioBase
 FlexIO base pointer. More...
 
flexio_mculcd_bus_t busType
 The bus type, 8080 or 6800. More...
 
uint8_t dataPinStartIndex
 Start index of the data pin, the FlexIO pin dataPinStartIndex to (dataPinStartIndex + FLEXIO_MCULCD_DATA_BUS_WIDTH -1) will be used for data transfer. More...
 
uint8_t ENWRPinIndex
 Pin select for WR(8080 mode), EN(6800 mode). More...
 
uint8_t RDPinIndex
 Pin select for RD(8080 mode), not used in 6800 mode. More...
 
uint8_t txShifterStartIndex
 Start index of shifters used for data write, it must be 0 or 4. More...
 
uint8_t txShifterEndIndex
 End index of shifters used for data write. More...
 
uint8_t rxShifterStartIndex
 Start index of shifters used for data read. More...
 
uint8_t rxShifterEndIndex
 End index of shifters used for data read, it must be 3 or 7. More...
 
uint8_t timerIndex
 Timer index used in FlexIO MCULCD. More...
 
flexio_mculcd_pin_func_t setCSPin
 Function to set or clear the CS pin. More...
 
flexio_mculcd_pin_func_t setRSPin
 Function to set or clear the RS pin. More...
 
flexio_mculcd_pin_func_t setRDWRPin
 Function to set or clear the RD/WR pin, only used in 6800 mode. More...
 

Field Documentation

FLEXIO_Type* FLEXIO_MCULCD_Type::flexioBase
flexio_mculcd_bus_t FLEXIO_MCULCD_Type::busType
uint8_t FLEXIO_MCULCD_Type::dataPinStartIndex

Only support data bus width 8 and 16.

uint8_t FLEXIO_MCULCD_Type::ENWRPinIndex
uint8_t FLEXIO_MCULCD_Type::RDPinIndex
uint8_t FLEXIO_MCULCD_Type::txShifterStartIndex
uint8_t FLEXIO_MCULCD_Type::txShifterEndIndex
uint8_t FLEXIO_MCULCD_Type::rxShifterStartIndex
uint8_t FLEXIO_MCULCD_Type::rxShifterEndIndex
uint8_t FLEXIO_MCULCD_Type::timerIndex
flexio_mculcd_pin_func_t FLEXIO_MCULCD_Type::setCSPin
flexio_mculcd_pin_func_t FLEXIO_MCULCD_Type::setRSPin
flexio_mculcd_pin_func_t FLEXIO_MCULCD_Type::setRDWRPin
struct flexio_mculcd_config_t

Data Fields

bool enable
 Enable/disable FlexIO MCULCD after configuration. More...
 
bool enableInDoze
 Enable/disable FlexIO operation in doze mode. More...
 
bool enableInDebug
 Enable/disable FlexIO operation in debug mode. More...
 
bool enableFastAccess
 
 Enable/disable fast access to FlexIO registers,

fast access requires the FlexIO clock to be at least twice the frequency of the bus clock. More...

 
uint32_t baudRate_Bps
 Baud rate in Bps. More...
 

Field Documentation

bool flexio_mculcd_config_t::enable
bool flexio_mculcd_config_t::enableInDoze
bool flexio_mculcd_config_t::enableInDebug
bool flexio_mculcd_config_t::enableFastAccess
uint32_t flexio_mculcd_config_t::baudRate_Bps
struct flexio_mculcd_transfer_t

Data Fields

uint32_t command
 Command to send. More...
 
flexio_mculcd_transfer_mode_t mode
 Transfer mode. More...
 
uint32_t dataAddrOrSameValue
 When sending the same value for many times, this is the value to send. More...
 
size_t dataSize
 How many bytes to transfer. More...
 

Field Documentation

uint32_t flexio_mculcd_transfer_t::command
flexio_mculcd_transfer_mode_t flexio_mculcd_transfer_t::mode
uint32_t flexio_mculcd_transfer_t::dataAddrOrSameValue

When writing or reading array, this is the address of the data array.

size_t flexio_mculcd_transfer_t::dataSize
struct _flexio_mculcd_handle

typedef for flexio_mculcd_handle_t in advance.

Data Fields

uint32_t dataAddrOrSameValue
 When sending the same value for many times, this is the value to send. More...
 
size_t dataCount
 Total count to be transferred. More...
 
volatile size_t remainingCount
 Remaining count to transfer. More...
 
volatile uint32_t state
 FlexIO MCULCD internal state. More...
 
flexio_mculcd_transfer_callback_t completionCallback
 FlexIO MCULCD transfer completed callback. More...
 
void * userData
 Callback parameter. More...
 

Field Documentation

uint32_t flexio_mculcd_handle_t::dataAddrOrSameValue

When writing or reading array, this is the address of the data array.

size_t flexio_mculcd_handle_t::dataCount
volatile size_t flexio_mculcd_handle_t::remainingCount
volatile uint32_t flexio_mculcd_handle_t::state
flexio_mculcd_transfer_callback_t flexio_mculcd_handle_t::completionCallback
void* flexio_mculcd_handle_t::userData

Macro Definition Documentation

#define FSL_FLEXIO_MCULCD_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
#define FLEXIO_MCULCD_WAIT_COMPLETE_TIME   512

Currently there is no method to detect whether the data has been sent out from the shifter, so the driver use a software delay for this. When the data is written to shifter buffer, the driver call the delay function to wait for the data shift out. If this value is too small, then the last few bytes might be lost when writing data using interrupt method or DMA method.

Typedef Documentation

typedef void(* flexio_mculcd_pin_func_t)(bool set)
typedef void(* flexio_mculcd_transfer_callback_t)(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, status_t status, void *userData)

When tranfer finished, the callback function is called and returns the status as kStatus_FLEXIO_MCULCD_Idle.

Enumeration Type Documentation

Enumerator
kStatus_FLEXIO_MCULCD_Idle 

FlexIO LCD is idle.

kStatus_FLEXIO_MCULCD_Busy 

FlexIO LCD is busy.

kStatus_FLEXIO_MCULCD_Error 

FlexIO LCD error occurred.

Enumerator
kFLEXIO_MCULCD_8080 

Using Intel 8080 bus.

kFLEXIO_MCULCD_6800 

Using Motorola 6800 bus.

Enumerator
kFLEXIO_MCULCD_TxEmptyInterruptEnable 

Transmit buffer empty interrupt enable.

kFLEXIO_MCULCD_RxFullInterruptEnable 

Receive buffer full interrupt enable.

Enumerator
kFLEXIO_MCULCD_TxEmptyFlag 

Transmit buffer empty flag.

kFLEXIO_MCULCD_RxFullFlag 

Receive buffer full flag.

Enumerator
kFLEXIO_MCULCD_TxDmaEnable 

Tx DMA request source.

kFLEXIO_MCULCD_RxDmaEnable 

Rx DMA request source.

Enumerator
kFLEXIO_MCULCD_ReadArray 

Read data into an array.

kFLEXIO_MCULCD_WriteArray 

Write data from an array.

kFLEXIO_MCULCD_WriteSameValue 

Write the same value many times.

Function Documentation

status_t FLEXIO_MCULCD_Init ( FLEXIO_MCULCD_Type base,
flexio_mculcd_config_t config,
uint32_t  srcClock_Hz 
)

The configuration structure can be filled by the user, or be set with default values by the FLEXIO_MCULCD_GetDefaultConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
configPointer to the flexio_mculcd_config_t structure.
srcClock_HzFlexIO source clock in Hz.
Return values
kStatus_SuccessInitialization success.
kStatus_InvalidArgumentInitialization failed because of invalid argument.
void FLEXIO_MCULCD_Deinit ( FLEXIO_MCULCD_Type base)
Parameters
basePointer to the FLEXIO_MCULCD_Type.
void FLEXIO_MCULCD_GetDefaultConfig ( flexio_mculcd_config_t config)

The default configuration value is:

* config->enable = true;
* config->enableInDoze = false;
* config->enableInDebug = true;
* config->enableFastAccess = true;
* config->baudRate_Bps = 96000000U;
*
Parameters
ConfigPointer to the flexio_mculcd_config_t structure.
uint32_t FLEXIO_MCULCD_GetStatusFlags ( FLEXIO_MCULCD_Type base)
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
Returns
status flag; OR'ed value or the _flexio_mculcd_status_flags.
Note
Don't use this function with DMA APIs.
void FLEXIO_MCULCD_ClearStatusFlags ( FLEXIO_MCULCD_Type base,
uint32_t  mask 
)
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
maskStatus to clear, it is the OR'ed value of _flexio_mculcd_status_flags.
Note
Don't use this function with DMA APIs.
void FLEXIO_MCULCD_EnableInterrupts ( FLEXIO_MCULCD_Type base,
uint32_t  mask 
)

This function enables the FlexIO MCULCD interrupt.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
maskInterrupts to enable, it is the OR'ed value of _flexio_mculcd_interrupt_enable.
void FLEXIO_MCULCD_DisableInterrupts ( FLEXIO_MCULCD_Type base,
uint32_t  mask 
)

This function disables the FlexIO MCULCD interrupt.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
maskInterrupts to disable, it is the OR'ed value of _flexio_mculcd_interrupt_enable.
static void FLEXIO_MCULCD_EnableTxDMA ( FLEXIO_MCULCD_Type base,
bool  enable 
)
inlinestatic
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
maskMCULCD DMA source.
enableTrue means enable DMA, false means disable DMA.
static void FLEXIO_MCULCD_EnableRxDMA ( FLEXIO_MCULCD_Type base,
bool  enable 
)
inlinestatic
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
maskMCULCD DMA source.
enableTrue means enable DMA, false means disable DMA.
static uint32_t FLEXIO_MCULCD_GetTxDataRegisterAddress ( FLEXIO_MCULCD_Type base)
inlinestatic

This function returns the MCULCD data register address, which is mainly used by DMA/eDMA.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
Returns
FlexIO MCULCD transmit data register address.
static uint32_t FLEXIO_MCULCD_GetRxDataRegisterAddress ( FLEXIO_MCULCD_Type base)
inlinestatic

This function returns the MCULCD data register address, which is mainly used by DMA/eDMA.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
Returns
FlexIO MCULCD receive data register address.
status_t FLEXIO_MCULCD_SetBaudRate ( FLEXIO_MCULCD_Type base,
uint32_t  baudRate_Bps,
uint32_t  srcClock_Hz 
)
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
baudRate_BpsDesired baud rate.
srcClock_HzFLEXIO clock frequency in Hz.
Return values
kStatus_SuccessSet successfully.
kStatus_InvalidArgumentCould not set the baud rate.
void FLEXIO_MCULCD_SetSingleBeatWriteConfig ( FLEXIO_MCULCD_Type base)

At the begining multiple beats write operation, the FLEXIO MCULCD is configured to multiple beats write mode using this function. After write operation, the configuration is cleared by FLEXIO_MCULCD_ClearSingleBeatWriteConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type.
Note
This is an internal used function, upper layer should not use.
void FLEXIO_MCULCD_ClearSingleBeatWriteConfig ( FLEXIO_MCULCD_Type base)

Clear the write configuration set by FLEXIO_MCULCD_SetSingleBeatWriteConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type.
Note
This is an internal used function, upper layer should not use.
void FLEXIO_MCULCD_SetSingleBeatReadConfig ( FLEXIO_MCULCD_Type base)

At the begining or multiple beats read operation, the FLEXIO MCULCD is configured to multiple beats read mode using this function. After read operation, the configuration is cleared by FLEXIO_MCULCD_ClearSingleBeatReadConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type.
Note
This is an internal used function, upper layer should not use.
void FLEXIO_MCULCD_ClearSingleBeatReadConfig ( FLEXIO_MCULCD_Type base)

Clear the read configuration set by FLEXIO_MCULCD_SetSingleBeatReadConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type.
Note
This is an internal used function, upper layer should not use.
void FLEXIO_MCULCD_SetMultiBeatsWriteConfig ( FLEXIO_MCULCD_Type base)

At the begining multiple beats write operation, the FLEXIO MCULCD is configured to multiple beats write mode using this function. After write operation, the configuration is cleared by FLEXIO_MCULCD_ClearMultBeatsWriteConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type.
Note
This is an internal used function, upper layer should not use.
void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig ( FLEXIO_MCULCD_Type base)

Clear the write configuration set by FLEXIO_MCULCD_SetMultBeatsWriteConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type.
Note
This is an internal used function, upper layer should not use.
void FLEXIO_MCULCD_SetMultiBeatsReadConfig ( FLEXIO_MCULCD_Type base)

At the begining or multiple beats read operation, the FLEXIO MCULCD is configured to multiple beats read mode using this function. After read operation, the configuration is cleared by FLEXIO_MCULCD_ClearMultBeatsReadConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type.
Note
This is an internal used function, upper layer should not use.
void FLEXIO_MCULCD_ClearMultiBeatsReadConfig ( FLEXIO_MCULCD_Type base)

Clear the read configuration set by FLEXIO_MCULCD_SetMultBeatsReadConfig.

Parameters
basePointer to the FLEXIO_MCULCD_Type.
Note
This is an internal used function, upper layer should not use.
static void FLEXIO_MCULCD_Enable ( FLEXIO_MCULCD_Type base,
bool  enable 
)
inlinestatic
Parameters
basePointer to the FLEXIO_MCULCD_Type.
enableTrue to enable, false does not have any effect.
uint32_t FLEXIO_MCULCD_ReadData ( FLEXIO_MCULCD_Type base)

Read data from the RX shift buffer directly, it does no check whether the buffer is empty or not.

If the data bus width is 8-bit:

* uint8_t value;
* value = (uint8_t)FLEXIO_MCULCD_ReadData(base);
*

If the data bus width is 16-bit:

* uint16_t value;
* value = (uint16_t)FLEXIO_MCULCD_ReadData(base);
*
Note
This function returns the RX shifter buffer value (32-bit) directly. The return value should be converted according to data bus width.
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
Returns
The data read out.
Note
Don't use this function with DMA APIs.
static void FLEXIO_MCULCD_WriteData ( FLEXIO_MCULCD_Type base,
uint32_t  data 
)
inlinestatic

Write data into the TX shift buffer directly, it does no check whether the buffer is full or not.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
dataThe data to write.
Note
Don't use this function with DMA APIs.
static void FLEXIO_MCULCD_StartTransfer ( FLEXIO_MCULCD_Type base)
inlinestatic
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
static void FLEXIO_MCULCD_StopTransfer ( FLEXIO_MCULCD_Type base)
inlinestatic
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
void FLEXIO_MCULCD_WaitTransmitComplete ( void  )

Currently there is no effective method to wait for the data send out from the shiter, so here use a while loop to wait.

Note
This is an internal used function.
void FLEXIO_MCULCD_WriteCommandBlocking ( FLEXIO_MCULCD_Type base,
uint32_t  command 
)

This function sends the command and returns when the command has been sent out.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
commandThe command to send.
void FLEXIO_MCULCD_WriteDataArrayBlocking ( FLEXIO_MCULCD_Type base,
void *  data,
size_t  size 
)

This function sends the data array and returns when the data sent out.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
dataThe data array to send.
sizeHow many bytes to write.
void FLEXIO_MCULCD_ReadDataArrayBlocking ( FLEXIO_MCULCD_Type base,
void *  data,
size_t  size 
)

This function reads the data into array and returns when the data read finished.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
dataThe array to save the data.
sizeHow many bytes to read.
void FLEXIO_MCULCD_WriteSameValueBlocking ( FLEXIO_MCULCD_Type base,
uint32_t  sameValue,
size_t  size 
)

This function sends the same value many times. It could be used to clear the LCD screen. If the data bus width is 8, this function will send LSB 8 bits of sameValue for size times. If the data bus is 16, this function will send LSB 16 bits of sameValue for size / 2 times.

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
sameValueThe same value to send.
sizeHow many bytes to send.
void FLEXIO_MCULCD_TransferBlocking ( FLEXIO_MCULCD_Type base,
flexio_mculcd_transfer_t xfer 
)
Note
The API does not return until the transfer finished.
Parameters
basepointer to FLEXIO_MCULCD_Type structure.
xferpointer to flexio_mculcd_transfer_t structure.
status_t FLEXIO_MCULCD_TransferCreateHandle ( FLEXIO_MCULCD_Type base,
flexio_mculcd_handle_t *  handle,
flexio_mculcd_transfer_callback_t  callback,
void *  userData 
)
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
handlePointer to the flexio_mculcd_handle_t structure to store the transfer state.
callbackThe callback function.
userDataThe parameter of the callback function.
Return values
kStatus_SuccessSuccessfully create the handle.
kStatus_OutOfRangeThe FlexIO type/handle/ISR table out of range.
status_t FLEXIO_MCULCD_TransferNonBlocking ( FLEXIO_MCULCD_Type base,
flexio_mculcd_handle_t *  handle,
flexio_mculcd_transfer_t xfer 
)

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

Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
handlePointer to the flexio_mculcd_handle_t structure to store the transfer state.
xferFlexIO MCULCD transfer structure. See flexio_mculcd_transfer_t.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_FLEXIO_MCULCD_BusyMCULCD is busy with another transfer.
void FLEXIO_MCULCD_TransferAbort ( FLEXIO_MCULCD_Type base,
flexio_mculcd_handle_t *  handle 
)
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
handlePointer to the flexio_mculcd_handle_t structure to store the transfer state.
status_t FLEXIO_MCULCD_TransferGetCount ( FLEXIO_MCULCD_Type base,
flexio_mculcd_handle_t *  handle,
size_t *  count 
)
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
handlePointer to the flexio_mculcd_handle_t structure to store the transfer state.
countHow many bytes transferred so far by the non-blocking transaction.
Return values
kStatus_SuccessGet the transferred count Successfully.
kStatus_NoTransferInProgressNo tranfer in process.
void FLEXIO_MCULCD_TransferHandleIRQ ( void *  base,
void *  handle 
)
Parameters
basePointer to the FLEXIO_MCULCD_Type structure.
handlePointer to the flexio_mculcd_handle_t structure to store the transfer state.