MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Data Structures | |
struct | uart_rtos_config_t |
UART configuration structure. More... | |
UART RTOS Operation | |
int | UART_RTOS_Init (uart_rtos_handle_t *handle, uart_handle_t *t_handle, const uart_rtos_config_t *cfg) |
Initializes a UART instance for operation in RTOS. More... | |
int | UART_RTOS_Deinit (uart_rtos_handle_t *handle) |
Deinitializes a UART instance for operation. More... | |
UART transactional Operation | |
int | UART_RTOS_Send (uart_rtos_handle_t *handle, const uint8_t *buffer, uint32_t length) |
Sends data in the background. More... | |
int | UART_RTOS_Receive (uart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received) |
Receives data. More... | |
struct uart_rtos_config_t |
Data Fields | |
UART_Type * | base |
UART base address. | |
uint32_t | srcclk |
UART source clock in Hz. | |
uint32_t | baudrate |
Desired communication speed. | |
uart_parity_mode_t | parity |
Parity setting. | |
uart_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. | |
int UART_RTOS_Init | ( | uart_rtos_handle_t * | handle, |
uart_handle_t * | t_handle, | ||
const uart_rtos_config_t * | cfg | ||
) |
handle | The RTOS UART handle, the pointer to an allocated space for RTOS context. |
t_handle | The pointer to the allocated space to store the transactional layer internal state. |
cfg | The pointer to the parameters required to configure the UART after initialization. |
int UART_RTOS_Deinit | ( | uart_rtos_handle_t * | handle | ) |
This function deinitializes the UART module, sets all register values to reset value, and frees the resources.
handle | The RTOS UART handle. |
int UART_RTOS_Send | ( | uart_rtos_handle_t * | handle, |
const uint8_t * | buffer, | ||
uint32_t | length | ||
) |
This function sends data. It is a synchronous API. If the hardware buffer is full, the task is in the blocked state.
handle | The RTOS UART handle. |
buffer | The pointer to the buffer to send. |
length | The number of bytes to send. |
int UART_RTOS_Receive | ( | uart_rtos_handle_t * | handle, |
uint8_t * | buffer, | ||
uint32_t | length, | ||
size_t * | received | ||
) |
This function receives data from UART. It is a synchronous API. If data is immediately available, it is returned immediately and the number of bytes received.
handle | The RTOS UART handle. |
buffer | The pointer to the buffer 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. |