summaryrefslogtreecommitdiffstatshomepage
path: root/stm/usart.h
blob: 541cb757c8cab654b13359e17e05d1d3f87ca086 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
typedef enum {
    PYB_USART_NONE = 0,
    PYB_USART_1 = 1,
    PYB_USART_2 = 2,
    PYB_USART_3 = 3,
    PYB_USART_6 = 4,
    PYB_USART_MAX = 4,
} pyb_usart_t;

extern pyb_usart_t pyb_usart_global_debug;

void usart_init(pyb_usart_t usart_id, uint32_t baudrate);
bool usart_rx_any(pyb_usart_t usart_id);
int usart_rx_char(pyb_usart_t usart_id);
void usart_tx_str(pyb_usart_t usart_id, const char *str);
void usart_tx_strn_cooked(pyb_usart_t usart_id, const char *str, int len);

mp_obj_t pyb_Usart(mp_obj_t usart_id, mp_obj_t baudrate);