Skip to content

Commit 9a1d6bf

Browse files
committed
Merge branch 'master' of github.com:adafruit/Adafruit_nRF52_Arduino
2 parents cbea7f7 + 69c40ef commit 9a1d6bf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// This sketch will check if the NFC pins are configured for NFC mode,
2+
// and if so it will switch them to operate in GPIO mode. A system
3+
// reset is required before this change takes effect since the CONFIG
4+
// memory is only read on power up.
5+
6+
void setup() {
7+
Serial.begin(115200);
8+
Serial.println("Bluefruit52 NFC to GPIO Pin Config");
9+
if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)){
10+
Serial.println("Fix NFC pins");
11+
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
12+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy);
13+
NRF_UICR->NFCPINS &= ~UICR_NFCPINS_PROTECT_Msk;
14+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy);
15+
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
16+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy);
17+
Serial.println("Done");
18+
delay(500);
19+
NVIC_SystemReset();
20+
}
21+
22+
}
23+
void loop() {
24+
// put your main code here, to run repeatedly:
25+
}

0 commit comments

Comments
 (0)