MCUXpresso SDK API Reference Manual
Rev 2.12.1
NXP Semiconductors
|
Data Structures | |
struct | lpuart_rtos_config_t |
LPUART RTOS configuration structure. More... | |
Driver version | |
#define | FSL_LPUART_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 6, 0)) |
LPUART FreeRTOS driver version. More... | |
LPUART RTOS Operation | |
int | LPUART_RTOS_Init (lpuart_rtos_handle_t *handle, lpuart_handle_t *t_handle, const lpuart_rtos_config_t *cfg) |
Initializes an LPUART instance for operation in RTOS. More... | |
int | LPUART_RTOS_Deinit (lpuart_rtos_handle_t *handle) |
Deinitializes an LPUART instance for operation. More... | |
LPUART transactional Operation | |
int | LPUART_RTOS_Send (lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length) |
Sends data in the background. More... | |
int | LPUART_RTOS_Receive (lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received) |
Receives data. More... | |
int | LPUART_RTOS_SetRxTimeout (lpuart_rtos_handle_t *handle, uint32_t rx_timeout_constant_ms, uint32_t rx_timeout_multiplier_ms) |
Set RX timeout in runtime. More... | |
int | LPUART_RTOS_SetTxTimeout (lpuart_rtos_handle_t *handle, uint32_t tx_timeout_constant_ms, uint32_t tx_timeout_multiplier_ms) |
Set TX timeout in runtime. More... | |
struct lpuart_rtos_config_t |
Data Fields | |
LPUART_Type * | base |
UART base address. | |
uint32_t | srcclk |
UART source clock in Hz. | |
uint32_t | baudrate |
Desired communication speed. | |
lpuart_parity_mode_t | parity |
Parity setting. | |
lpuart_stop_bit_count_t | stopbits |
Number of stop bits to use. | |
uint8_t * | buffer |
Buffer for background reception. | |
uint32_t | buffer_size |
Size of buffer for background reception. | |
uint32_t | rx_timeout_constant_ms |
RX timeout applied per receive. | |
uint32_t | rx_timeout_multiplier_ms |
RX timeout added for each byte of the receive. More... | |
uint32_t | tx_timeout_constant_ms |
TX timeout applied per transmition. | |
uint32_t | tx_timeout_multiplier_ms |
TX timeout added for each byte of the transmition. More... | |
bool | enableRxRTS |
RX RTS enable. | |
bool | enableTxCTS |
TX CTS enable. | |
lpuart_transmit_cts_source_t | txCtsSource |
TX CTS source. | |
lpuart_transmit_cts_config_t | txCtsConfig |
TX CTS configure. | |
uint32_t lpuart_rtos_config_t::rx_timeout_multiplier_ms |
uint32_t lpuart_rtos_config_t::tx_timeout_multiplier_ms |
#define FSL_LPUART_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 6, 0)) |
int LPUART_RTOS_Init | ( | lpuart_rtos_handle_t * | handle, |
lpuart_handle_t * | t_handle, | ||
const lpuart_rtos_config_t * | cfg | ||
) |
handle | The RTOS LPUART handle, the pointer to an allocated space for RTOS context. |
t_handle | The pointer to an allocated space to store the transactional layer internal state. |
cfg | The pointer to the parameters required to configure the LPUART after initialization. |
int LPUART_RTOS_Deinit | ( | lpuart_rtos_handle_t * | handle | ) |
This function deinitializes the LPUART module, sets all register value to the reset value, and releases the resources.
handle | The RTOS LPUART handle. |
int LPUART_RTOS_Send | ( | lpuart_rtos_handle_t * | handle, |
uint8_t * | buffer, | ||
uint32_t | length | ||
) |
This function sends data. It is an synchronous API. If the hardware buffer is full, the task is in the blocked state.
handle | The RTOS LPUART handle. |
buffer | The pointer to buffer to send. |
length | The number of bytes to send. |
int LPUART_RTOS_Receive | ( | lpuart_rtos_handle_t * | handle, |
uint8_t * | buffer, | ||
uint32_t | length, | ||
size_t * | received | ||
) |
This function receives data from LPUART. It is an synchronous API. If any data is immediately available it is returned immediately and the number of bytes received.
handle | The RTOS LPUART handle. |
buffer | The pointer to buffer where to write received data. |
length | The number of bytes to receive. |
received | The pointer to a variable of size_t where the number of received data is filled. |
int LPUART_RTOS_SetRxTimeout | ( | lpuart_rtos_handle_t * | handle, |
uint32_t | rx_timeout_constant_ms, | ||
uint32_t | rx_timeout_multiplier_ms | ||
) |
This function can modify RX timeout between initialization and receive.
param handle The RTOS LPUART handle. param rx_timeout_constant_ms RX timeout applied per receive. param rx_timeout_multiplier_ms RX timeout added for each byte of the receive.
int LPUART_RTOS_SetTxTimeout | ( | lpuart_rtos_handle_t * | handle, |
uint32_t | tx_timeout_constant_ms, | ||
uint32_t | tx_timeout_multiplier_ms | ||
) |
This function can modify TX timeout between initialization and send.
param handle The RTOS LPUART handle. param tx_timeout_constant_ms TX timeout applied per transmition. param tx_timeout_multiplier_ms TX timeout added for each byte of the transmition.