2018-07-30 09:54:44 +02:00
|
|
|
#ifndef __USART_H
|
|
|
|
#define __USART_H
|
|
|
|
|
2019-08-08 16:57:33 +02:00
|
|
|
#include "common.h"
|
|
|
|
#include "usart_defs.h"
|
2019-04-14 11:08:44 +02:00
|
|
|
|
2019-06-12 14:59:00 -07:00
|
|
|
// Higher baudrates are pointless, only increasing overflow risk
|
2019-05-18 21:40:45 +02:00
|
|
|
|
2020-05-19 17:05:43 +02:00
|
|
|
extern uint32_t g_usart_baudrate;
|
|
|
|
extern uint8_t g_usart_parity;
|
2019-04-20 19:17:32 +02:00
|
|
|
|
2019-05-15 02:15:19 +02:00
|
|
|
void usart_init(uint32_t baudrate, uint8_t parity);
|
2019-04-22 22:58:45 +02:00
|
|
|
int usart_writebuffer_sync(uint8_t *data, size_t len);
|
2019-04-20 01:47:50 +02:00
|
|
|
uint32_t usart_read_ng(uint8_t *data, size_t len);
|
2019-04-20 19:17:32 +02:00
|
|
|
uint16_t usart_rxdata_available(void);
|
2019-04-14 11:08:44 +02:00
|
|
|
|
2018-07-30 09:54:44 +02:00
|
|
|
#endif
|