8000 stm32/uart: Add RTS/CTS pin configuration support to UART4. · andrewleech/micropython@89f6c71 · GitHub
[go: up one dir, main page]

Skip to content

Commit 89f6c71

Browse files
committed
stm32/uart: Add RTS/CTS pin configuration support to UART4.
1 parent c9b3f08 commit 89f6c71

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ports/stm32/uart.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,16 @@ bool uart_init(pyb_uart_obj_t *uart_obj,
249249
#endif
250250
pins[0] = MICROPY_HW_UART4_TX;
251251
pins[1] = MICROPY_HW_UART4_RX;
252+
#if defined(MICROPY_HW_UART4_RTS)
253+
if (flow & UART_HWCONTROL_RTS) {
254+
pins[2] = MICROPY_HW_UART4_RTS;
255+
}
256+
#endif
257+
#if defined(MICROPY_HW_UART4_CTS)
258+
if (flow & UART_HWCONTROL_CTS) {
259+
pins[3] = MICROPY_HW_UART4_CTS;
260+
}
261+
#endif
252262
break;
253263
#endif
254264

0 commit comments

Comments
 (0)
0