low level API to File System
More...
low level API to File System
◆ ll_add_file_record()
FS_state ll_add_file_record |
( |
uint8_t |
data[], |
|
|
uint8_t |
len, |
|
|
uint8_t |
offset |
|
) |
| |
Prepare data buffer to write sensor values.
- Parameters
-
data | array of values to be written. |
len | length of data array. Maximum length is 8 |
offset | offset stored values from begining of data buffer. |
- Returns
- STATE_OK if eas no error, STATE_ERR if parameter len>8
◆ ll_add_meta_sensor()
Write information about sensor in FLASH.
- Parameters
-
index | index of sensor |
sensor | sensor driver |
num_files | number existing files in sensorFS |
- Returns
- state STATE_OK
◆ ll_check_block()
int8_t ll_check_block |
( |
uint32_t |
addr, |
|
|
uint32_t |
len |
|
) |
| |
Check data block of file record.
Data block is used for store of values.
- Parameters
-
addr | address of beginning of the block |
len | length of data block |
- Returns
- 0 - if the block at address adr is first free, 1 if the block is empty and it is in empty part of file, -1 if block is not empty.
◆ ll_detect_num_files()
uint8_t ll_detect_num_files |
( |
void |
| ) |
|
Detect the numbers files in sensorFS.
- Returns
- number of existing files.
◆ ll_init_low_level()
void ll_init_low_level |
( |
void * |
hw1, |
|
|
void * |
hw2, |
|
|
uint16_t |
GPIO_Pin |
|
) |
| |
Initialise low-level memory driver.
As adriver can be implemented FLASH memory, EEPROM (One-wire) or dummy (SIMULATON=1) memory.
- Parameters
-
hw1 | pointer to structure that is used to initialize peripherial. This can be used for SPI_HandleTypeDef, QSPI_HandleTypeDef, ... |
hw2 | additional poineter for helper structure. This can be GPIO_TypeDef for PGIO prot that use CS pin. If not used, use NULL instead. |
GPIO_Pin | additional HW specification. For SPI can be used as pin specification for ChipSelect. |
◆ ll_read_file_info()
Read file header from FLASH.
Information are stored in internal variable sensorFS.
- Parameters
-
- Returns
- state: STATE_OK/STATE_ERR
◆ ll_read_info_FS()
Read information from preamble.
TODO: implement additional parameters: MAX_FILE, MAX_COL_COUNT !!!!
- Parameters
-
◆ ll_write_file_header()
Write file header in flashFS.
It is used in FS_commit_file_header function.
- Parameters
-
- Returns
- state: STATE_OK