File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
libraries/AdafruitFeather52Examples/Hardware/nfc_to_gpio Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments