8#ifndef __FSL_LPUART_RTOS_H__
9#define __FSL_LPUART_RTOS_H__
11#include "fsl_lpuart.h"
13#include <event_groups.h>
28#define FSL_LPUART_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 6, 0))
46#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT
49 lpuart_transmit_cts_source_t txCtsSource;
50 lpuart_transmit_cts_config_t txCtsConfig;
62#define RTOS_LPUART_TX_COMPLETE 0x1U
64#define RTOS_LPUART_RX_COMPLETE 0x2U
66#define RTOS_LPUART_RING_BUFFER_OVERRUN 0x4U
68#define RTOS_LPUART_HARDWARE_BUFFER_OVERRUN 0x8U
72typedef struct _lpuart_rtos_handle
77 SemaphoreHandle_t rxSemaphore;
78 SemaphoreHandle_t txSemaphore;
79 EventGroupHandle_t rxEvent;
80 EventGroupHandle_t txEvent;
81 uint32_t rx_timeout_constant_ms;
82 uint32_t rx_timeout_multiplier_ms;
83 uint32_t tx_timeout_constant_ms;
84 uint32_t tx_timeout_multiplier_ms;
86#if (configSUPPORT_STATIC_ALLOCATION == 1)
87 StaticSemaphore_t txSemaphoreBuffer;
88 StaticSemaphore_t rxSemaphoreBuffer;
89 StaticEventGroup_t txEventBuffer;
90 StaticEventGroup_t rxEventBuffer;
92} lpuart_rtos_handle_t;
99#if defined(__cplusplus)
168 uint32_t rx_timeout_constant_ms,
169 uint32_t rx_timeout_multiplier_ms);
181 uint32_t tx_timeout_constant_ms,
182 uint32_t tx_timeout_multiplier_ms);
186#if defined(__cplusplus)
enum _lpuart_stop_bit_count lpuart_stop_bit_count_t
LPUART stop bit count.
enum _lpuart_parity_mode lpuart_parity_mode_t
LPUART parity mode.
int LPUART_RTOS_Receive(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received)
Receives data.
int LPUART_RTOS_Deinit(lpuart_rtos_handle_t *handle)
Deinitializes an LPUART instance for operation.
uint32_t tx_timeout_multiplier_ms
Definition: fsl_lpuart_freertos.h:45
int LPUART_RTOS_Send(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length)
Sends data in the background.
uint32_t tx_timeout_constant_ms
Definition: fsl_lpuart_freertos.h:44
uint32_t srcclk
Definition: fsl_lpuart_freertos.h:35
lpuart_stop_bit_count_t stopbits
Definition: fsl_lpuart_freertos.h:38
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.
uint8_t * buffer
Definition: fsl_lpuart_freertos.h:39
struct _lpuart_rtos_config lpuart_rtos_config_t
LPUART RTOS configuration structure.
lpuart_parity_mode_t parity
Definition: fsl_lpuart_freertos.h:37
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.
uint32_t rx_timeout_multiplier_ms
Definition: fsl_lpuart_freertos.h:43
LPUART_Type * base
Definition: fsl_lpuart_freertos.h:34
uint32_t buffer_size
Definition: fsl_lpuart_freertos.h:40
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.
uint32_t baudrate
Definition: fsl_lpuart_freertos.h:36
uint32_t rx_timeout_constant_ms
Definition: fsl_lpuart_freertos.h:42
Definition: MIMXRT1052.h:31147
LPUART handle structure.
Definition: fsl_lpuart.h:289
LPUART RTOS configuration structure.
Definition: fsl_lpuart_freertos.h:33
LPUART transfer structure.
Definition: fsl_lpuart.h:267