Merge branch 'feature/modify_ot_rcp_TX_RX_pin' into 'master'

openthread: add a configuration for selecting RCP UART TX_RX

See merge request espressif/esp-idf!19697
This commit is contained in:
Zhang Wen Xu 2022-08-23 14:46:50 +08:00
commit dfbebccf91
2 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,21 @@
menu "OpenThread RCP Example"
config OPENTHREAD_UART_PIN_MANUAL
bool "Configure RCP UART pin manually"
default n
help
Select this to choose UART pin manually
config OPENTHREAD_UART_RX_PIN
int "The number of RX pin"
depends on OPENTHREAD_UART_PIN_MANUAL
default 4
range 0 25
config OPENTHREAD_UART_TX_PIN
int "The number of TX pin"
depends on OPENTHREAD_UART_PIN_MANUAL
default 5
range 0 25
endmenu

View File

@ -20,6 +20,14 @@
.radio_mode = RADIO_MODE_NATIVE, \
}
#if CONFIG_OPENTHREAD_UART_PIN_MANUAL
#define OPENTHREAD_RCP_UART_RX_PIN CONFIG_OPENTHREAD_UART_RX_PIN
#define OPENTHREAD_RCP_UART_TX_PIN CONFIG_OPENTHREAD_UART_TX_PIN
#else
#define OPENTHREAD_RCP_UART_RX_PIN UART_PIN_NO_CHANGE
#define OPENTHREAD_RCP_UART_TX_PIN UART_PIN_NO_CHANGE
#endif
#define ESP_OPENTHREAD_DEFAULT_HOST_CONFIG() \
{ \
.host_connection_mode = HOST_CONNECTION_MODE_RCP_UART, \
@ -35,8 +43,8 @@
.rx_flow_ctrl_thresh = 0, \
.source_clk = UART_SCLK_DEFAULT, \
}, \
.rx_pin = UART_PIN_NO_CHANGE, \
.tx_pin = UART_PIN_NO_CHANGE, \
.rx_pin = OPENTHREAD_RCP_UART_RX_PIN, \
.tx_pin = OPENTHREAD_RCP_UART_TX_PIN, \
}, \
}