summaryrefslogtreecommitdiff
path: root/os/drivers/uart/uart.h
diff options
context:
space:
mode:
authorKonstantin Kirik (snegovick) <snegovick@uprojects.org>2026-01-04 03:47:29 +0300
committerKonstantin Kirik (snegovick) <snegovick@uprojects.org>2026-01-04 03:47:29 +0300
commite4bd4c86db02d68bcfde2278bf6f2abc6dc80b62 (patch)
treea09dc20438ae326c012744205ffd4658aac92960 /os/drivers/uart/uart.h
parent9ac2c83df259804fa3f3c492311ea68a9545eef8 (diff)
Add basic UART/USART driver for stm32f769
* Currently only probably capable of init and output by polling
Diffstat (limited to 'os/drivers/uart/uart.h')
-rw-r--r--os/drivers/uart/uart.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/os/drivers/uart/uart.h b/os/drivers/uart/uart.h
new file mode 100644
index 00000000..afde5315
--- /dev/null
+++ b/os/drivers/uart/uart.h
@@ -0,0 +1,37 @@
+#ifndef __UART_H__
+#define __UART_H__
+
+enum uart_config_parity {
+ UART_CFG_PARITY_NONE, /**< No parity */
+ UART_CFG_PARITY_ODD, /**< Odd parity */
+ UART_CFG_PARITY_EVEN, /**< Even parity */
+ UART_CFG_PARITY_MARK, /**< Mark parity */
+ UART_CFG_PARITY_SPACE, /**< Space parity */
+};
+
+/** @brief Number of stop bits. */
+enum uart_config_stop_bits {
+ UART_CFG_STOP_BITS_0_5, /**< 0.5 stop bit */
+ UART_CFG_STOP_BITS_1, /**< 1 stop bit */
+ UART_CFG_STOP_BITS_1_5, /**< 1.5 stop bits */
+ UART_CFG_STOP_BITS_2, /**< 2 stop bits */
+};
+
+/** @brief Number of data bits. */
+enum uart_config_data_bits {
+ UART_CFG_DATA_BITS_5, /**< 5 data bits */
+ UART_CFG_DATA_BITS_6, /**< 6 data bits */
+ UART_CFG_DATA_BITS_7, /**< 7 data bits */
+ UART_CFG_DATA_BITS_8, /**< 8 data bits */
+ UART_CFG_DATA_BITS_9, /**< 9 data bits */
+};
+
+struct uart_data {
+ struct device *dev;
+ int baudrate;
+ enum uart_config_parity parity;
+ enum uart_config_stop_bits stop_bits;
+ enum uart_config_data_bits data_bits;
+};
+
+#endif/*__UART_H__*/