RTEMS 6.1-rc5
Loading...
Searching...
No Matches
Data Structures | Variables
Lpuart_freertos_driver

Data Structures

struct  _lpuart_rtos_config
 LPUART RTOS configuration structure. More...
 

Variables

LPUART_Type_lpuart_rtos_config::base
 
uint32_t _lpuart_rtos_config::srcclk
 
uint32_t _lpuart_rtos_config::baudrate
 
lpuart_parity_mode_t _lpuart_rtos_config::parity
 
lpuart_stop_bit_count_t _lpuart_rtos_config::stopbits
 
uint8_t * _lpuart_rtos_config::buffer
 
uint32_t _lpuart_rtos_config::buffer_size
 
uint32_t _lpuart_rtos_config::rx_timeout_constant_ms
 
uint32_t _lpuart_rtos_config::rx_timeout_multiplier_ms
 
uint32_t _lpuart_rtos_config::tx_timeout_constant_ms
 
uint32_t _lpuart_rtos_config::tx_timeout_multiplier_ms
 

Driver version

typedef struct _lpuart_rtos_config lpuart_rtos_config_t
 LPUART RTOS configuration structure.
 
#define FSL_LPUART_FREERTOS_DRIVER_VERSION   (MAKE_VERSION(2, 6, 0))
 LPUART FreeRTOS driver version.
 

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.
 
int LPUART_RTOS_Deinit (lpuart_rtos_handle_t *handle)
 Deinitializes an LPUART instance for operation.
 

LPUART transactional Operation

int LPUART_RTOS_Send (lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length)
 Sends data in the background.
 
int LPUART_RTOS_Receive (lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received)
 Receives data.
 
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.
 
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.
 

Detailed Description

Function Documentation

◆ LPUART_RTOS_Deinit()

int LPUART_RTOS_Deinit ( lpuart_rtos_handle_t *  handle)

Deinitializes an LPUART instance for operation.

This function deinitializes the LPUART module, sets all register value to the reset value, and releases the resources.

Parameters
handleThe RTOS LPUART handle.

◆ LPUART_RTOS_Init()

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.

Parameters
handleThe RTOS LPUART handle, the pointer to an allocated space for RTOS context.
t_handleThe pointer to an allocated space to store the transactional layer internal state.
cfgThe pointer to the parameters required to configure the LPUART after initialization.
Returns
0 succeed, others failed

◆ LPUART_RTOS_Receive()

int LPUART_RTOS_Receive ( lpuart_rtos_handle_t *  handle,
uint8_t *  buffer,
uint32_t  length,
size_t *  received 
)

Receives data.

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.

Parameters
handleThe RTOS LPUART handle.
bufferThe pointer to buffer where to write received data.
lengthThe number of bytes to receive.
receivedThe pointer to a variable of size_t where the number of received data is filled.

◆ LPUART_RTOS_Send()

int LPUART_RTOS_Send ( lpuart_rtos_handle_t *  handle,
uint8_t *  buffer,
uint32_t  length 
)

Sends data in the background.

This function sends data. It is an synchronous API. If the hardware buffer is full, the task is in the blocked state.

Parameters
handleThe RTOS LPUART handle.
bufferThe pointer to buffer to send.
lengthThe number of bytes to send.

◆ LPUART_RTOS_SetRxTimeout()

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.

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.

◆ LPUART_RTOS_SetTxTimeout()

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.

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.

Variable Documentation

◆ base

LPUART_Type* _lpuart_rtos_config::base

UART base address

◆ baudrate

uint32_t _lpuart_rtos_config::baudrate

Desired communication speed

◆ buffer

uint8_t* _lpuart_rtos_config::buffer

Buffer for background reception

◆ buffer_size

uint32_t _lpuart_rtos_config::buffer_size

Size of buffer for background reception

◆ parity

lpuart_parity_mode_t _lpuart_rtos_config::parity

Parity setting

◆ rx_timeout_constant_ms

uint32_t _lpuart_rtos_config::rx_timeout_constant_ms

RX timeout applied per receive

◆ rx_timeout_multiplier_ms

uint32_t _lpuart_rtos_config::rx_timeout_multiplier_ms

RX timeout added for each byte of the receive.

◆ srcclk

uint32_t _lpuart_rtos_config::srcclk

UART source clock in Hz

◆ stopbits

lpuart_stop_bit_count_t _lpuart_rtos_config::stopbits

Number of stop bits to use

◆ tx_timeout_constant_ms

uint32_t _lpuart_rtos_config::tx_timeout_constant_ms

TX timeout applied per transmition

◆ tx_timeout_multiplier_ms

uint32_t _lpuart_rtos_config::tx_timeout_multiplier_ms

TX timeout added for each byte of the transmition.