7eb925eda2ee5591b3f8f2fecc4731d6df397ae3
[osmocom-bb.git] / src / target / firmware / include / calypso / uart.h
1 #ifndef _CAL_UART_H
2 #define _CAL_UART_H
3
4 #include <stdint.h>
5
6 enum uart_baudrate {
7         UART_38400,
8         UART_57600,
9         UART_115200,
10         UART_230400,
11         UART_460800,
12         UART_614400,
13         UART_921600,
14 };
15
16 void uart_init(uint8_t uart, uint8_t interrupts);
17 void uart_putchar_wait(uint8_t uart, int c);
18 int uart_putchar_nb(uint8_t uart, int c);
19 int uart_getchar_nb(uint8_t uart, uint8_t *ch);
20 int uart_tx_busy(uint8_t uart);
21 int uart_baudrate(uint8_t uart, enum uart_baudrate bdrt);
22
23 enum uart_irq {
24         UART_IRQ_TX_EMPTY,
25         UART_IRQ_RX_CHAR,
26 };
27
28 void uart_irq_enable(uint8_t uart, enum uart_irq irq, int on);
29
30 void uart_poll(uint8_t uart);
31
32 #endif /* _CAL_UART_H */