Introduce uart hardware flow control configuration using mbed configuraton system for nrf5x base-targets

pull/2590/head
Andrzej Puzdrowski 2016-08-24 11:02:19 +02:00 committed by 0xc0170
parent 2457bb1f9e
commit 36c9092fbf
2 changed files with 23 additions and 1 deletions

View File

@ -1902,6 +1902,11 @@
"lf_clock_src": {
"value": "NRF_LF_SRC_XTAL",
"macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC"
},
"uart_hwfc": {
"help": "Value: 1 for enable, 0 for disable",
"value": 1,
"macro_name": "MBED_CONF_NORDIC_UART_HWFC"
}
}
},
@ -1947,6 +1952,11 @@
"lf_clock_src": {
"value": "NRF_LF_SRC_XTAL",
"macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC"
},
"uart_hwfc": {
"help": "Value: 1 for enable, 0 for disable",
"value": 1,
"macro_name": "MBED_CONF_NORDIC_UART_HWFC"
}
}
},

View File

@ -58,7 +58,19 @@
#define UART_DEFAULT_BAUDRATE UART0_CONFIG_BAUDRATE
#define UART_DEFAULT_PARITY UART0_CONFIG_PARITY
#define UART_DEFAULT_HWFC UART0_CONFIG_HWFC
// expected the macro from mbed configuration system
#ifndef MBED_CONF_NORDIC_UART_HWFC
#define MBED_CONF_NORDIC_UART_HWFC 1
#warning None of UART flow control configuration (expected macro MBED_CONF_NORDIC_UART_HWFC). The RTSCTS flow control is used by default .
#endif
#if MBED_CONF_NORDIC_UART_HWFC == 1
#define UART_DEFAULT_HWFC UART0_CONFIG_HWFC
#else
#define UART_DEFAULT_HWFC NRF_UART_HWFC_DISABLED
#endif
#define UART_DEFAULT_CTS UART0_CONFIG_PSEL_CTS
#define UART_DEFAULT_RTS UART0_CONFIG_PSEL_RTS