summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
author朱天龙 (Armink) <[email protected]>2022-04-04 17:25:04 +0800
committerGitHub <[email protected]>2022-04-04 17:25:04 +0800
commit039efbb075120a1718dfe9b171432744d90e9bf2 (patch)
treec652dd814177f4a6eecada96cc8c5c433865c932 /components/drivers/include
parent78ac851c3188d33201b506f3893562186a65a2f2 (diff)
完善 Serial V2 框架 (#5770)
* [stm32] fix h7 uart V2 driver unused code. * [DeviceDriver][serialv2] fix the serialv2 when using for console device on DMA mode. * [stm32][art-pi] using serial v2 by default * [DeviceDriver][SerialV2] Add termios for serial@V2 . * [BSP][STM32] Add hardware flow control for STM32 serial@V2 driver. * [DeviceDriver][Serial@V2] Add hardware flow control for serial V2.
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/serial_v2.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/components/drivers/include/drivers/serial_v2.h b/components/drivers/include/drivers/serial_v2.h
index e85bdecf51..e0c469423b 100644
--- a/components/drivers/include/drivers/serial_v2.h
+++ b/components/drivers/include/drivers/serial_v2.h
@@ -80,21 +80,25 @@
#define RT_SERIAL_RX_MINBUFSZ 64
#define RT_SERIAL_TX_MINBUFSZ 64
-#define RT_SERIAL_TX_BLOCKING_BUFFER 1
-#define RT_SERIAL_TX_BLOCKING_NO_BUFFER 0
+#define RT_SERIAL_TX_BLOCKING_BUFFER 1
+#define RT_SERIAL_TX_BLOCKING_NO_BUFFER 0
+
+#define RT_SERIAL_FLOWCONTROL_CTSRTS 1
+#define RT_SERIAL_FLOWCONTROL_NONE 0
/* Default config for serial_configure structure */
-#define RT_SERIAL_CONFIG_DEFAULT \
-{ \
- BAUD_RATE_115200, /* 115200 bits/s */ \
- DATA_BITS_8, /* 8 databits */ \
- STOP_BITS_1, /* 1 stopbit */ \
- PARITY_NONE, /* No parity */ \
- BIT_ORDER_LSB, /* LSB first sent */ \
- NRZ_NORMAL, /* Normal mode */ \
- RT_SERIAL_RX_MINBUFSZ, /* rxBuf size */ \
- RT_SERIAL_TX_MINBUFSZ, /* txBuf size */ \
- 0 \
+#define RT_SERIAL_CONFIG_DEFAULT \
+{ \
+ BAUD_RATE_115200, /* 115200 bits/s */ \
+ DATA_BITS_8, /* 8 databits */ \
+ STOP_BITS_1, /* 1 stopbit */ \
+ PARITY_NONE, /* No parity */ \
+ BIT_ORDER_LSB, /* LSB first sent */ \
+ NRZ_NORMAL, /* Normal mode */ \
+ RT_SERIAL_RX_MINBUFSZ, /* rxBuf size */ \
+ RT_SERIAL_TX_MINBUFSZ, /* txBuf size */ \
+ RT_SERIAL_FLOWCONTROL_NONE, /* Off flowcontrol */ \
+ 0 \
}
struct serial_configure
@@ -108,7 +112,8 @@ struct serial_configure
rt_uint32_t invert :1;
rt_uint32_t rx_bufsz :16;
rt_uint32_t tx_bufsz :16;
- rt_uint32_t reserved :6;
+ rt_uint32_t flowcontrol :1;
+ rt_uint32_t reserved :5;
};
/*