Go to the source code of this file.
◆ BCD_TO_INT
#define BCD_TO_INT |
( |
|
bcd | ) |
((bcd & 0xF) + ((bcd & 0xF0) >> 4)*10) |
◆ BLE_UTIL_ACI_ERROR
#define BLE_UTIL_ACI_ERROR 3 |
◆ BLE_UTIL_CRC_ERROR
#define BLE_UTIL_CRC_ERROR 4 |
◆ BLE_UTIL_PARSE_ERROR
#define BLE_UTIL_PARSE_ERROR 5 |
◆ BLE_UTIL_SUCCESS
#define BLE_UTIL_SUCCESS 0 |
◆ BLE_UTIL_UNSUPPORTED_VERSION
#define BLE_UTIL_UNSUPPORTED_VERSION 1 |
◆ BLE_UTIL_WRONG_IMAGE_SIZE
#define BLE_UTIL_WRONG_IMAGE_SIZE 2 |
◆ BLE_UTIL_WRONG_VERIFY
#define BLE_UTIL_WRONG_VERIFY 6 |
◆ FROM_SYS_TIME_TO_US
#define FROM_SYS_TIME_TO_US |
( |
|
sys | ) |
((uint16_t)(sys*2.4414)) |
◆ FROM_US_TO_SYS_TIME
#define FROM_US_TO_SYS_TIME |
( |
|
us | ) |
((uint16_t)(us/2.4414)+1) |
◆ INT_TO_BCD
#define INT_TO_BCD |
( |
|
n | ) |
((((uint8_t)n/10)<<4) + (uint8_t)n%10) |
◆ IFR_config_TypeDef
Structure inside IFR for configuration options.
◆ change_IFR_data_config()
Modify IFR data. (Last 64-bytes block).
- Parameters
-
IFR_config | Structure that contains the new parameters inside the IFR configuration data. |
- Note
- It is highly recommended to parse the IFR configuration from a working IFR block (this should be done with parse_IFR_data_config()). Then it is possible to write the new parameters inside the IFR_config structure.
- Parameters
-
data | Pointer to the buffer that contains the original data. It will be modified according to the new data in the IFR_config structure. Then this data must be written in the last 64-byte block in the IFR. Its size must be 64 bytes. |
- Return values
-
◆ getBlueNRGUpdaterVersion()
uint8_t getBlueNRGUpdaterVersion |
( |
uint8_t * |
version | ) |
|
Get BlueNRG updater version.
- Parameters
-
version | This parameter returns the updater version. If the updadter version is 0x03 the chip has the updater old, needs to update the bootloader. |
- Return values
-
◆ getBlueNRGVersion()
uint8_t getBlueNRGVersion |
( |
uint8_t * |
hwVersion, |
|
|
uint16_t * |
fwVersion |
|
) |
| |
Get BlueNRG hardware and firmware version.
- Parameters
-
hwVersion | This parameter returns the Hardware Version (i.e. CUT 3.0 = 0x30, CUT 3.1 = 0x31). |
fwVersion | This parameter returns the Firmware Version in the format 0xJJMN where JJ = Major Version number, M = Minor Version number and N = Patch Version number. |
- Return values
-
◆ IFR_validate()
Check for the correctness of parsed data.
- Parameters
-
IFR_config | Data structure filled with parsed data. |
- Return values
-
int | It returns 0 if successful, or PARSE_ERROR in case data is not correct. |
◆ isHWBootloader_Patched()
uint8_t isHWBootloader_Patched |
( |
void |
| ) |
|
Verifies if the bootloader is patched or not. This function shall be used to fix a bug on the HW bootloader related to the 32 MHz external crystal oscillator.
- Return values
-
TRUE | if the HW bootloader is already patched, FALSE otherwise |
◆ parse_IFR_data_config()
Parse IFR raw data.
- Parameters
-
data | Pointer to the raw data: last 64 bytes read from IFR sector. |
IFR_config | Data structure that will be filled with parsed data. |
- Return values
-
◆ program_device()
int program_device |
( |
const uint8_t * |
fw_image, |
|
|
uint32_t |
fw_size |
|
) |
| |
Flash a new firmware using internal bootloader.
- Parameters
-
fw_image | Pointer to the firmware image (raw binary data, little-endian). |
fw_size | Size of the firmware image. The firmware image size shall be multiple of 4 bytes. |
- Return values
-
int | It returns 0 if successful, or a number not equal to 0 in case of error (ACI_ERROR, UNSUPPORTED_VERSION, WRONG_IMAGE_SIZE, CRC_ERROR) |
◆ program_IFR()
Program raw data to IFR (3 64-bytes blocks).
- Parameters
-
ifr_image | Pointer to the buffer that will contain the data to program. Its size must be 192 bytes. |
- Return values
-
int | It returns 0 if successful |
◆ read_IFR()
int read_IFR |
( |
uint8_t |
data[192] | ) |
|
Read raw data from IFR (3 64-bytes blocks).
- Parameters
-
data | Pointer to the buffer that will contain the read data. Its size must be 192 bytes. This data can be parsed by parse_IFR_data_config(). |
- Return values
-
int | It returns 0 if successful, or a number not equal to 0 in case of error (ACI_ERROR, UNSUPPORTED_VERSION) |
◆ verify_IFR()
Verify raw data from IFR (3 64-bytes blocks).
- Parameters
-
ifr_data | Pointer to the buffer that will contain the data to verify. Its size must be 192 bytes. |
- Return values
-
int | It returns 0 if successful, or a number not equal to 0 in case of error (ACI_ERROR, BLE_UTIL_WRONG_VERIFY) |
◆ cold_ana_act_config_table
uint8_t cold_ana_act_config_table[64] |
◆ day
◆ gpio_config
◆ hot_ana_config_table
uint8_t hot_ana_config_table[64] |
◆ hs_startup_time
◆ IFR_config
◆ ls_crystal_freq
◆ ls_crystal_period
uint32_t ls_crystal_period |
◆ master_sca
◆ max_conn_event_time
uint32_t max_conn_event_time |
◆ month
◆ rsrvd1
◆ rsrvd2
◆ rsrvd3
◆ rsrvd4
◆ rsrvd5
◆ slave_sca_ppm
◆ stack_mode
◆ uid
◆ unused
◆ year