Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_HardwareVersions.h File Reference
#include <cfg/cs_AutoConfig.h>
#include <cfg/cs_Boards.h>
#include <drivers/cs_Uicr.h>
#include <protocol/cs_UicrPacket.h>
#include <stdio.h>
Include dependency graph for cs_HardwareVersions.h:

Go to the source code of this file.

Functions

static const char * get_hardware_version ()
 Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 21, 2016 License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed) More...
 
static const char * get_hardware_version_from_uicr (const cs_uicr_data_t *uicrData)
 

Variables

static char versionString [12]
 

Function Documentation

◆ get_hardware_version()

static const char * get_hardware_version ( )
inlinestatic

Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 21, 2016 License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)

The value written to the UICR is done by a target write_board_version created by cmake. This target invokes a tool that extracts the value from the cs_Boards.h file. The string returned here is a user-facing string that is not used anywhere else. The reason to use the UICR for this:

  • bootloader and firmware are easier kept in tandem
  • firmware does not need to know itself on which hardware it runs, it can just inspect UICR
  • hardware version is characteristic for the hardware and should not be updateable (UICR)
    • note, hardware patches come of course with a new UICR
  • in test and development it's easy to set/get UICR values (without firmware running)
    • we can check for firmware compatibility in the build system if there are multiple firmwares

Do not use LOGx functions here! This function is also used by the bootloader.

◆ get_hardware_version_from_uicr()

static const char * get_hardware_version_from_uicr ( const cs_uicr_data_t uicrData)
inlinestatic

Variable Documentation

◆ versionString

char versionString[12]
static