-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
Add support for Generic NRF52805 #442
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,12 +64,22 @@ void Uart::begin(unsigned long baudrate) | |
|
||
void Uart::begin(unsigned long baudrate, uint16_t /*config*/) | ||
{ | ||
#ifdef NRF52805_XXAA | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we be touching code in the SDK? Does that introduce potential upgrade complexity? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question for @sandeepmistry :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It would be better to avoid doing this, as it would be one more thing to manage when updating the SDK. That said if it's the best approach wrapping changes in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Am I good to leave this as-is for now? There is already series and, in some special cases, chip specific logic in the .cpp library files. I would prefer to leave this condition where it is until we decide on the best way/place to extend SDK definitions without modifying the SDK. However, I'll do whatever you feel is best. There is increased interest to get this merged in, so whatever I can do to help expedite. |
||
nrfUart->PSEL.TXD = uc_pinTX; | ||
nrfUart->PSEL.RXD = uc_pinRX; | ||
#else | ||
nrfUart->PSELTXD = uc_pinTX; | ||
nrfUart->PSELRXD = uc_pinRX; | ||
#endif | ||
|
||
if (uc_hwFlow == 1) { | ||
#ifdef NRF52805_XXAA | ||
nrfUart->PSEL.CTS = uc_pinCTS; | ||
nrfUart->PSEL.RTS = uc_pinRTS; | ||
#else | ||
nrfUart->PSELCTS = uc_pinCTS; | ||
nrfUart->PSELRTS = uc_pinRTS; | ||
#endif | ||
nrfUart->CONFIG = (UART_CONFIG_PARITY_Excluded << UART_CONFIG_PARITY_Pos) | UART_CONFIG_HWFC_Enabled; | ||
} else { | ||
nrfUart->CONFIG = (UART_CONFIG_PARITY_Excluded << UART_CONFIG_PARITY_Pos) | UART_CONFIG_HWFC_Disabled; | ||
|
@@ -175,12 +185,20 @@ void Uart::end() | |
nrfUart->TASKS_STOPTX = 0x1UL; | ||
|
||
nrfUart->ENABLE = UART_ENABLE_ENABLE_Disabled; | ||
|
||
#ifdef NRF52805_XXAA | ||
nrfUart->PSEL.TXD = 0xFFFFFFFF; | ||
nrfUart->PSEL.RXD = 0xFFFFFFFF; | ||
|
||
nrfUart->PSEL.RTS = 0xFFFFFFFF; | ||
nrfUart->PSEL.CTS = 0xFFFFFFFF; | ||
#else | ||
nrfUart->PSELTXD = 0xFFFFFFFF; | ||
nrfUart->PSELRXD = 0xFFFFFFFF; | ||
|
||
nrfUart->PSELRTS = 0xFFFFFFFF; | ||
nrfUart->PSELCTS = 0xFFFFFFFF; | ||
#endif | ||
|
||
rxBuffer.clear(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://github.com/sandeepmistry/arduino-nRF5/blob/master/cores/nRF5/SDK/components/toolchain/gcc/nrf52805_xxaa.ld
should this be:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here a60f6db