28 #ifndef MCU_PERIPH_UART_H
29 #define MCU_PERIPH_UART_H
31 #include "mcu_periph/uart_arch.h"
32 #include "pprzlink/pprzlink_device.h"
35 #ifndef UART_RX_BUFFER_SIZE
38 #define UART_RX_BUFFER_SIZE 128
40 #define UART_RX_BUFFER_SIZE 256
44 #ifndef UART_TX_BUFFER_SIZE
47 #define UART_TX_BUFFER_SIZE 128
49 #define UART_TX_BUFFER_SIZE 256
53 #define UART_DEV_NAME_SIZE 16
67 #define UPARITY_EVEN 2
120 extern void uart0_init(
void);
125 extern void uart1_init(
void);
130 extern void uart2_init(
void);
135 extern void uart3_init(
void);
140 extern void uart4_init(
void);
145 extern void uart5_init(
void);
150 extern void uart6_init(
void);
155 extern void uart7_init(
void);
160 extern void uart8_init(
void);
#define UART_TX_BUFFER_SIZE
void uart_send_message(struct uart_periph *p, long fd)
void uart_periph_set_bits_stop_parity(struct uart_periph *p, uint8_t bits, uint8_t stop, uint8_t parity)
void * init_struct
User init struct.
#define UART_DEV_NAME_SIZE
void uart_periph_set_mode(struct uart_periph *p, bool tx_enabled, bool rx_enabled, bool hw_flow_control)
void uart_periph_set_baudrate(struct uart_periph *p, uint32_t baud)
void uart_periph_init(struct uart_periph *p)
void uart_put_byte(struct uart_periph *p, long fd, uint8_t data)
void uart_periph_invert_data_logic(struct uart_periph *p, bool invert_rx, bool invert_tx)
volatile uint8_t tx_running
#define UART_RX_BUFFER_SIZE
char dev[UART_DEV_NAME_SIZE]
UART Dev (linux)
int uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
void uart_arch_init(void)
int uart_check_free_space(struct uart_periph *p, long *fd, uint16_t len)
struct link_device device
Generic device interface.
uint8_t tx_buf[UART_TX_BUFFER_SIZE]
Transmit buffer.
volatile uint16_t ne_err
noise error counter
uint8_t rx_buf[UART_RX_BUFFER_SIZE]
Receive buffer.
void uart_put_buffer(struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
volatile uint16_t fe_err
framing error counter
uint8_t uart_getch(struct uart_periph *p)
int baudrate
UART Baudrate.
void * reg_addr
UART Register.
volatile uint16_t ore
overrun error counter
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.