@@ -48,6 +48,14 @@ extern "C" {
48
48
#define SERIAL_7O2 0x800003b
49
49
#define SERIAL_8O2 0x800003f
50
50
51
+ // These are Hardware Flow Contol possible usage
52
+ // equivalent to UDF enum uart_hw_flowcontrol_t from
53
+ // https://github.com/espressif/esp-idf/blob/master/components/hal/include/hal/uart_types.h#L75-L81
54
+ #define HW_FLOWCTRL_DISABLE 0x0 // disable HW Flow Control
55
+ #define HW_FLOWCTRL_RTS 0x1 // use only RTS PIN for HW Flow Control
56
+ #define HW_FLOWCTRL_CTS 0x2 // use only CTS PIN for HW Flow Control
57
+ #define HW_FLOWCTRL_CTS_RTS 0x3 // use both CTS and RTS PIN for HW Flow Control
58
+
51
59
struct uart_struct_t ;
52
60
typedef struct uart_struct_t uart_t ;
53
61
@@ -76,7 +84,12 @@ void uartSetDebug(uart_t* uart);
76
84
int uartGetDebug ();
77
85
78
86
bool uartIsDriverInstalled (uart_t * uart );
79
- void uartSetPins (uart_t * uart , uint8_t rxPin , uint8_t txPin );
87
+
88
+ // Negative Pin Number will keep it unmodified, thus this function can set individual pins
89
+ void uartSetPins (uart_t * uart , int8_t rxPin , int8_t txPin , int8_t ctsPin , int8_t rtsPin );
90
+
91
+ // Enables or disables HW Flow Control function -- needs also to set CTS and/or RTS pins
92
+ void uartSetHwFlowCtrlMode (uart_t * uart , uint8_t mode , uint8_t threshold );
80
93
81
94
void uartStartDetectBaudrate (uart_t * uart );
82
95
unsigned long uartDetectBaudrate (uart_t * uart );
0 commit comments