29#if (HAL_USE_UART == TRUE) || defined(__DOXYGEN__)
51#if !defined(KINETIS_UART_USE_UART1) || defined(__DOXYGEN__)
52#define KINETIS_UART_USE_UART1 FALSE
55#if !defined(KINETIS_UART_USE_UART2) || defined(__DOXYGEN__)
56#define KINETIS_UART_USE_UART2 FALSE
59#if !defined(KINETIS_UART_USE_UART3) || defined(__DOXYGEN__)
60#define KINETIS_UART_USE_UART3 FALSE
68#define UART_USE_BLOCKING_SEND TRUE
73#define USART_CR1_PS (1U << 9)
74#define USART_CR1_PCE (1U << 10)
75#define USART_CR2_STOP1_BITS (0 << 12)
76#define USART_CR2_STOP2_BITS (2 << 12)
199#if (UART_USE_WAIT == TRUE) || defined(__DOXYGEN__)
213#if (UART_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__)
219#if defined(UART_DRIVER_EXT_FIELDS)
220 UART_DRIVER_EXT_FIELDS
248#ifdef UART_USE_RING_BUFFER
261#if (KINETIS_UART_USE_UART1 == TRUE) && !defined(__DOXYGEN__)
264#if (KINETIS_UART_USE_UART2 == TRUE) && !defined(__DOXYGEN__)
267#if (KINETIS_UART_USE_UART3 == TRUE) && !defined(__DOXYGEN__)
void(* uartecb_t)(UARTDriver *uartp, uartflags_t e)
Receive error UART notification callback type.
void uart_lld_start_send(UARTDriver *uartp, size_t n, const void *txbuf)
Starts a transmission on the UART peripheral.
void uart_lld_blocking_send(UARTDriver *uartp, size_t n, const void *txbuf)
void uart_lld_start(UARTDriver *uartp)
Configures and activates the UART peripheral.
void(* uartcb_t)(UARTDriver *uartp)
Generic UART notification callback type.
void(* uartccb_t)(UARTDriver *uartp, uint16_t c)
Character received UART notification callback type.
UARTDriver UARTD1
UART1 driver identifier.
void uart_lld_init(void)
Low level UART driver initialization.
uint32_t uartflags_t
UART driver condition flags type.
size_t uart_lld_stop_send(UARTDriver *uartp)
Stops any ongoing transmission.
void uart_lld_start_receive(UARTDriver *uartp, size_t n, void *rxbuf)
Starts a receive operation on the UART peripheral.
size_t uart_lld_stop_receive(UARTDriver *uartp)
Stops any ongoing receive operation.
void uart_lld_stop(UARTDriver *uartp)
Deactivates the UART peripheral.
void(* uarthcb_t)(UARTDriver *uartp, uartflags_t full)
Receive Half-transfer UART notification callback type.
eDMA transfer handle structure
Driver configuration structure.
uartcb_t timeout_cb
Receiver timeout (idle) callback.
uartecb_t rxerr_cb
Receive error callback.
uartcb_t txend2_cb
Physical end of transmission callback.
uarthcb_t rxhalf_cb
Half-transfer receive buffer callback.
uint16_t cr3
Initialization value for the CR3 register.
uint16_t cr1
Initialization value for the CR1 register.
uartccb_t rxchar_cb
Character received while out if the UART_RECEIVE state.
uartcb_t txend1_cb
End of transmission buffer callback.
uartcb_t rxend_cb
Receive buffer filled callback.
uint16_t cr2
Initialization value for the CR2 register.
Structure representing an UART driver.
lpuart_edma_handle_t dmaHandle
LPUART common eDMA channel handle.
edma_handle_t lpuartRxEdmaHandle
eDMA transfer handles.
uartrxstate_t rxstate
Receiver state.
int pendingRxIrq
Used to trigger the IRQ from our software handler. See uart_lld_callback() and UART_USE_RING_BUFFER.
mutex_t mutex
Mutex protecting the peripheral.
lpuart_handle_t rxHandle
Used for the RingBuffer mode or to handle UART errors in EDMA mode.
thread_reference_t threadrx
Waiting thread on RX.
bool early
Synchronization flag for transmit operations.
const UARTConfig * config
Current configuration data.
uartstate_t state
Driver state.
UART_DRIVER_EXT_FIELDS LPUART_Type * lpuart
Pointer to the USART registers block.
uint8_t rxRingBuffer[KINETIS_UART_RX_RING_BUFFER_SIZE]
uarttxstate_t txstate
Transmitter state.
edma_handle_t lpuartTxEdmaHandle
thread_reference_t threadtx
Waiting thread on TX.