File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 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);
568568
569569static void uart_console_configure (void )
570570{
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+
571581#if CONFIG_CONSOLE_UART_NUM == 1
572582 PIN_FUNC_SELECT (PERIPHS_IO_MUX_GPIO2_U , FUNC_U1TXD_BK );
573583
Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ config CONSOLE_UART_BAUDRATE
5757 default 74880
5858 range 1200 4000000
5959
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+
6066endmenu
6167
6268menu WIFI
You can’t perform that action at this time.
0 commit comments