Appiko
hal_uart.h
1 
19 #ifndef CODEBASE_HAL_HAL_UART_H_
20 #define CODEBASE_HAL_HAL_UART_H_
21 
32 #include "stdint.h"
33 #include "stddef.h"
34 
35 #if SYS_CFG_PRESENT == 1
36 #include "sys_config.h"
37 #endif
38 #ifndef HAL_UART_PERIPH_USED
39 #define HAL_UART_PERIPH_USED 0
40 #endif
41 
42 
44 #define UART_USED HAL_UART_PERIPH_USED
45 
47 #define LINE_END '\n'
48 
52 typedef enum {
53  HAL_UART_BAUD_1200 = (0x0004F000UL),
54  HAL_UART_BAUD_2400 = (0x0009D000UL),
55  HAL_UART_BAUD_4800 = (0x0013B000UL),
56  HAL_UART_BAUD_9600 = (0x00275000UL),
57  HAL_UART_BAUD_14400 = (0x003AF000UL),
58  HAL_UART_BAUD_19200 = (0x004EA000UL),
59  HAL_UART_BAUD_28800 = (0x0075C000UL),
60  HAL_UART_BAUD_38400 = (0x009D0000UL),
61  HAL_UART_BAUD_57600 = (0x00EB0000UL),
62  HAL_UART_BAUD_76800 = (0x013A9000UL),
63  HAL_UART_BAUD_115200 = (0x01D60000UL),
64  HAL_UART_BAUD_230400 = (0x03B00000UL),
65  HAL_UART_BAUD_250000 = (0x04000000UL),
66  HAL_UART_BAUD_460800 = (0x07400000UL),
67  HAL_UART_BAUD_921600 = (0x0F000000UL),
68  HAL_UART_BAUD_1M = (0x10000000UL),
70 
78 void hal_uart_init(hal_uart_baud_t baud, void (*handler) (uint8_t * ptr));
79 
85 void hal_uart_putchar(uint8_t cr);
86 
87 #endif /* CODEBASE_HAL_HAL_UART_H_ */
88 
Uart baud rate of 38400.
Definition: hal_uart.h:60
Uart baud rate of 1M.
Definition: hal_uart.h:68
Uart baud rate of 57600.
Definition: hal_uart.h:61
Uart baud rate of 2400.
Definition: hal_uart.h:54
Uart baud rate of 19200.
Definition: hal_uart.h:58
Uart baud rate of 9600.
Definition: hal_uart.h:56
Uart baud rate of 14400.
Definition: hal_uart.h:57
void hal_uart_init(hal_uart_baud_t baud, void(*handler)(uint8_t *ptr))
Definition: hal_uart.c:145
Uart baud rate of 460800.
Definition: hal_uart.h:66
Uart baud rate of 4800.
Definition: hal_uart.h:55
Uart baud rate of 230400.
Definition: hal_uart.h:64
Uart baud rate of 115200.
Definition: hal_uart.h:63
Uart baud rate of 1200.
Definition: hal_uart.h:53
Uart baud rate of 921600.
Definition: hal_uart.h:67
void hal_uart_putchar(uint8_t cr)
Send a single character through UART This function is used by printf_callback so that printf can be u...
Definition: hal_uart.c:115
hal_uart_baud_t
Definition: hal_uart.h:52
Uart baud rate of 28800.
Definition: hal_uart.h:59
Uart baud rate of 250000.
Definition: hal_uart.h:65
Uart baud rate of 76800.
Definition: hal_uart.h:62