File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,15 @@ static int uart_numaker_init(const struct device *dev)
231
231
232
232
UART_Open (config -> uart , pData -> ucfg .baudrate );
233
233
234
+ if (pData -> ucfg .flow_ctrl == UART_CFG_FLOW_CTRL_NONE ) {
235
+ UART_DisableFlowCtrl (config -> uart );
236
+ } else if (pData -> ucfg .flow_ctrl == UART_CFG_FLOW_CTRL_RTS_CTS ) {
237
+ UART_EnableFlowCtrl (config -> uart );
238
+ } else {
239
+ LOG_ERR ("H/W flow control (%d) not support" , pData -> ucfg .flow_ctrl );
240
+ return - ENOTSUP ;
241
+ }
242
+
234
243
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
235
244
config -> irq_config_func (dev );
236
245
#endif
@@ -439,6 +448,9 @@ static DEVICE_API(uart, uart_numaker_driver_api) = {
439
448
.ucfg = \
440
449
{ \
441
450
.baudrate = DT_INST_PROP(inst, current_speed), \
451
+ .flow_ctrl = COND_CODE_1(DT_INST_PROP_OR(inst, hw_flow_control, 0),\
452
+ (UART_CFG_FLOW_CTRL_RTS_CTS), \
453
+ (UART_CFG_FLOW_CTRL_NONE)), \
442
454
}, \
443
455
}; \
444
456
\
You can’t perform that action at this time.
0 commit comments