Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nRF5x uart hardware flow control configuration using mbed configuration systsem #2535

Merged
merged 1 commit into from
Aug 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions hal/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,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"
}
}
},
Expand Down Expand Up @@ -1936,6 +1941,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"
}
}
},
Expand Down
14 changes: 13 additions & 1 deletion hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down