File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -568,6 +568,16 @@ static void update_flash_config(const esp_image_header_t* pfhdr);
568
568
569
569
static void uart_console_configure (void )
570
570
{
571
+ #if CONFIG_CONSOLE_UART_SWAP_IO
572
+ while (READ_PERI_REG (UART_STATUS (0 )) & (UART_TXFIFO_CNT << UART_TXFIFO_CNT_S ));
573
+
574
+ PIN_FUNC_SELECT (PERIPHS_IO_MUX_MTCK_U , FUNC_UART0_CTS );
575
+ PIN_FUNC_SELECT (PERIPHS_IO_MUX_MTDO_U , FUNC_UART0_RTS );
576
+
577
+ // UART0: TXD <-> RTS and RXD <-> CTS
578
+ SET_PERI_REG_MASK (UART_SWAP_REG , 0x4 );
579
+ #endif
580
+
571
581
#if CONFIG_CONSOLE_UART_NUM == 1
572
582
PIN_FUNC_SELECT (PERIPHS_IO_MUX_GPIO2_U , FUNC_U1TXD_BK );
573
583
Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ config CONSOLE_UART_BAUDRATE
57
57
default 74880
58
58
range 1200 4000000
59
59
60
+ config CONSOLE_UART_SWAP_IO
61
+ bool "Swap UART0 I/O pins"
62
+ default n
63
+ help
64
+ Enable this option, UART0's I/O pins are swaped: TXD <-> RTS, RTX <-> CTS.
65
+
60
66
endmenu
61
67
62
68
menu WIFI
You can’t perform that action at this time.
0 commit comments