From 51c421ffc7f89f75613cb2606de6e58178ba1d44 Mon Sep 17 00:00:00 2001 From: miguelboing Date: Fri, 30 Dec 2022 19:19:35 -0300 Subject: [PATCH] firmware: drivers: uart: Adding all function declarations #43 --- firmware/drivers/uart/uart.c | 38 ++++++++++++++++++++++++++++++++++++ firmware/drivers/uart/uart.h | 10 ++++++++++ 2 files changed, 48 insertions(+) diff --git a/firmware/drivers/uart/uart.c b/firmware/drivers/uart/uart.c index e1df389..c3cce90 100644 --- a/firmware/drivers/uart/uart.c +++ b/firmware/drivers/uart/uart.c @@ -2,8 +2,16 @@ #include #include +#include + #include "uart.h" +static queue_t uart_port_1_rx_buffer; +static queue_t uart_port_2_rx_buffer; +static queue_t uart_port_3_rx_buffer; +static queue_t uart_port_4_rx_buffer; +static queue_t uart_port_5_rx_buffer; + static inline int uart_send_byte(uart_config_t uart_config, char c); static inline int uart_read_byte(uart_config_t uart_config, char c); @@ -159,3 +167,33 @@ static inline int uart_read_byte(uart_config_t uart_config, uint16_t* c) return 0; } +int uart_write(uart_config_t uart_config, uint8_t* data, uint16_t len) +{ + return -1; +} + +int uart_read(uart_config_t uart_config, uint8_t* data, uint16_t len) +{ + return -1; +} + +int uart_rx_enable(uart_config_t uart_config) +{ + return -1; +} + + +int uart_rx_disable(uart_config_t uart_config) +{ + return -1; +} + +int uart_read_available(uart_config_t uart_config, uint16_t n_recv_bytes) +{ + return -1; +} + +int uart_flush(uart_config_t uart_config) +{ + return -1; +} diff --git a/firmware/drivers/uart/uart.h b/firmware/drivers/uart/uart.h index 21c81be..928de8a 100644 --- a/firmware/drivers/uart/uart.h +++ b/firmware/drivers/uart/uart.h @@ -83,5 +83,15 @@ typedef struct int uart_init(uart_config_t config); +int uart_write(uart_config_t uart_config, uint8_t* data, uint16_t len); +int uart_read(uart_config_t uart_config, uint8_t* data, uint16_t len); + +int uart_rx_enable(uart_config_t uart_config); + +int uart_rx_disable(uart_config_t uart_config); + +int uart_read_available(uart_config_t uart_config, uint16_t n_recv_bytes); + +int uart_flush(uart_config_t uart_config); #endif /* UART_H */