|
NFC_UICR_RK
|
Class for updating the nRF52840 UICR bytes to disable NFC. More...
#include <NFC_UICR_RK.h>
Static Public Member Functions | |
| static void | disableNFC () |
| Disable NFC it was previously enabled. | |
| static bool | checkEnableNFC () |
| Returns true if NFC is enabled in the UICR bytes. | |
Class for updating the nRF52840 UICR bytes to disable NFC.
You will typically call NFC_UICR_RK::disableNFC() to disable NFC on devices that have it enabled but you want to use the pins as GPIO. The E404X and Monitor One already have it disabled from the factory.
If the state of NFC is enabled it will be updated. There are caveats to this:
The reason is that if the UICR bits need to be updated, SoftDevice (BLE) needs to be disabled. It will also System.reset() after updating the bits. Because of this, there is a possibility that the code after enable() or disable() will never be executed.
There is no enableNFC()! This is because in order to reenable NFC mode, you must chip erase the device and flash both the UICR and enter system flash image to the device.
This calls only does anything on nRF52840 devices, but compiles on all platforms. The disableNFC() function is a no-op, and checkEnableNFC() always returns false on other platforms.
|
static |
Returns true if NFC is enabled in the UICR bytes.
|
static |
Disable NFC it was previously enabled.
If it was enabled, the state will be set to disabled and the device will reboot.
If NFC was already disabled, the function will return immediately so your code can continue executing.
Note: You can only reenable NFC by chip erase and reprogram with a SWD programmer!