![]() |
Kinetis SDK v.1.2 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
Data Structures | |
struct | flexio_uart_dmastate_t |
Runtime state structure for FlexIO UART driver with DMA. More... | |
struct | flexio_uartdma_userconfig_t |
User configuration structure for the FlexIO UART driver with DMA. More... | |
struct | flexio_uartedma_userconfig_t |
User configuration structure for the FlexIO UART driver. More... | |
struct | flexio_uart_edmastate_t |
Runtime state of the FlexIO UART driver. More... | |
FlexIO UART DMA Driver | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaInit (uint32_t instance, flexio_uart_dmastate_t *uartDmaState, const flexio_uartdma_userconfig_t *uartDmaConfig) |
Initializes a FlexIO-simulated UART device to work with DMA. More... | |
void | FLEXIO_UART_DRV_DmaDeinit (flexio_uart_dmastate_t *uartDmaState) |
Shuts down the FlexIO UART. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaSendDataBlocking (flexio_uart_dmastate_t *uartDmaState, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
Sends (transmits) data out through the FlexIO-simulated UART-DMA module using a blocking method. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaSendData (flexio_uart_dmastate_t *uartDmaState, const uint8_t *txBuff, uint32_t txSize) |
Sends (transmits) data through the FlexIO-simulated UART-DMA module using a non-blocking method. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaGetTransmitStatus (flexio_uart_dmastate_t *uartDmaState, uint32_t *bytesRemaining) |
Returns whether the previous FlexIO-simulated UART-DMA transmit has finished. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaAbortSendingData (flexio_uart_dmastate_t *uartDmaState) |
Terminates a non-blocking FlexIO-simulated UART-DMA transmission early. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaReceiveDataBlocking (flexio_uart_dmastate_t *uartDmaState, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
Gets (receives) data from the FlexIO-simulated UART-DMA module using a blocking method. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaReceiveData (flexio_uart_dmastate_t *uartDmaState, uint8_t *rxBuff, uint32_t rxSize) |
Gets (receives) data from the FlexIO-simulated UART-DMA module using a non-blocking method. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaGetReceiveStatus (flexio_uart_dmastate_t *uartDmaState, uint32_t *bytesRemaining) |
Returns whether the previous FlexIO-simulated UART-DMA receive is complete. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_DmaAbortReceivingData (flexio_uart_dmastate_t *uartDmaState) |
Terminates a non-blocking FlexIO-simulated UART-DMA receive early. More... | |
FlexIO UART eDMA Driver | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaInit (uint32_t instance, flexio_uart_edmastate_t *uartEdmaState, const flexio_uartedma_userconfig_t *uartEdmaConfig) |
Initializes a FlexIO-simulated UART device to work with eDMA. More... | |
void | FLEXIO_UART_DRV_EdmaDeinit (flexio_uart_edmastate_t *uartEdmaState) |
Shuts down the FlexIO UART. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaSendDataBlocking (flexio_uart_edmastate_t *uartEdmaState, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
Sends (transmits) data out through the FlexIO-simulated UART-EDMA module using a blocking method. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaSendData (flexio_uart_edmastate_t *uartEdmaState, const uint8_t *txBuff, uint32_t txSize) |
Sends (transmits) data through the FlexIO-simulated UART-EDMA module using a non-blocking method. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaGetTransmitStatus (flexio_uart_edmastate_t *uartEdmaState, uint32_t *bytesRemaining) |
Returns whether the previous FlexIO-simulated UART-EDMA transmit has finished. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaAbortSendingData (flexio_uart_edmastate_t *uartEdmaState) |
Terminates a non-blocking FlexIO-simulated UART-eDMA transmission early. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaReceiveDataBlocking (flexio_uart_edmastate_t *uartEdmaState, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
Gets (receives) data from the FlexIO-simulated UART-eDMA module using a blocking method. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaReceiveData (flexio_uart_edmastate_t *uartEdmaState, uint8_t *rxBuff, uint32_t rxSize) |
Gets (receives) data from the FlexIO-simulated UART-eDMA module using a non-blocking method. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaGetReceiveStatus (flexio_uart_edmastate_t *uartEdmaState, uint32_t *bytesRemaining) |
Returns whether the previous FlexIO-simulated UART-eDMA receive is complete. More... | |
flexio_uart_status_t | FLEXIO_UART_DRV_EdmaAbortReceivingData (flexio_uart_edmastate_t *uartEdmaState) |
Terminates a non-blocking FlexIO-simulated UART-eDMA receive early. More... | |
struct flexio_uart_dmastate_t |
Data Fields | |
flexio_uart_mode_t | mode |
flexio_uart_tx_dev_t | txDev |
flexio_uart_rx_dev_t | rxDev |
volatile bool | isTxBusy |
True if there is an active transmit. More... | |
volatile bool | isRxBusy |
True if there is an active receive. More... | |
volatile bool | isTxBlocking |
True if transmit is blocking transaction. More... | |
volatile bool | isRxBlocking |
True if receive is blocking transaction. More... | |
semaphore_t | txIrqSync |
Used to wait for ISR to complete its TX business. More... | |
semaphore_t | rxIrqSync |
Used to wait for ISR to complete its RX business. More... | |
dma_channel_t | dmaUartTx |
DMA channel used for send. More... | |
dma_channel_t | dmaUartRx |
DMA channel used for receive. More... | |
volatile bool flexio_uart_dmastate_t::isTxBusy |
volatile bool flexio_uart_dmastate_t::isRxBusy |
volatile bool flexio_uart_dmastate_t::isTxBlocking |
volatile bool flexio_uart_dmastate_t::isRxBlocking |
semaphore_t flexio_uart_dmastate_t::txIrqSync |
semaphore_t flexio_uart_dmastate_t::rxIrqSync |
dma_channel_t flexio_uart_dmastate_t::dmaUartTx |
dma_channel_t flexio_uart_dmastate_t::dmaUartRx |
struct flexio_uartdma_userconfig_t |
Use an instance of this structure with the FLEXIO_UART_DRV_DmaInit()function. This enables configuration of the most common settings of the UART peripheral with a single function call. Settings include: UART baud rate, UART parity mode: disabled (default), or even or odd, the number of stop bits, and the number of bits per data word.
Data Fields | |
uint32_t | baudRate |
UART baud rate. | |
flexio_uart_bit_count_per_char_t | bitCountPerChar |
number of bits, 5/6/7/8 bits configurable | |
flexio_uart_mode_t | uartMode |
FlexIO UART working modes: Tx only, Rx only, or both. | |
flexio_uart_hwconfig_t | txConfig |
FlexIO UART TX device hardware resource configuration. | |
flexio_uart_hwconfig_t | rxConfig |
FlexIO UART RX device hardware resource configuration. | |
struct flexio_uartedma_userconfig_t |
Use an instance of this structure with the FLEXIO_UART_DRV_Init()function. This enables configuration of the settings of the FlexIO UART peripheral with a single function call. Settings include: UART baud rate, the number of bits per data word, FlexIO UART mode, TX hardware resource and Rx hardware resource.
Data Fields | |
uint32_t | baudRate |
flexio_uart_bit_count_per_char_t | bitCounter |
flexio_uart_mode_t | uartMode |
flexio_uart_hwconfig_t | txConfig |
flexio_uart_hwconfig_t | rxConfig |
struct flexio_uart_edmastate_t |
This structure holds data that are used by the FlexIO UART peripheral driver to communicate between the transfer function and the interrupt handler. The interrupt handler also uses this information to keep track of its progress. The user passes in the memory for the run-time state structure and the FlexIO UART driver fills out the members.
Data Fields | |
flexio_uart_mode_t | mode |
flexio_uart_tx_dev_t | txDev |
flexio_uart_rx_dev_t | rxDev |
volatile bool | isTxBusy |
volatile bool | isRxBusy |
volatile bool | isTxBlocking |
True if transmit is blocking transaction. More... | |
volatile bool | isRxBlocking |
True if receive is blocking transaction. More... | |
semaphore_t | txIrqSync |
Used to wait for ISR to complete its TX business. More... | |
semaphore_t | rxIrqSync |
Used to wait for ISR to complete its RX business. More... | |
edma_chn_state_t | edmaUartTx |
Structure definition for the EDMA channel. | |
edma_chn_state_t | edmaUartRx |
Structure definition for the EDMA channel. | |
volatile bool flexio_uart_edmastate_t::isTxBlocking |
volatile bool flexio_uart_edmastate_t::isRxBlocking |
semaphore_t flexio_uart_edmastate_t::txIrqSync |
semaphore_t flexio_uart_edmastate_t::rxIrqSync |
flexio_uart_status_t FLEXIO_UART_DRV_DmaInit | ( | uint32_t | instance, |
flexio_uart_dmastate_t * | uartDmaState, | ||
const flexio_uartdma_userconfig_t * | uartDmaConfig | ||
) |
This function initializes the run-time state structure to keep track of the on-going transfers and the module to user-defined settings and default settings. It also configures the underlying FlexIO pin, shifter, and timer resource, and enables the FlexIO simulated UART module DMA interrupt. This example shows how to set up the flexio_uartdma_state_t and the flexio_uartdma_userconfig_t parameters and how to call the FLEXIO_UART_DRV_DmaInit function by passing in these parameters:
instance | The FlexIO instance number. |
uartDmaState | A pointer to the global FlexIO UART driver state structure memory. The user passes in the memory for the run-time state structure. The FlexIO UART driver populates the members. This run-time state structure keeps track of the current transfer in progress. |
uartDmaConfig | The user configuration structure of type flexio_uartdma_userconfig_t. The user populates the members of this structure and passes the pointer of this structure to this function. |
void FLEXIO_UART_DRV_DmaDeinit | ( | flexio_uart_dmastate_t * | uartDmaState | ) |
This function disables the FlexIO-simulated UART-DMA trigger.
uartDmaState | The run-time structure of FlexIO-simulated UART. |
flexio_uart_status_t FLEXIO_UART_DRV_DmaSendDataBlocking | ( | flexio_uart_dmastate_t * | uartDmaState, |
const uint8_t * | txBuff, | ||
uint32_t | txSize, | ||
uint32_t | timeout | ||
) |
uartDmaState | The run-time structure of FlexIO-simulated UART. |
txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
txSize | The number of bytes to send. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
flexio_uart_status_t FLEXIO_UART_DRV_DmaSendData | ( | flexio_uart_dmastate_t * | uartDmaState, |
const uint8_t * | txBuff, | ||
uint32_t | txSize | ||
) |
uartDmaState | The run-time structure of FlexIO-simulated UART. |
txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
txSize | The number of bytes to send. |
flexio_uart_status_t FLEXIO_UART_DRV_DmaGetTransmitStatus | ( | flexio_uart_dmastate_t * | uartDmaState, |
uint32_t * | bytesRemaining | ||
) |
uartDmaState | The run-time structure of FlexIO-simulated UART. |
bytesRemaining | A pointer to a value that is populated with the number of bytes that are remaining in the active transfer. |
kStatus_FlexIO_UART_Success | The transmit has completed successfully. |
kStatus_FlexIO_UART_TxBusy | The transmit is still in progress. bytesTransmitted is filled with the number of bytes which are transmitted up to that point. |
flexio_uart_status_t FLEXIO_UART_DRV_DmaAbortSendingData | ( | flexio_uart_dmastate_t * | uartDmaState | ) |
uartDmaState | The run-time structure of FlexIO-simulated UART. |
kStatus_FlexIO_UART_Success | The transmit was successful. |
kStatus_FlexIO_UART_NoTransmitInProgress | No transmission is currently in progress. |
flexio_uart_status_t FLEXIO_UART_DRV_DmaReceiveDataBlocking | ( | flexio_uart_dmastate_t * | uartDmaState, |
uint8_t * | rxBuff, | ||
uint32_t | rxSize, | ||
uint32_t | timeout | ||
) |
uartDmaState | The run-time structure of FlexIO-simulated UART. |
rxBuff | A pointer to the buffer containing 8-bit read data chars received. |
rxSize | The number of bytes to receive. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
flexio_uart_status_t FLEXIO_UART_DRV_DmaReceiveData | ( | flexio_uart_dmastate_t * | uartDmaState, |
uint8_t * | rxBuff, | ||
uint32_t | rxSize | ||
) |
uartDmaState | The run-time structure of FlexIO-simulated UART. |
rxBuff | A pointer to the buffer containing 8-bit read data chars received. |
rxSize | The number of bytes to receive. |
flexio_uart_status_t FLEXIO_UART_DRV_DmaGetReceiveStatus | ( | flexio_uart_dmastate_t * | uartDmaState, |
uint32_t * | bytesRemaining | ||
) |
uartDmaState | The run-time structure of FlexIO-simulated UART. |
bytesRemaining | A pointer to a value that is populated with the number of bytes which still need to be received in the active transfer. |
kStatus_FlexIO_UART_Success | The receive has completed successfully. |
kStatus_FlexIO_UART_RxBusy | The receive is still in progress. bytesReceived is filled with the number of bytes which are received up to that point. |
flexio_uart_status_t FLEXIO_UART_DRV_DmaAbortReceivingData | ( | flexio_uart_dmastate_t * | uartDmaState | ) |
uartDmaState | The run-time structure of FlexIO-simulated UART. |
kStatus_FlexIO_UART_Success | The receive was successful. |
kStatus_FlexIO_UART_NoTransmitInProgress | No receive is currently in progress. |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaInit | ( | uint32_t | instance, |
flexio_uart_edmastate_t * | uartEdmaState, | ||
const flexio_uartedma_userconfig_t * | uartEdmaConfig | ||
) |
This function initializes the run-time state structure to keep track of the on-going transfers, initializes the module to user-defined settings and default settings, configures underlying FlexIO pin, shifter, and timer resource, and enables the FlexIO simulated UART module eDMA interrupt. This example shows how to set up the flexio_uartedma_state_t and the flexio_uartedma_userconfig_t parameters and how to call the FLEXIO_UART_DRV_EdmaInit function by passing in these parameters:
instance | The FlexIO instance number. |
uartEdmaState | A pointer to the global FlexIO UART driver state structure memory. The user passes in the memory for the run-time state structure. The FlexIO UART driver populates the members. This run-time state structure keeps track of the current transfer in progress. |
uartEdmaConfig | The user configuration structure of type flexio_uartedma_userconfig_t. The user populates the members of this structure and passes the pointer of this structure to this function. |
void FLEXIO_UART_DRV_EdmaDeinit | ( | flexio_uart_edmastate_t * | uartEdmaState | ) |
This function disables the FlexIO-simulated UART-eDMA trigger.
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaSendDataBlocking | ( | flexio_uart_edmastate_t * | uartEdmaState, |
const uint8_t * | txBuff, | ||
uint32_t | txSize, | ||
uint32_t | timeout | ||
) |
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
txSize | The number of bytes to send. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaSendData | ( | flexio_uart_edmastate_t * | uartEdmaState, |
const uint8_t * | txBuff, | ||
uint32_t | txSize | ||
) |
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
txSize | The number of bytes to send. |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaGetTransmitStatus | ( | flexio_uart_edmastate_t * | uartEdmaState, |
uint32_t * | bytesRemaining | ||
) |
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
bytesRemaining | A pointer to a value that is populated with the number of bytes that are remaining in the active transfer. |
kStatus_FlexIO_UART_Success | The transmit has completed successfully. |
kStatus_FlexIO_UART_TxBusy | The transmit is still in progress. bytesTransmitted is filled with the number of bytes which are transmitted up to that point. |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaAbortSendingData | ( | flexio_uart_edmastate_t * | uartEdmaState | ) |
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
kStatus_FlexIO_UART_Success | The transmit was successful. |
kStatus_FlexIO_UART_NoTransmitInProgress | No transmission is currently in progress. |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaReceiveDataBlocking | ( | flexio_uart_edmastate_t * | uartEdmaState, |
uint8_t * | rxBuff, | ||
uint32_t | rxSize, | ||
uint32_t | timeout | ||
) |
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
rxBuff | A pointer to the buffer containing 8-bit read data chars received. |
rxSize | The number of bytes to receive. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaReceiveData | ( | flexio_uart_edmastate_t * | uartEdmaState, |
uint8_t * | rxBuff, | ||
uint32_t | rxSize | ||
) |
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
rxBuff | A pointer to the buffer containing 8-bit read data chars received. |
rxSize | The number of bytes to receive. |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaGetReceiveStatus | ( | flexio_uart_edmastate_t * | uartEdmaState, |
uint32_t * | bytesRemaining | ||
) |
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
bytesRemaining | A pointer to a value that is populated with the number of bytes which still need to be received in the active transfer. |
kStatus_FlexIO_UART_Success | The receive has completed successfully. |
kStatus_FlexIO_UART_RxBusy | The receive is still in progress. bytesReceived is filled with the number of bytes which are received up to that point. |
flexio_uart_status_t FLEXIO_UART_DRV_EdmaAbortReceivingData | ( | flexio_uart_edmastate_t * | uartEdmaState | ) |
uartEdmaState | The run-time structure of FlexIO-simulated UART. |
kStatus_FlexIO_UART_Success | The receive was successful. |
kStatus_FlexIO_UART_NoTransmitInProgress | No receive is currently in progress. |