uart.h File Reference

Go to the source code of this file.

Data Structures

struct  KUARTConf
 Uart configuration structure. More...
 
struct  KUART
 Uart interface data structure. More...
 

Enumerations

enum  KUARTNum {
  K_UART1 = 0, K_UART2, K_UART3, K_UART4,
  K_UART5, K_UART6
}
 Available uart interfaces. More...
 
enum  KWordLen { K_WORD_LEN_7BIT = 0, K_WORD_LEN_8BIT, K_WORD_LEN_9BIT }
 Word length. More...
 
enum  KStopBits { K_STOP_BITS_1 = 0, K_STOP_BITS_2 }
 Number of stop bits. More...
 
enum  KParity { K_PARITY_NONE = 0, K_PARITY_EVEN, K_PARITY_ODD }
 Parity setting. More...
 

Functions

KUARTConf k_uart_conf_defaults (void)
 Generate KUARTConf with default uart values. More...
 
void k_uart_init (KUARTNum uart, KUARTConf *conf)
 Setup and enable uart interface. More...
 
void k_uart_console_init (void)
 Setup and enable console uart interface. More...
 
int k_uart_read (KUARTNum uart, char *ptr, int len)
 Interrupt driven function for reading data from a uart interface. More...
 
int k_uart_write (KUARTNum uart, char *ptr, int len)
 Interrupt driven function for writing data to a uart interface. More...
 
void k_uart_write_immediate (KUARTNum uart, char c)
 Write data directly to a uart interface. More...
 
int k_uart_rx_queue_len (KUARTNum uart)
 Returns the number of characters currently in the uart rx queue. More...
 
void k_uart_rx_queue_push (KUARTNum uart, char c, void *task_woken)
 Pushes a character into the uart rx queue. More...
 
int k_uart_rx_pin (KUARTNum uart)
 Returns rx pin for specified uart interface. More...
 
int k_uart_tx_pin (KUARTNum uart)
 Returns tx pin for specified uart interface. More...
 
KUARTkprv_uart_get (KUARTNum uart)
 Returns uart data structure for specified interface. More...
 
void kprv_uart_dev_init (KUARTNum uart)
 Performs low level uart hardware initialization. More...
 
void kprv_uart_enable_tx_int (KUARTNum uart)
 Enables uart transmit interrupt. More...