27 #if (defined YOTTA_CFG_HARDWARE_UART) && (YOTTA_CFG_HARDWARE_UART_COUNT > 0) 50 #define K_NUM_UARTS YOTTA_CFG_HARDWARE_UART_COUNT 65 #ifndef K_UART_CONSOLE 66 #define K_UART_CONSOLE YOTTA_CFG_HARDWARE_CONSOLE_UART 81 #ifndef K_UART_CONSOLE_BAUDRATE 82 #define K_UART_CONSOLE_BAUDRATE YOTTA_CFG_HARDWARE_CONSOLE_BAUDRATE 89 #ifdef YOTTA_CFG_HARDWARE_UART_UART1 92 #ifdef YOTTA_CFG_HARDWARE_UART_UART2 95 #ifdef YOTTA_CFG_HARDWARE_UART_UART3 98 #ifdef YOTTA_CFG_HARDWARE_UART_UART4 101 #ifdef YOTTA_CFG_HARDWARE_UART_UART5 104 #ifdef YOTTA_CFG_HARDWARE_UART_UART6 228 #ifdef YOTTA_CFG_HARDWARE_UART_UART1_RX 229 case K_UART1:
return YOTTA_CFG_HARDWARE_UART_UART1_RX;
231 #ifdef YOTTA_CFG_HARDWARE_UART_UART2_RX 232 case K_UART2:
return YOTTA_CFG_HARDWARE_UART_UART2_RX;
234 #ifdef YOTTA_CFG_HARDWARE_UART_UART3_RX 235 case K_UART3:
return YOTTA_CFG_HARDWARE_UART_UART3_RX;
237 #ifdef YOTTA_CFG_HARDWARE_UART_UART4_RX 238 case K_UART4:
return YOTTA_CFG_HARDWARE_UART_UART4_RX;
240 #ifdef YOTTA_CFG_HARDWARE_UART_UART5_RX 241 case K_UART5:
return YOTTA_CFG_HARDWARE_UART_UART5_RX;
243 #ifdef YOTTA_CFG_HARDWARE_UART_UART6_RX 244 case K_UART6:
return YOTTA_CFG_HARDWARE_UART_UART6_RX;
257 #ifdef YOTTA_CFG_HARDWARE_UART_UART1_TX 258 case K_UART1:
return YOTTA_CFG_HARDWARE_UART_UART1_TX;
260 #ifdef YOTTA_CFG_HARDWARE_UART_UART2_TX 261 case K_UART2:
return YOTTA_CFG_HARDWARE_UART_UART2_TX;
263 #ifdef YOTTA_CFG_HARDWARE_UART_UART3_TX 264 case K_UART3:
return YOTTA_CFG_HARDWARE_UART_UART3_TX;
266 #ifdef YOTTA_CFG_HARDWARE_UART_UART4_TX 267 case K_UART4:
return YOTTA_CFG_HARDWARE_UART_UART4_TX;
269 #ifdef YOTTA_CFG_HARDWARE_UART_UART5_TX 270 case K_UART5:
return YOTTA_CFG_HARDWARE_UART_UART5_TX;
272 #ifdef YOTTA_CFG_HARDWARE_UART_UART6_TX 273 case K_UART6:
return YOTTA_CFG_HARDWARE_UART_UART6_TX;
298 #endif // #ifndef K_UART_H 299 #endif // #ifdef YOTTA_CFG_HARDWARE_UART && YOTTA_CFG_HARDE_UART_COUNT > 0 KStopBits
Number of stop bits.
Definition: uart.h:121
int dev
Definition: uart.h:152
KUART * kprv_uart_get(KUARTNum uart)
Returns uart data structure for specified interface.
KStopBits stop_bits
Definition: uart.h:142
void kprv_uart_enable_tx_int(KUARTNum uart)
Enables uart transmit interrupt.
KParity
Parity setting.
Definition: uart.h:129
Uart configuration structure.
Definition: uart.h:138
int k_uart_write(KUARTNum uart, char *ptr, int len)
Interrupt driven function for writing data to a uart interface.
void k_uart_console_init(void)
Setup and enable console uart interface.
void kprv_uart_dev_init(KUARTNum uart)
Performs low level uart hardware initialization.
KUARTNum
Available uart interfaces.
Definition: uart.h:88
KUARTConf conf
Definition: uart.h:153
uint8_t tx_queue_len
Definition: uart.h:145
QueueHandle_t rx_queue
Definition: uart.h:154
KWordLen
Word length.
Definition: uart.h:112
uint8_t rx_queue_len
Definition: uart.h:144
int k_uart_read(KUARTNum uart, char *ptr, int len)
Interrupt driven function for reading data from a uart interface.
int k_uart_rx_queue_len(KUARTNum uart)
Returns the number of characters currently in the uart rx queue.
int k_uart_rx_pin(KUARTNum uart)
Returns rx pin for specified uart interface.
Definition: uart.h:226
QueueHandle_t tx_queue
Definition: uart.h:155
void k_uart_init(KUARTNum uart, KUARTConf *conf)
Setup and enable uart interface.
KParity parity
Definition: uart.h:143
uint32_t baud_rate
Definition: uart.h:140
KWordLen word_len
Definition: uart.h:141
KUARTConf k_uart_conf_defaults(void)
Generate KUARTConf with default uart values.
const char * dev_path
Definition: uart.h:139
void k_uart_write_immediate(KUARTNum uart, char c)
Write data directly to a uart interface.
Uart interface data structure.
Definition: uart.h:151
void k_uart_rx_queue_push(KUARTNum uart, char c, void *task_woken)
Pushes a character into the uart rx queue.
int k_uart_tx_pin(KUARTNum uart)
Returns tx pin for specified uart interface.
Definition: uart.h:255