#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
◆ FLASH_MAGIC_CALIBRATION
| #define FLASH_MAGIC_CALIBRATION 0x43414C49 /* "CALI" */ |
◆ FLASH_NUM_CHANNELS
| #define FLASH_NUM_CHANNELS 3 |
◆ FLASH_SECTOR_SIZE
| #define FLASH_SECTOR_SIZE 0x1000 |
◆ FLASH_VERSION_CALIBRATION
| #define FLASH_VERSION_CALIBRATION 0x0001 |
◆ FLASH_STATUS
Flash storage status.
| Enumerator |
|---|
| FLASH_STATUS_OK | |
| FLASH_STATUS_NO_DATA | |
| FLASH_STATUS_INVALID_CRC | |
| FLASH_STATUS_INVALID_VERSION | |
| FLASH_STATUS_INVALID_MAGIC | |
| FLASH_STATUS_ERASE_FAILED | |
| FLASH_STATUS_WRITE_FAILED | |
| FLASH_STATUS_READ_FAILED | |
| FLASH_STATUS_INIT_FAILED | |
| FLASH_STATUS_NOT_INITIALIZED | |
◆ flash_calculate_crc32()
| uint32_t flash_calculate_crc32 |
( |
const void * | data, |
|
|
uint32_t | len ) |
Calculate CRC32 for data.
- Parameters
-
| data | - Pointer to data |
| len | - Length of data in bytes |
- Returns
- CRC32 value
◆ flash_erase_calibration()
| int flash_erase_calibration |
( |
void | | ) |
|
Erase calibration data from flash.
- Returns
- FLASH_STATUS_OK on success, error code otherwise
◆ flash_has_valid_calibration()
| bool flash_has_valid_calibration |
( |
void | | ) |
|
Check if valid calibration data exists in flash.
- Returns
- true if valid data exists, false otherwise
◆ flash_load_and_apply_calibration()
| int flash_load_and_apply_calibration |
( |
void | | ) |
|
Load calibration from flash and apply to AFE registers.
- Returns
- FLASH_STATUS_OK on success, error code otherwise
◆ flash_read_calibration()
Read calibration data from flash.
- Parameters
-
| data | - Pointer to calibration data structure |
- Returns
- FLASH_STATUS_OK on success, error code otherwise
◆ flash_save_all_calibration()
| int flash_save_all_calibration |
( |
void | | ) |
|
Save all calibration data to flash.
- Returns
- FLASH_STATUS_OK on success, error code otherwise
◆ flash_save_calibration_channel()
| int flash_save_calibration_channel |
( |
uint8_t | channel | ) |
|
Save current calibration context to flash for specified channel.
- Parameters
-
| channel | - Channel to save (0=A, 1=B, 2=C) |
- Returns
- FLASH_STATUS_OK on success, error code otherwise
◆ flash_status_to_string()
Get status string for flash status code.
- Parameters
-
| status | - Flash status code |
- Returns
- Status string
◆ flash_storage_init()
| int flash_storage_init |
( |
void | | ) |
|
Initialize flash storage.
- Returns
- FLASH_STATUS_OK on success, error code otherwise
◆ flash_storage_is_initialized()
| bool flash_storage_is_initialized |
( |
void | | ) |
|
Check if flash storage is initialized.
- Returns
- true if initialized, false otherwise
◆ flash_storage_remove()
| int flash_storage_remove |
( |
void | | ) |
|
De-initialize flash storage.
- Returns
- FLASH_STATUS_OK on success, error code otherwise
◆ flash_write_calibration()
Write calibration data to flash.
- Parameters
-
| data | - Pointer to calibration data structure |
- Returns
- FLASH_STATUS_OK on success, error code otherwise