Bluenet
5.7.0
Bluenet, firmware for nRF52 smart home devices
|
#include <protocol/cs_Typedefs.h>
#include <protocol/cs_UicrPacket.h>
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
uint32_t | getHardwareBoard () |
Get the hardware board from UICR, or the default board if none is set in UICR. More... | |
cs_ret_code_t | writeHardwareBoard () |
Write the default hardware board to UICR if none is written yet. More... | |
cs_ret_code_t | enableNfcPinsAsGpio () |
Enable NFC pins to be used as GPIO. More... | |
bool | canUseNfcPinsAsGpio () |
Returns true when the NFC pins can be used as GPIO. More... | |
cs_ret_code_t | getUicr (cs_uicr_data_t *uicrData) |
Read the UICR data from UICR. More... | |
cs_ret_code_t | setUicr (const cs_uicr_data_t *uicrData, bool overwrite) |
Write the UICR data to UICR. More... | |
bool canUseNfcPinsAsGpio | ( | ) |
Returns true when the NFC pins can be used as GPIO.
cs_ret_code_t enableNfcPinsAsGpio | ( | ) |
Enable NFC pins to be used as GPIO.
This is stored in UICR, so it's persistent. NFC pins leak a bit of current when not at same voltage level.
uint32_t getHardwareBoard | ( | ) |
Get the hardware board from UICR, or the default board if none is set in UICR.
cs_ret_code_t getUicr | ( | cs_uicr_data_t * | uicrData | ) |
Read the UICR data from UICR.
[out] | uicrData | The struct to read to. |
cs_ret_code_t setUicr | ( | const cs_uicr_data_t * | uicrData, |
bool | overwrite | ||
) |
Write the UICR data to UICR.
[in] | uicrData | The data to write to UICR. |
[in] | overwrite | Whether to overwrite existing data in UICR. This is a risky operation, as it erases the whole UICR for a short while. |
cs_ret_code_t writeHardwareBoard | ( | ) |
Write the default hardware board to UICR if none is written yet.
In the past, the hardware board was not written to UICR. Instead, the board was compiled into the firmware, and each product had their own different firmware. This function is made to transition from that solution to a single firmware with board in UICR. We only have to make sure that each product once runs a firmware that writes the correct hardware board to UICR.