Skip to content

Commit

Permalink
[nRF52] bring up of NFC feature
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jan 20, 2025
1 parent c733c6d commit a0e52e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
24 changes: 16 additions & 8 deletions software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,15 @@ void nfc_func(void *context, nfc_t2t_event_t event,
switch (event)
{
case NFC_T2T_EVENT_FIELD_ON:
#if 0
Serial.println("******NFC_T2T_EVENT_FIELD_ON******");
#endif
break;

case NFC_T2T_EVENT_FIELD_OFF:
#if 0
Serial.println("------NFC_T2T_EVENT_FIELD_OFF------");
#endif
break;

default:
Expand Down Expand Up @@ -1384,14 +1388,6 @@ static void nRF52_setup()
if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) != (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)) {
Serial.println("*** NFC pins are disabled ***");
// nfcpins_enable();
} else {
String NFC_name = SOFTRF_IDENT;
NFC_name += "-";
NFC_name += String(SoC->getChipId() & 0x00FFFFFFU, HEX);

NFC.setTXTmessage((NFC_name+"-NFC").c_str(), "en");
NFC.start();
NFC.registerCallback(nfc_func);
}
}
#endif /* ENABLE_NFC */
Expand Down Expand Up @@ -1534,6 +1530,18 @@ static void nRF52_post_init()
#endif /* USE_EXT_I2S_DAC */
}

#if defined(ENABLE_NFC) && defined(EXCLUDE_BLUETOOTH)
if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)) {
String NFC_name = SOFTRF_IDENT;
NFC_name += "-";
NFC_name += String(SoC->getChipId() & 0x00FFFFFFU, HEX);

NFC.setTXTmessage((NFC_name+"-NFC").c_str(), "en");
NFC.start();
NFC.registerCallback(nfc_func);
}
#endif /* ENABLE_NFC */

} else if (nRF52_board == NRF52_HELTEC_T114) {
Serial.println();
Serial.println(F("Heltec T114 Power-on Self Test"));
Expand Down
1 change: 1 addition & 0 deletions software/firmware/source/SoftRF/src/platform/nRF52.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ struct rst_info {
#define EXCLUDE_SI443X
//#define ENABLE_RECORDER
//#define ENABLE_NFC
//#define EXCLUDE_BLUETOOTH
#else
#undef USE_EPAPER
//#define EXCLUDE_BLUETOOTH
Expand Down

0 comments on commit a0e52e2

Please sign in to comment.