hal
Hardware Abstraction Layer
uart.h
Go to the documentation of this file.
1 
8 #ifndef _UART_H
9 #define _UART_H
10 
11 #include "hal_types.h"
12 
16 typedef enum {
19 } hal_uart_t;
20 
28 int __io_putchar(int ch);
29 
39 
53 
69 hal_status_t hal_uart_read(hal_uart_t uart, uint8_t *data, size_t len, size_t *bytes_read);
70 
81 hal_status_t hal_uart_write(hal_uart_t uart, const uint8_t *data, size_t len, size_t *bytes_written);
82 
83 #endif /* _UART_H */
Common types used across HAL modules.
hal_status_t
Return type for HAL functions.
Definition: hal_types.h:17
hal_uart_t
Defines the two available UART channels.
Definition: uart.h:16
@ HAL_UART2
Definition: uart.h:18
@ HAL_UART1
Definition: uart.h:17
hal_status_t hal_uart_read(hal_uart_t uart, uint8_t *data, size_t len, size_t *bytes_read)
Read an incoming byte stream.
Definition: stm32f4_uart.c:55
hal_status_t hal_uart_deinit(hal_uart_t uart)
Deinitialize the UART channel associated with the parameter uart.
Definition: stm32f4_uart.c:39
hal_status_t hal_uart_write(hal_uart_t uart, const uint8_t *data, size_t len, size_t *bytes_written)
Write an outgoing byte stream.
Definition: stm32f4_uart.c:71
int __io_putchar(int ch)
syscall declaration for putchar so that printf may be used.
Definition: stm32f4_uart.c:12
hal_status_t hal_uart_init(hal_uart_t uart)
Initialize the UART channel associated with the parameter uart. Must be called prior to using the cha...
Definition: stm32f4_uart.c:23