![]() |
Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the LPUART Peripheral driver.
Data Structures | |
| struct | lpuart_dma_state_t |
| Runtime state structure for UART driver with DMA. More... | |
| struct | lpuart_dma_user_config_t |
| LPUART configuration structure. More... | |
| struct | lpuart_state_t |
| Runtime state of the LPUART driver. More... | |
| struct | lpuart_user_config_t |
| LPUART configuration structure. More... | |
| struct | lpuart_edma_state_t |
| Runtime state structure for UART driver with DMA. More... | |
| struct | lpuart_edma_user_config_t |
| LPUART configuration structure. More... | |
Typedefs | |
| typedef void(* | lpuart_rx_callback_t )(uint32_t instance, void *lpuartState) |
| LPUART receive callback function type. More... | |
| typedef void(* | lpuart_tx_callback_t )(uint32_t instance, void *lpuartState) |
| UART transmit callback function type. | |
Variables | |
| LPUART_Type *const | g_lpuartBase [LPUART_INSTANCE_COUNT] |
| Table of base addresses for LPUART instances. More... | |
| LPUART_Type *const | g_lpuartBase [LPUART_INSTANCE_COUNT] |
| Table of base addresses for LPUART instances. More... | |
| const IRQn_Type | g_lpuartRxTxIrqId [LPUART_INSTANCE_COUNT] |
| Table to save LPUART IRQ enumeration numbers defined in the CMSIS header file. | |
| LPUART_Type *const | g_lpuartBase [LPUART_INSTANCE_COUNT] |
| Table of base addresses for LPUART instances. More... | |
LPUART DMA Driver | |
| lpuart_status_t | LPUART_DRV_DmaInit (uint32_t instance, lpuart_dma_state_t *lpuartDmaStatePtr, const lpuart_dma_user_config_t *lpuartUserConfig) |
| Initializes an LPUART instance to work with DMA. More... | |
| lpuart_status_t | LPUART_DRV_DmaDeinit (uint32_t instance) |
| Shuts down the LPUART. More... | |
| lpuart_status_t | LPUART_DRV_DmaSendDataBlocking (uint32_t instance, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
| Sends (transmits) data out through the LPUART-DMA module using a blocking method. More... | |
| lpuart_status_t | LPUART_DRV_DmaSendData (uint32_t instance, const uint8_t *txBuff, uint32_t txSize) |
| Sends (transmits) data through the LPUART-DMA module using a non-blocking method. More... | |
| lpuart_status_t | LPUART_DRV_DmaGetTransmitStatus (uint32_t instance, uint32_t *bytesRemaining) |
| Returns whether the previous LPUART-DMA transmit has finished. More... | |
| lpuart_status_t | LPUART_DRV_DmaAbortSendingData (uint32_t instance) |
| Terminates a non-blocking LPUART-DMA transmission early. More... | |
| lpuart_status_t | LPUART_DRV_DmaReceiveDataBlocking (uint32_t instance, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
| Gets (receives) data from the LPUART-DMA module using a blocking method. More... | |
| lpuart_status_t | LPUART_DRV_DmaReceiveData (uint32_t instance, uint8_t *rxBuff, uint32_t rxSize) |
| Gets (receives) data from the LPUART-DMA module using a non-blocking method. More... | |
| lpuart_status_t | LPUART_DRV_DmaGetReceiveStatus (uint32_t instance, uint32_t *bytesRemaining) |
| Returns whether the previous LPUART-DMA receive is complete. More... | |
| lpuart_status_t | LPUART_DRV_DmaAbortReceivingData (uint32_t instance) |
| Terminates a non-blocking LPUART-DMA receive early. More... | |
LPUART Driver | |
| lpuart_status_t | LPUART_DRV_Init (uint32_t instance, lpuart_state_t *lpuartStatePtr, const lpuart_user_config_t *lpuartUserConfig) |
| Initializes an LPUART operation instance. More... | |
| lpuart_status_t | LPUART_DRV_Deinit (uint32_t instance) |
| Shuts down the LPUART by disabling interrupts and transmitter/receiver. More... | |
| lpuart_rx_callback_t | LPUART_DRV_InstallRxCallback (uint32_t instance, lpuart_rx_callback_t function, uint8_t *rxBuff, void *callbackParam, bool alwaysEnableRxIrq) |
| Installs callback function for the LPUART receive. More... | |
| lpuart_tx_callback_t | LPUART_DRV_InstallTxCallback (uint32_t instance, lpuart_tx_callback_t function, uint8_t *txBuff, void *callbackParam) |
| Installs callback function for the LPUART transmit. More... | |
| lpuart_status_t | LPUART_DRV_SendDataBlocking (uint32_t instance, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
| Sends data out through the LPUART module using a blocking method. More... | |
| lpuart_status_t | LPUART_DRV_SendData (uint32_t instance, const uint8_t *txBuff, uint32_t txSize) |
| Sends data out through the LPUART module using a non-blocking method. More... | |
| lpuart_status_t | LPUART_DRV_GetTransmitStatus (uint32_t instance, uint32_t *bytesRemaining) |
| Returns whether the previous transmit is complete. More... | |
| lpuart_status_t | LPUART_DRV_AbortSendingData (uint32_t instance) |
| Terminates a non-blocking transmission early. More... | |
| lpuart_status_t | LPUART_DRV_ReceiveDataBlocking (uint32_t instance, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
| Gets data from the LPUART module by using a blocking method. More... | |
| lpuart_status_t | LPUART_DRV_ReceiveData (uint32_t instance, uint8_t *rxBuff, uint32_t rxSize) |
| Gets data from the LPUART module by using a non-blocking method. More... | |
| lpuart_status_t | LPUART_DRV_GetReceiveStatus (uint32_t instance, uint32_t *bytesRemaining) |
| Returns whether the previous receive is complete. More... | |
| lpuart_status_t | LPUART_DRV_AbortReceivingData (uint32_t instance) |
| Terminates a non-blocking receive early. More... | |
LPUART DMA Driver | |
| lpuart_status_t | LPUART_DRV_EdmaInit (uint32_t instance, lpuart_edma_state_t *lpuartEdmaStatePtr, const lpuart_edma_user_config_t *lpuartUserConfig) |
| Initializes an LPUART instance to work with DMA. More... | |
| lpuart_status_t | LPUART_DRV_EdmaDeinit (uint32_t instance) |
| Shuts down the LPUART. More... | |
| lpuart_status_t | LPUART_DRV_EdmaSendDataBlocking (uint32_t instance, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
| Sends (transmits) data out through the LPUART-DMA module using a blocking method. More... | |
| lpuart_status_t | LPUART_DRV_EdmaSendData (uint32_t instance, const uint8_t *txBuff, uint32_t txSize) |
| Sends (transmits) data through the LPUART-DMA module using a non-blocking method. More... | |
| lpuart_status_t | LPUART_DRV_EdmaGetTransmitStatus (uint32_t instance, uint32_t *bytesRemaining) |
| Returns whether the previous LPUART-DMA transmit has finished. More... | |
| lpuart_status_t | LPUART_DRV_EdmaAbortSendingData (uint32_t instance) |
| Terminates a non-blocking LPUART-DMA transmission early. More... | |
| lpuart_status_t | LPUART_DRV_EdmaReceiveDataBlocking (uint32_t instance, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
| Gets (receives) data from the LPUART-DMA module using a blocking method. More... | |
| lpuart_status_t | LPUART_DRV_EdmaReceiveData (uint32_t instance, uint8_t *rxBuff, uint32_t rxSize) |
| Gets (receives) data from the LPUART-DMA module using a non-blocking method. More... | |
| lpuart_status_t | LPUART_DRV_EdmaGetReceiveStatus (uint32_t instance, uint32_t *bytesRemaining) |
| Returns whether the previous LPUART-DMA receive is complete. More... | |
| lpuart_status_t | LPUART_DRV_EdmaAbortReceivingData (uint32_t instance) |
| Terminates a non-blocking LPUART-DMA receive early. More... | |
| struct lpuart_dma_state_t |
Data Fields | |
| 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 | dmaLpuartTx |
| Structure definition for the DMA channel. | |
| dma_channel_t | dmaLpuartRx |
| Structure definition for the DMA channel. | |
| volatile bool lpuart_dma_state_t::isTxBusy |
| volatile bool lpuart_dma_state_t::isRxBusy |
| volatile bool lpuart_dma_state_t::isTxBlocking |
| volatile bool lpuart_dma_state_t::isRxBlocking |
| semaphore_t lpuart_dma_state_t::txIrqSync |
| semaphore_t lpuart_dma_state_t::rxIrqSync |
| struct lpuart_dma_user_config_t |
Data Fields | |
| clock_lpuart_src_t | clockSource |
| LPUART clock source in fsl_sim_hal_<device>.h. | |
| uint32_t | baudRate |
| LPUART baud rate. | |
| lpuart_parity_mode_t | parityMode |
| parity mode, disabled (default), even, odd | |
| lpuart_stop_bit_count_t | stopBitCount |
| number of stop bits, 1 stop bit (default) or 2 stop bits | |
| lpuart_bit_count_per_char_t | bitCountPerChar |
| number of bits, 8-bit (default) or 9-bit in a char (up to 10-bits in some LPUART instances. More... | |
| lpuart_bit_count_per_char_t lpuart_dma_user_config_t::bitCountPerChar |
| struct lpuart_state_t |
Note that the caller must provide memory for the driver state structures during initialization because the driver does not statically allocate memory.
Data Fields | |
| uint8_t | txFifoEntryCount |
| Number of data word entries in transmit FIFO. More... | |
| const uint8_t * | txBuff |
| The buffer of data being sent. More... | |
| uint8_t * | rxBuff |
| The buffer of received data. More... | |
| volatile size_t | txSize |
| The remaining number of bytes to be transmitted. More... | |
| volatile size_t | rxSize |
| The remaining number of bytes to be received. More... | |
| 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 transmit. More... | |
| semaphore_t | rxIrqSync |
| Used to wait for ISR to complete receive. More... | |
| lpuart_rx_callback_t | rxCallback |
| Callback to invoke after receiving byte. More... | |
| void * | rxCallbackParam |
| Receive callback parameter pointer. More... | |
| lpuart_tx_callback_t | txCallback |
| Callback to invoke after transmitting byte. More... | |
| void * | txCallbackParam |
| Transmit callback parameter pointer. More... | |
| uint8_t lpuart_state_t::txFifoEntryCount |
| const uint8_t* lpuart_state_t::txBuff |
| uint8_t* lpuart_state_t::rxBuff |
| volatile size_t lpuart_state_t::txSize |
| volatile size_t lpuart_state_t::rxSize |
| volatile bool lpuart_state_t::isTxBusy |
| volatile bool lpuart_state_t::isRxBusy |
| volatile bool lpuart_state_t::isTxBlocking |
| volatile bool lpuart_state_t::isRxBlocking |
| semaphore_t lpuart_state_t::txIrqSync |
| semaphore_t lpuart_state_t::rxIrqSync |
| lpuart_rx_callback_t lpuart_state_t::rxCallback |
| void* lpuart_state_t::rxCallbackParam |
| lpuart_tx_callback_t lpuart_state_t::txCallback |
| void* lpuart_state_t::txCallbackParam |
| struct lpuart_user_config_t |
Data Fields | |
| clock_lpuart_src_t | clockSource |
| LPUART clock source. | |
| uint32_t | baudRate |
| LPUART baud rate. | |
| lpuart_parity_mode_t | parityMode |
| parity mode, disabled (default), even, odd | |
| lpuart_stop_bit_count_t | stopBitCount |
| number of stop bits, 1 stop bit (default) or 2 stop bits | |
| lpuart_bit_count_per_char_t | bitCountPerChar |
| number of bits, 8-bit (default) or 9-bit in a char (up to 10-bits in some LPUART instances. | |
| struct lpuart_edma_state_t |
Data Fields | |
| 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... | |
| edma_chn_state_t | edmaLpuartTx |
| Structure definition for the eDMA channel. | |
| edma_chn_state_t | edmaLpuartRx |
| Structure definition for the eDMA channel. | |
| volatile bool lpuart_edma_state_t::isTxBusy |
| volatile bool lpuart_edma_state_t::isRxBusy |
| volatile bool lpuart_edma_state_t::isTxBlocking |
| volatile bool lpuart_edma_state_t::isRxBlocking |
| semaphore_t lpuart_edma_state_t::txIrqSync |
| semaphore_t lpuart_edma_state_t::rxIrqSync |
| struct lpuart_edma_user_config_t |
Data Fields | |
| clock_lpuart_src_t | clockSource |
| LPUART clock source in fsl_sim_hal_<device>.h. | |
| uint32_t | baudRate |
| LPUART baud rate. | |
| lpuart_parity_mode_t | parityMode |
| parity mode, disabled (default), even, odd | |
| lpuart_stop_bit_count_t | stopBitCount |
| number of stop bits, 1 stop bit (default) or 2 stop bits | |
| lpuart_bit_count_per_char_t | bitCountPerChar |
| number of bits, 8-bit (default) or 9-bit in a char (up to 10-bits in some LPUART instances. More... | |
| lpuart_bit_count_per_char_t lpuart_edma_user_config_t::bitCountPerChar |
| typedef void(* lpuart_rx_callback_t)(uint32_t instance, void *lpuartState) |
| lpuart_status_t LPUART_DRV_DmaInit | ( | uint32_t | instance, |
| lpuart_dma_state_t * | lpuartDmaStatePtr, | ||
| const lpuart_dma_user_config_t * | lpuartUserConfig | ||
| ) |
This function initializes the run-time state structure to keep track of the on-going transfers, un-gates the clock to the LPUART module, initializes the module to user-defined settings and default settings, configures the IRQ state structure and enables the module-level interrupt to the core, and enables the LPUART module transmitter and receiver. This example shows how to set up the lpuart_dma_state_t and the lpuart_user_config_t parameters and how to call the LPUART_DRV_DmaInit function by passing in these parameters:
| instance | The LPUART instance number. |
| lpuartDmaStatePtr | A pointer to the LPUART driver state structure memory. The user passes in the memory for the run-time state structure. The LPUART driver populates the members. This run-time state structure keeps track of the current transfer in progress. |
| lpuartUserConfig | The user configuration structure of type lpuart_user_config_t. The user populates the members of this structure and passes the pointer of this structure into this function. |
| lpuart_status_t LPUART_DRV_DmaDeinit | ( | uint32_t | instance | ) |
This function disables the LPUART-DMA trigger, the transmitter, and the receiver.
| instance | The LPUART instance number. |
| lpuart_status_t LPUART_DRV_DmaSendDataBlocking | ( | uint32_t | instance, |
| const uint8_t * | txBuff, | ||
| uint32_t | txSize, | ||
| uint32_t | timeout | ||
| ) |
| instance | The LPUART instance number. |
| 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). |
| lpuart_status_t LPUART_DRV_DmaSendData | ( | uint32_t | instance, |
| const uint8_t * | txBuff, | ||
| uint32_t | txSize | ||
| ) |
| instance | The LPUART module base address. |
| txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
| txSize | The number of bytes to send. |
| lpuart_status_t LPUART_DRV_DmaGetTransmitStatus | ( | uint32_t | instance, |
| uint32_t * | bytesRemaining | ||
| ) |
| instance | The LPUART module base address. |
| bytesRemaining | A pointer to a value that is populated with the number of bytes that are remaining in the active transfer. |
| kStatus_LPUART_Success | The transmit has completed successfully. |
| kStatus_LPUART_TxBusy | The transmit is still in progress. bytesTransmitted is filled with the number of bytes which are transmitted up to that point. |
| lpuart_status_t LPUART_DRV_DmaAbortSendingData | ( | uint32_t | instance | ) |
| instance | The LPUART module base address. |
| kStatus_LPUART_Success | The transmit was successful. |
| kStatus_LPUART_NoTransmitInProgress | No transmission is currently in progress. |
| lpuart_status_t LPUART_DRV_DmaReceiveDataBlocking | ( | uint32_t | instance, |
| uint8_t * | rxBuff, | ||
| uint32_t | rxSize, | ||
| uint32_t | timeout | ||
| ) |
| instance | The LPUART module base address. |
| 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). |
| lpuart_status_t LPUART_DRV_DmaReceiveData | ( | uint32_t | instance, |
| uint8_t * | rxBuff, | ||
| uint32_t | rxSize | ||
| ) |
| instance | The LPUART module base address. |
| rxBuff | A pointer to the buffer containing 8-bit read data chars received. |
| rxSize | The number of bytes to receive. |
| lpuart_status_t LPUART_DRV_DmaGetReceiveStatus | ( | uint32_t | instance, |
| uint32_t * | bytesRemaining | ||
| ) |
| instance | The LPUART module base address. |
| bytesRemaining | A pointer to a value that populated with the number of bytes which still need to be received in the active transfer. |
| kStatus_LPUART_Success | The receive has completed successfully. |
| kStatus_LPUART_RxBusy | The receive is still in progress. bytesReceived is filled with the number of bytes which are received up to that point. |
| lpuart_status_t LPUART_DRV_DmaAbortReceivingData | ( | uint32_t | instance | ) |
| instance | The LPUART module base address. |
| kStatus_LPUART_Success | The receive was successful. |
| kStatus_LPUART_NoTransmitInProgress | No receive is currently in progress. |
| lpuart_status_t LPUART_DRV_Init | ( | uint32_t | instance, |
| lpuart_state_t * | lpuartStatePtr, | ||
| const lpuart_user_config_t * | lpuartUserConfig | ||
| ) |
The caller provides memory for the driver state structures during initialization. The user must select the LPUART clock source in the application to initialize the LPUART.
| instance | LPUART instance number |
| lpuartUserConfig | user configuration structure of type lpuart_user_config_t |
| lpuartStatePtr | pointer to the LPUART driver state structure |
| lpuart_status_t LPUART_DRV_Deinit | ( | uint32_t | instance | ) |
This function disables the LPUART interrupts, the transmitter and receiver, and flushes the FIFOs (for modules that support FIFOs).
| instance | LPUART instance number |
| lpuart_rx_callback_t LPUART_DRV_InstallRxCallback | ( | uint32_t | instance, |
| lpuart_rx_callback_t | function, | ||
| uint8_t * | rxBuff, | ||
| void * | callbackParam, | ||
| bool | alwaysEnableRxIrq | ||
| ) |
| instance | The LPUART instance number. |
| function | The LPUART receive callback function. |
| rxBuff | The receive buffer used inside IRQHandler. This buffer must be kept as long as the callback is alive. |
| callbackParam | The LPUART receive callback parameter pointer. |
| alwaysEnableRxIrq | Whether always enable receive IRQ or not. |
| lpuart_tx_callback_t LPUART_DRV_InstallTxCallback | ( | uint32_t | instance, |
| lpuart_tx_callback_t | function, | ||
| uint8_t * | txBuff, | ||
| void * | callbackParam | ||
| ) |
| instance | The LPUART instance number. |
| function | The LPUART transmit callback function. |
| txBuff | The transmit buffer used inside IRQHandler. This buffer must be kept as long as the callback is alive. |
| callbackParam | The LPUART transmit callback parameter pointer. |
| lpuart_status_t LPUART_DRV_SendDataBlocking | ( | uint32_t | instance, |
| const uint8_t * | txBuff, | ||
| uint32_t | txSize, | ||
| uint32_t | timeout | ||
| ) |
Blocking means that the function does not return until the transmission is complete.
| instance | LPUART instance number |
| txBuff | source buffer containing 8-bit data characters to send |
| txSize | the number of bytes to send |
| timeout | timeout value for RTOS abstraction sync control |
| lpuart_status_t LPUART_DRV_SendData | ( | uint32_t | instance, |
| const uint8_t * | txBuff, | ||
| uint32_t | txSize | ||
| ) |
This enables an a-sync method for transmitting data. When used with a non-blocking receive, the LPUART can perform a full duplex operation. Non-blocking means that the function returns immediately. The application has to get the transmit status to know when the transmit is complete.
| instance | LPUART instance number |
| txBuff | source buffer containing 8-bit data characters to send |
| txSize | the number of bytes to send |
| lpuart_status_t LPUART_DRV_GetTransmitStatus | ( | uint32_t | instance, |
| uint32_t * | bytesRemaining | ||
| ) |
| instance | LPUART instance number |
| bytesRemaining | Pointer to value that is populated with the number of bytes that have been sent in the active transfer |
| kStatus_LPUART_Success | The transmit has completed successfully. |
| kStatus_LPUART_TxBusy | The transmit is still in progress. bytesTransmitted will be filled with the number of bytes that have been transmitted so far. |
| lpuart_status_t LPUART_DRV_AbortSendingData | ( | uint32_t | instance | ) |
| instance | LPUART instance number |
| lpuart_status_t LPUART_DRV_ReceiveDataBlocking | ( | uint32_t | instance, |
| uint8_t * | rxBuff, | ||
| uint32_t | rxSize, | ||
| uint32_t | timeout | ||
| ) |
Blocking means that the function does not return until the receive is complete.
| instance | LPUART instance number |
| rxBuff | buffer containing 8-bit read data characters received |
| rxSize | the number of bytes to receive |
| timeout | timeout value for RTOS abstraction sync control |
| lpuart_status_t LPUART_DRV_ReceiveData | ( | uint32_t | instance, |
| uint8_t * | rxBuff, | ||
| uint32_t | rxSize | ||
| ) |
This enables an a-sync method for receiving data. When used with a non-blocking transmission, the LPUART can perform a full duplex operation. Non-blocking means that the function returns immediately. The application has to get the receive status to know when the receive is complete.
| instance | LPUART instance number |
| rxBuff | buffer containing 8-bit read data characters received |
| rxSize | the number of bytes to receive |
| lpuart_status_t LPUART_DRV_GetReceiveStatus | ( | uint32_t | instance, |
| uint32_t * | bytesRemaining | ||
| ) |
| instance | LPUART instance number |
| bytesRemaining | pointer to value that is filled with the number of bytes that still need to be received in the active transfer. |
| kStatus_LPUART_Success | the receive has completed successfully. |
| kStatus_LPUART_RxBusy | the receive is still in progress. bytesReceived will be filled with the number of bytes that have been received so far. |
| lpuart_status_t LPUART_DRV_AbortReceivingData | ( | uint32_t | instance | ) |
| instance | LPUART instance number |
| lpuart_status_t LPUART_DRV_EdmaInit | ( | uint32_t | instance, |
| lpuart_edma_state_t * | lpuartEdmaStatePtr, | ||
| const lpuart_edma_user_config_t * | lpuartUserConfig | ||
| ) |
This function initializes the run-time state structure to keep track of the on-going transfers, un-gates the clock to the LPUART module, initializes the module to user-defined settings and default settings, configures the IRQ state structure and enables the module-level interrupt to the core, and enables the LPUART module transmitter and receiver. This example shows how to set up the lpuart_edma_state_t and the lpuart_user_config_t parameters and how to call the LPUART_DRV_EdmaInit function by passing in these parameters:
| instance | The LPUART instance number. |
| lpuartEdmaStatePtr | A pointer to the LPUART driver state structure memory. The user passes in the memory for the run-time state structure. The LPUART driver populates the members. This run-time state structure keeps track of the current transfer in progress. |
| lpuartUserConfig | The user configuration structure of type lpuart_user_config_t. The user populates the members of this structure and passes the pointer of this structure into this function. |
| lpuart_status_t LPUART_DRV_EdmaDeinit | ( | uint32_t | instance | ) |
This function disables the LPUART-DMA trigger, the transmitter, and the receiver.
| instance | The LPUART instance number. |
| lpuart_status_t LPUART_DRV_EdmaSendDataBlocking | ( | uint32_t | instance, |
| const uint8_t * | txBuff, | ||
| uint32_t | txSize, | ||
| uint32_t | timeout | ||
| ) |
| instance | The LPUART instance number. |
| 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). |
| lpuart_status_t LPUART_DRV_EdmaSendData | ( | uint32_t | instance, |
| const uint8_t * | txBuff, | ||
| uint32_t | txSize | ||
| ) |
| instance | The LPUART module base address. |
| txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
| txSize | The number of bytes to send. |
| lpuart_status_t LPUART_DRV_EdmaGetTransmitStatus | ( | uint32_t | instance, |
| uint32_t * | bytesRemaining | ||
| ) |
| instance | The LPUART module base address. |
| bytesRemaining | A pointer to a value that is populated with the number of bytes that are remaining in the active transfer. |
| kStatus_LPUART_Success | The transmit has completed successfully. |
| kStatus_LPUART_TxBusy | The transmit is still in progress. bytesTransmitted is filled with the number of bytes which are transmitted up to that point. |
| lpuart_status_t LPUART_DRV_EdmaAbortSendingData | ( | uint32_t | instance | ) |
| instance | The LPUART module base address. |
| kStatus_LPUART_Success | The transmit was successful. |
| kStatus_LPUART_NoTransmitInProgress | No transmission is currently in progress. |
| lpuart_status_t LPUART_DRV_EdmaReceiveDataBlocking | ( | uint32_t | instance, |
| uint8_t * | rxBuff, | ||
| uint32_t | rxSize, | ||
| uint32_t | timeout | ||
| ) |
| instance | The LPUART module base address. |
| 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). |
| lpuart_status_t LPUART_DRV_EdmaReceiveData | ( | uint32_t | instance, |
| uint8_t * | rxBuff, | ||
| uint32_t | rxSize | ||
| ) |
| instance | The LPUART module base address. |
| rxBuff | A pointer to the buffer containing 8-bit read data chars received. |
| rxSize | The number of bytes to receive. |
| lpuart_status_t LPUART_DRV_EdmaGetReceiveStatus | ( | uint32_t | instance, |
| uint32_t * | bytesRemaining | ||
| ) |
| instance | The LPUART module base address. |
| bytesRemaining | A pointer to a value that populated with the number of bytes which still need to be received in the active transfer. |
| kStatus_LPUART_Success | The receive has completed successfully. |
| kStatus_LPUART_RxBusy | The receive is still in progress. bytesReceived is filled with the number of bytes which are received up to that point. |
| lpuart_status_t LPUART_DRV_EdmaAbortReceivingData | ( | uint32_t | instance | ) |
| instance | The LPUART module base address. |
| kStatus_LPUART_Success | The receive was successful. |
| kStatus_LPUART_NoTransmitInProgress | No receive is currently in progress. |
| LPUART_Type* const g_lpuartBase[LPUART_INSTANCE_COUNT] |
| LPUART_Type* const g_lpuartBase[LPUART_INSTANCE_COUNT] |
| LPUART_Type* const g_lpuartBase[LPUART_INSTANCE_COUNT] |