Skip to content

Commit

Permalink
firmware: drivers: uart: Adding all function declarations #43
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelboing committed Dec 30, 2022
1 parent c58f257 commit 51c421f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
38 changes: 38 additions & 0 deletions firmware/drivers/uart/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
#include <hal/include/libopencm3/stm32/gpio.h>
#include <hal/include/libopencm3/stm32/usart.h>

#include <libs/containers/queue/queue.h>

#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);
Expand Down Expand Up @@ -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;
}
10 changes: 10 additions & 0 deletions firmware/drivers/uart/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 51c421f

Please sign in to comment.