UART

Functions

USART_TypeDef * uart_dev (KUARTNum uart)
 Internal function to get appropriate USART_TypeDef based on uart num. More...
 
IRQn_Type uart_irqn (KUARTNum uart)
 Internal function to get appropriate interrupt number based on uart num. More...
 
static void uart_clk_enable (KUARTNum uart)
 Internal function to enable the correct uart clock based on uart num. More...
 
static void uart_clk_disable (KUARTNum uart)
 Internal function to disable the correct uart clock based on uart num. More...
 
static uint8_t uart_alt (KUARTNum uart)
 Internal function to fetch the alternate uart pin based on uart num. More...
 
KUARTStatus kprv_uart_dev_init (KUARTNum uart)
 Setup and enable uart bus. More...
 
void kprv_uart_dev_terminate (KUARTNum uart)
 uart hardware cleanup and disabling More...
 
void kprv_uart_enable_tx_int (KUARTNum uart)
 Enable uart tx interrupt. More...
 
KUARTStatus k_uart_write_immediate (KUARTNum uart, char c)
 Write a character directly to the uart interface. More...
 
static void uart_irq_handler (KUARTNum uart)
 Internal function to process triggered interrupt. More...
 
void USART1_IRQHandler (void)
 Specify interrupt routine for uart1. More...
 
void USART2_IRQHandler (void)
 Specify interrupt routine for uart2. More...
 
void USART3_IRQHandler (void)
 Specify interrupt routine for uart3. More...
 
void UART4_IRQHandler (void)
 Specify interrupt routine for uart4. More...
 
void UART5_IRQHandler (void)
 Specify interrupt routine for uart5. More...
 
void USART6_IRQHandler (void)
 Specify interrupt routine for uart6. More...
 

Function Documentation

KUARTStatus k_uart_write_immediate ( KUARTNum  uart,
char  c 
)

Write a character directly to the uart interface.

Parameters
uartuart bus
ccharacter to write
Returns
KUARTStatus UART_OK if success, otherwise failure
KUARTStatus kprv_uart_dev_init ( KUARTNum  uart)

Setup and enable uart bus.

Parameters
uartuart bus to initialize
Returns
KUARTStatus UART_OK if success, otherwise failure
void kprv_uart_dev_terminate ( KUARTNum  uart)

uart hardware cleanup and disabling

Parameters
uartbus num to terminate
void kprv_uart_enable_tx_int ( KUARTNum  uart)

Enable uart tx interrupt.

Parameters
uartuart bus to initialize
void UART4_IRQHandler ( void  )

Specify interrupt routine for uart4.

void UART5_IRQHandler ( void  )

Specify interrupt routine for uart5.

static uint8_t uart_alt ( KUARTNum  uart)
inlinestatic

Internal function to fetch the alternate uart pin based on uart num.

Parameters
uartuart bus num
Returns
GPIO pin
static void uart_clk_disable ( KUARTNum  uart)
inlinestatic

Internal function to disable the correct uart clock based on uart num.

Parameters
uartuart bus num
static void uart_clk_enable ( KUARTNum  uart)
inlinestatic

Internal function to enable the correct uart clock based on uart num.

Parameters
uartuart bus num
USART_TypeDef* uart_dev ( KUARTNum  uart)

Internal function to get appropriate USART_TypeDef based on uart num.

Parameters
uartuart bus num
Returns
USART_TypeDef
static void uart_irq_handler ( KUARTNum  uart)
inlinestatic

Internal function to process triggered interrupt.

Parameters
uartuart bus num
IRQn_Type uart_irqn ( KUARTNum  uart)

Internal function to get appropriate interrupt number based on uart num.

Parameters
uartuart bus num
Returns
IRQn_Type interrupt number
void USART1_IRQHandler ( void  )

Specify interrupt routine for uart1.

void USART2_IRQHandler ( void  )

Specify interrupt routine for uart2.

void USART3_IRQHandler ( void  )

Specify interrupt routine for uart3.

void USART6_IRQHandler ( void  )

Specify interrupt routine for uart6.