Skip to content

Commit ab5b6ae

Browse files
committed
Fix UART references for 52805
1 parent 75baa76 commit ab5b6ae

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ script:
4343
- buildExampleSketch sandeepmistry:nRF5:SeeedArchLink 01.Basics Blink
4444
- buildExampleSketch sandeepmistry:nRF5:Generic_nRF52833 01.Basics Blink
4545
- buildExampleSketch sandeepmistry:nRF5:BBCmicrobitV2 01.Basics Blink
46+
- buildExampleSketch sandeepmistry:nRF5:Generic_nRF52805 01.Basics Blink

boards.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,38 @@ menu.version=Version
2121
menu.lfclk=Low Frequency Clock
2222
menu.board_variant=Board Variant
2323

24+
# nRF52805 variants
25+
###################
26+
27+
Generic_nRF52805.name=Generic nRF52805
28+
29+
Generic_nRF52805.upload.tool=sandeepmistry:openocd
30+
Generic_nRF52805.upload.target=nrf52
31+
Generic_nRF52805.upload.maximum_size=192000
32+
33+
Generic_nRF52805.bootloader.tool=sandeepmistry:openocd
34+
35+
Generic_nRF52805.build.mcu=cortex-m4
36+
Generic_nRF52805.build.f_cpu=64000000
37+
Generic_nRF52805.build.board=GENERIC
38+
Generic_nRF52805.build.core=nRF5
39+
Generic_nRF52805.build.variant=Generic
40+
Generic_nRF52805.build.variant_system_lib=
41+
Generic_nRF52805.build.extra_flags=-DNRF52805_XXAA
42+
Generic_nRF52805.build.float_flags=
43+
Generic_nRF52805.build.ldscript=nrf52805_xxaa.ld
44+
45+
Generic_nRF52805.menu.softdevice.none=None
46+
Generic_nRF52805.menu.softdevice.none.softdevice=none
47+
Generic_nRF52805.menu.softdevice.none.softdeviceversion=
48+
49+
Generic_nRF52805.menu.lfclk.lfxo=Crystal Oscillator
50+
Generic_nRF52805.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO
51+
Generic_nRF52805.menu.lfclk.lfrc=RC Oscillator
52+
Generic_nRF52805.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
53+
Generic_nRF52805.menu.lfclk.lfsynt=Synthesized
54+
Generic_nRF52805.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
55+
2456
# nRF52833 variants
2557
###################
2658

cores/nRF5/Uart.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,22 @@ void Uart::begin(unsigned long baudrate)
6464

6565
void Uart::begin(unsigned long baudrate, uint16_t /*config*/)
6666
{
67+
#ifdef NRF52805_XXAA
68+
nrfUart->PSEL.TXD = uc_pinTX;
69+
nrfUart->PSEL.RXD = uc_pinRX;
70+
#else
6771
nrfUart->PSELTXD = uc_pinTX;
6872
nrfUart->PSELRXD = uc_pinRX;
73+
#endif
6974

7075
if (uc_hwFlow == 1) {
76+
#ifdef NRF52805_XXAA
77+
nrfUart->PSEL.CTS = uc_pinCTS;
78+
nrfUart->PSEL.RTS = uc_pinRTS;
79+
#else
7180
nrfUart->PSELCTS = uc_pinCTS;
7281
nrfUart->PSELRTS = uc_pinRTS;
82+
#endif
7383
nrfUart->CONFIG = (UART_CONFIG_PARITY_Excluded << UART_CONFIG_PARITY_Pos) | UART_CONFIG_HWFC_Enabled;
7484
} else {
7585
nrfUart->CONFIG = (UART_CONFIG_PARITY_Excluded << UART_CONFIG_PARITY_Pos) | UART_CONFIG_HWFC_Disabled;
@@ -175,12 +185,20 @@ void Uart::end()
175185
nrfUart->TASKS_STOPTX = 0x1UL;
176186

177187
nrfUart->ENABLE = UART_ENABLE_ENABLE_Disabled;
188+
189+
#ifdef NRF52805_XXAA
190+
nrfUart->PSEL.TXD = 0xFFFFFFFF;
191+
nrfUart->PSEL.RXD = 0xFFFFFFFF;
178192

193+
nrfUart->PSEL.RTS = 0xFFFFFFFF;
194+
nrfUart->PSEL.CTS = 0xFFFFFFFF;
195+
#else
179196
nrfUart->PSELTXD = 0xFFFFFFFF;
180197
nrfUart->PSELRXD = 0xFFFFFFFF;
181198

182199
nrfUart->PSELRTS = 0xFFFFFFFF;
183200
nrfUart->PSELCTS = 0xFFFFFFFF;
201+
#endif
184202

185203
rxBuffer.clear();
186204
}

cores/nRF5/wiring_analog_nRF52.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ extern "C" {
2929
static uint32_t saadcReference = SAADC_CH_CONFIG_REFSEL_Internal;
3030
static uint32_t saadcGain = SAADC_CH_CONFIG_GAIN_Gain1_5;
3131

32+
#ifdef PWM_PRESENT
3233
static NRF_PWM_Type* pwms[PWM_COUNT] = {
3334
NRF_PWM0,
3435
NRF_PWM1,
@@ -47,6 +48,7 @@ static uint32_t pwmChannelPins[PWM_COUNT] = {
4748
#endif
4849
};
4950
static uint16_t pwmChannelSequence[PWM_COUNT];
51+
#endif
5052

5153
static int readResolution = 10;
5254
static int writeResolution = 8;
@@ -215,6 +217,7 @@ uint32_t analogRead( uint32_t ulPin )
215217
// to digital output.
216218
void analogWrite( uint32_t ulPin, uint32_t ulValue )
217219
{
220+
#ifdef PWM_PRESENT
218221
if (ulPin >= PINS_COUNT) {
219222
return;
220223
}
@@ -247,6 +250,7 @@ void analogWrite( uint32_t ulPin, uint32_t ulValue )
247250
break;
248251
}
249252
}
253+
#endif
250254
}
251255

252256
#ifdef __cplusplus

0 commit comments

Comments
 (0)