Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the LPUART type definitions.
The LPUART peripheral driver transfers data to and from external devices on the Low Power Universal Asynchronous Receiver/Transmitter (LPUART) serial bus. It provides a method to transmit or receive buffers of data with a single function call.
The driver uses instantiations of the lpuart_tx_state_t and the lpuart_rx_state_t structure to maintain the current state of a particular LPUART instance module driver. The user is required to provide memory for the driver state structures during the initialization. The driver itself does not statically allocate memory.
Typically the user configures the lpuart_user_config_t instantiation as an 8-bit-char, no-parity, 1-stop-bit (8-n-1) with a baud rate of 9600 bps. The lpuart_user_config_t instantiation can be modified to configure the LPUART peripheral to a different baud rate or character transfer features. This is a code example to set up a user LPUART configuration instantiation:
The driver implements transmit and receive functions to transfer buffers of data by blocking and non-blocking modes.
The blocking transmit and receive functions include LPUART_DRV_SendDataBlocking() and the LPUART_DRV_ReceiveDataBlocking() functions.
The non-blocking (async) transmit and receive functions include the LPUART_DRV_SendData() and the LPUART_DRV_ReceiveData() functions.
When using DMA to transfer data, ensure that the data is consistent when there is cache for memory. This means, when reading/ writing the data from/to memory, the application should ensure that data from or to the memory device is not cached.
In all these cases, the functions are interrupt-driven.