  | 
  
    simple FS
    v0.1.0
    
   | 
 
 
 
 
Declarations of FS structures and data types.  
More...
Go to the source code of this file.
 | 
| enum   | sensor_type {  
  SENSOR_TYPE_NONE = 0x00, 
SENSOR_TYPE_INTEGER = 0x01, 
SENSOR_TYPE_CHAR = 0x02, 
SENSOR_TYPE_FLOAT = 0x03, 
 
  SENSOR_TYPE_TIME = 0x04, 
SENSOR_TYPE_TEMPERATURE = 0x05, 
SENSOR_TYPE_HUMIDITY = 0x06, 
SENSOR_TYPE_PRESSURE = 0x07, 
 
  SENSOR_TYPE_LIGHT_VISIBLE = 0x08, 
SENSOR_TYPE_LIGHT_IR = 0x09, 
SENSOR_TYPE_LIGHT_UV = 0x0A, 
SENSOR_TYPE_ADC = 0x0B, 
 
  SENSOR_TYPE_ACC = 0x0C, 
SENSOR_TYPE_GYR = 0x0D
 
 } | 
|   | Definition of base types os supported sensors.  More...
  | 
|   | 
| enum   | value_format {  
  FORMAT_META_LENGTH_1B = 0x1, 
FORMAT_META_LENGTH_2B = 0x2, 
FORMAT_META_LENGTH_3B = 0x3, 
FORMAT_META_LENGTH_4B = 0x4, 
 
  FORMAT_META_LENGTH_5B = 0x5, 
FORMAT_META_LENGTH_6B = 0x6, 
FORMAT_META_LENGTH_7B = 0x7, 
FORMAT_META_LENGTH_8B = 0x8, 
 
  FORMAT_META_LENGTH_9B = 0x9, 
FORMAT_META_LENGTH_10B = 0xA, 
FORMAT_META_LENGTH_11B = 0xB, 
FORMAT_META_LENGTH_12B = 0xC, 
 
  FORMAT_META_LENGTH_13B = 0xD, 
FORMAT_META_LENGTH_14B = 0xE, 
FORMAT_META_LENGTH_15B = 0xF, 
FORMAT_META_LENGTH_16B = 0x10, 
 
  FORMAT_META_LENGTH_24B = 0x11, 
FORMAT_META_LENGTH_32B = 0x12, 
FORMAT_META_LENGTH_40B = 0x13, 
FORMAT_META_LENGTH_48B = 0x14, 
 
  FORMAT_META_LENGTH_56B = 0x15, 
FORMAT_META_LENGTH_64B = 0x16, 
FORMAT_META_LENGTH_72B = 0x17, 
FORMAT_META_LENGTH_80B = 0x18, 
 
  FORMAT_META_LENGTH_88B = 0x19, 
FORMAT_META_LENGTH_96B = 0x1A, 
FORMAT_META_LENGTH_104B = 0x1B, 
FORMAT_META_LENGTH_112B = 0x1C, 
 
  FORMAT_META_LENGTH_120B = 0x1D, 
FORMAT_META_LENGTH_128B = 0x1E, 
FORMAT_META_NONE = 0xFF
 
 } | 
|   | Definition data value lengths.  More...
  | 
|   | 
| enum   | meta_fmt {  
  FORMAT_META_FMT_INT = 0, 
FORMAT_META_FMT_UINT = (0x01) << 5, 
FORMAT_META_FMT_Q = (0x02) << 5, 
FORMAT_META_FMT_SPECIAL_TIME = (0x03) << 5, 
 
  FORMAT_META_FMT_SPECIAL_BCD = (0x04) << 5, 
FORMAT_META_FMT_SPECIAL_FUTURE2 = (0x05) << 5, 
FORMAT_META_FMT_SPECIAL_FUTURE3 = (0x06) << 5, 
FORMAT_META_FMT_SPECIAL_FUTURE4 = (0x07) << 5
 
 } | 
|   | Enumeration of supported data formats.  More...
  | 
|   | 
Declarations of FS structures and data types. 
- Date
 - 19. 12. 2020 
 
- Author
 - Juraj Dudak 
 
 
uint8_t winbond_init(void *hspi)
end IO functions
Definition: memory_winbond32.c:274
 
#define SENSOR_ID_LENGTH
Length of sensor ID in bytes.
Definition: sensor.h:26
 
uint8_t file_get_num_parts(SimpleFS_t *fileP)
Return number parts of opened file.
Definition: sensor_FS.c:249
 
uint8_t ll_detect_num_files(void)
Detect the numbers files in sensorFS.
Definition: FS_lowLevel.c:132
 
uint8_t FS_is_empty(void)
Check, that sensorFS/FLASH is empty.
Definition: sensor_FS.c:370
 
Module for communication Analog-digital peripheral used on MCU.
 
void time_doMeasure(void)
Do nothing.
Definition: module_time.c:196
 
Simple file system for application of sensoric and primitive data types .
 
Describe base structure for 1 file.
Definition: file_format.h:242
 
SimpleFS_t * FS_open_last_file(void)
Open last file on sensorFS.
Definition: sensor_FS.c:226
 
RecordDescriptor_t time_getType()
Return type specification for RTC module.
Definition: module_time.c:127
 
void FS_init(void *hw_obj1, void *hw_obj2, uint16_t hw_obj3)
Init the sensorFS filesystem.
Definition: sensor_FS.c:86
 
RecordDescriptor_t(* getType)()
Return sensor type specification.
Definition: sensor.h:94
 
uint8_t ID
Identifier of file.
Definition: file_format.h:244
 
#define RTC_HandleTypeDef
Dummy datatype in simulation mode.
Definition: module_time.h:63
 
Module for manipulating with primitive data types. Supported modes:
 
uint8_t Minutes
Minutes.
Definition: module_time.h:72
 
Time structure for RTC module.
Definition: module_time.h:68
 
Module for communication Real Time Clock (RTC) peripheral used on MCU. Supported modes:
 
FS_state ll_add_meta_sensor(uint8_t index, SimpleFS_t *fs)
Write information about sensor in FLASH.
Definition: FS_lowLevel.c:118
 
Definition of Q format number parameters: m,n.
Definition: file_format.h:180
 
void file_data_prepare(void)
Start value measure on all sensors.
Definition: sensor_FS.c:295
 
SimpleFS_t * FS_open_file(uint8_t id_file)
Try open to file with given ID.
Definition: sensor_FS.c:217
 
uint8_t ram_eraseSector(uint32_t addr_start)
Definition: memory_ram.c:83
 
uint8_t ds_init(void *hw_object, void *hw_object2, uint16_t GPIO_Pin)
Inicializacia drivera.
Definition: memory_ds.c:39
 
SensorID_t *(* getSensorId)(uint8_t id)
Return sensors ID.
Definition: sensor.h:86
 
FS_state ll_write_file_header(SimpleFS_t *fs)
Write file header in flashFS.
Definition: FS_lowLevel.c:150
 
uint8_t * value
Array, where is stored raw value as array of bytes.
Definition: sensor.h:45
 
void time_init(void *, uint16_t)
Initialization of RTC module.
Definition: module_time.c:77
 
uint8_t Seconds
Seconds.
Definition: module_time.h:74
 
uint8_t time_count(void)
Return number of sensors in this peripheral.
Definition: module_time.c:204
 
FileDescriptor_t file
Detailed information about open file: FileDescriptor_t.
Definition: file_format.h:273
 
enum state FS_state
State definition for memory operations.
 
FS_state FS_commit_file_header(void)
Finish write information about created file.
Definition: sensor_FS.c:204
 
SensorValue_t * get_adc_value()
Read measured value from ADC.
Definition: module_adc.c:105
 
uint8_t name[FILENAME_LENGTH]
Name of file.
Definition: file_format.h:253
 
uint8_t(* getSensorCount)(void)
Return number of internal sub-sensors if they are defined.
Definition: sensor.h:109
 
uint8_t(* Manufacturer)(void)
Return manufacturer code of memory:
Definition: memory_driver.h:170
 
void(* doMeasure)(void)
Start data acquisition process on sensor.
Definition: sensor.h:99
 
SensorType_t type
define type of column SensorType_t
Definition: sensor.h:47
 
Describes internal structure of file.
Definition: file_format.h:228
 
RecordDescriptor_t adc_getType()
Return format specification of this senor.
Definition: module_adc.c:96
 
uint32_t meta_address
Address of meta-information for file.
Definition: file_format.h:247
 
SensorID_t * get_tsensor_id(uint8_t index)
Return sensor ID.
Definition: module_time.c:109
 
#define WINBOND_32_SECTOR_SIZE
WINBOND_32_SECTOR = 4096.
Definition: memory_winbond32.h:84
 
uint8_t data_length
effective length of value (in bytes)
Definition: sensor.h:49
 
uint8_t id[SENSOR_ID_LENGTH]
Unique column ID stored as an array of SENSOR_ID_LENGTH (8) bytes.
Definition: sensor.h:34
 
void adc_reset(void)
Reset ADC peripheral.
Definition: module_adc.c:135
 
The interface, that defines list of functions, tha have to be implemented for each type of value (or ...
Definition: sensor.h:66
 
uint32_t file_size(SimpleFS_t *fs)
Return file size in Bytes.
Definition: sensor_FS.c:356
 
uint8_t FS_num_files()
Return number of files, that is stored in internal info structure.
Definition: sensor_FS.c:268
 
RecordTypeQ_t Q
Specifies value of Q(m,n) parameters format of value.
Definition: file_format.h:219
 
Declarations of universal functions to access to values.
 
Definition: memory_winbond32.h:97
 
uint8_t size
Effective length of column ID.
Definition: sensor.h:36
 
Sensor value is stored as array of bytes.
Definition: sensor.h:42
 
#define FS_SIZE_VARIANT
Definition: memory_driver.h:71
 
uint8_t num_files
Number existing files in sFS.
Definition: file_format.h:275
 
SensorID_t * get_adc_sensor_id(uint8_t index)
Return ID of sensor.
Definition: module_adc.c:78
 
Definition: module_data.h:52
 
uint8_t ram_init(void *hw_object, void *hw_object2, uint16_t GPIO_Pin)
Inicializacia drivera.
Definition: memory_ram.c:39
 
SensorInterface_t * FS_sensor_driver(uint8_t sensor_part)
Return driver for attached sensor.
Definition: sensor_FS.c:287
 
SimpleFS_t sensorFS
Internal representation of opened file.
Definition: sensor_FS.c:28
 
uint8_t ds_eraseSector(uint32_t adr_start)
Definition: memory_ds.c:82
 
uint16_t record_length
Length of one record in file in bytes.
Definition: file_format.h:260
 
Low-level functions to communicate with simpleFileSystem.
 
uint16_t file_record_length(SimpleFS_t *fileP)
Return length of record.
Definition: sensor_FS.c:240
 
uint8_t ds_isBusy(void)
Vráti stav FLASH pamäti.
Definition: memory_ds.c:59
 
uint8_t sensor_id[8]
Sensor ID.
Definition: file_format.h:230
 
uint32_t data_address
Address of begin of data file.
Definition: file_format.h:250
 
uint8_t data_buffer[MEMORY_PAGE_SIZE]
Internal data buffer for memory I/O operations.
Definition: FS_lowLevel.c:77
 
Base structure for sFS.
Definition: file_format.h:271
 
void file_data_row_commit(SimpleFS_t *fs)
Write prepared measured values (by file_store_data} function) to FLASH.
Definition: sensor_FS.c:347
 
SensorValue_t *(* getValue)(void)
Read prepared value from sensor.
Definition: sensor.h:104
 
uint16_t(* Read)(uint32_t addr, uint8_t *buf, uint16_t n)
Read amount data frommemory.
Definition: memory_driver.h:102
 
RecordDescriptor_t file_column_format(SimpleFS_t *fileP, uint8_t index_part)
Return format of i-th sensor inf datafile.
Definition: sensor_FS.c:259
 
SensorType_t sensor_type
Type of stored value.
Definition: file_format.h:232
 
uint8_t(* Type)(void)
Return type fo memory.
Definition: memory_driver.h:174
 
void adc_doMeasure(void)
Start the measure procedure in blocking mode.
Definition: module_adc.c:143
 
FS_state file_add_sensor(uint8_t index, uint8_t index_in_driver, SensorInterface_t *sensor)
Add new sensor to created file.
Definition: sensor_FS.c:180
 
void ll_read_info_FS(FS_Header_t *info)
Read information from preamble.
Definition: FS_lowLevel.c:95
 
uint8_t(* Init)(void *hw_object, void *GPIOx, uint16_t GPIO_Pin)
Init memory hardware peripheral.
Definition: memory_driver.h:94
 
uint32_t file_data_row_begin(SimpleFS_t *fs)
Initialize internal data structures for new data record.
Definition: sensor_FS.c:321
 
Base structure for description of sored value.
Definition: file_format.h:211
 
uint16_t(* Write)(uint32_t addr, uint8_t *buf, int32_t n)
Write amount of data in memory.
Definition: memory_driver.h:110
 
uint8_t adc_count(void)
Return number of sensors in this peripheral.
Definition: module_adc.c:156
 
void(* Init)(void *hw1, uint16_t hw2)
Initialization of sensor.
Definition: sensor.h:73
 
uint8_t Hours
Hours.
Definition: module_time.h:70
 
void adc_init(void *, uint16_t)
Initialization of ADC module.
Definition: module_adc.c:55
 
int8_t ll_check_block(uint32_t addr, uint32_t len)
Check data block of file record.
Definition: FS_lowLevel.c:245
 
uint8_t ram_isBusy(void)
Vráti stav FLASH pamäti.
Definition: memory_ram.c:53
 
Description of one column (or 1 sensor) in file.
Definition: sensor.h:32
 
RecordTypeValue_t value_format
This information contain every sensor in his driver file.
Definition: file_format.h:234
 
uint64_t(* Id)(void)
Return HW ID of used memory.
Definition: memory_driver.h:179
 
void(* resetSensor)(void)
Reset sensor settings.
Definition: sensor.h:78
 
SensorInterface_t adcSensor
Interface to ADC sensor.
Definition: module_adc.c:38
 
FS_state FS_write_preamble(void)
Write preamble aprt in sensorFS, if not exists.
Definition: sensor_FS.c:384
 
FS_state ll_read_file_info(uint8_t id_file, SimpleFS_t *fs)
Read file header from FLASH.
Definition: FS_lowLevel.c:178
 
uint8_t num_parts
Each file can have variable count of items (or columns) in row record.
Definition: file_format.h:256
 
#define ADC_HW_MULTIPLYER
Physically placed voltage divider in measuring circuit.
Definition: module_adc.h:57
 
uint16_t recordAddressMap[MAXIMUM_FS_SENSORS_PER_FILE]
Map of addresses for one record.
Definition: file_format.h:265
 
FS_state ll_add_file_record(uint8_t data[], uint8_t len, uint8_t offset)
Prepare data buffer to write sensor values.
Definition: FS_lowLevel.c:273
 
uint8_t FS_create_file()
Begin file creation procedure.
Definition: sensor_FS.c:114
 
uint8_t(* Capacity)(void)
Return capacity code:
Definition: memory_driver.h:162
 
Module for communication with sensors in One-Wire bus. Supported modes:
 
Date structure for RTC module.
Definition: module_time.h:81
 
void time_reset(void)
Do nothing.
Definition: module_time.c:189
 
uint8_t FS_detect_num_files(void)
Return number of files.
Definition: sensor_FS.c:277
 
RecordDescriptor_t format[MAXIMUM_FS_SENSORS_PER_FILE]
Format specification for each column in file.
Definition: file_format.h:258
 
void ll_init_low_level(void *hw1, void *hw2, uint16_t GPIO_Pin)
Initialise low-level memory driver.
Definition: FS_lowLevel.c:86
 
SensorValue_t * get_time_value()
Read prepared value from RTC module.
Definition: module_time.c:135
 
Interface that defines list of functions with basic operation with memory.
Definition: memory_driver.h:86
 
FS_state file_store_data(SimpleFS_t *fs, uint8_t index, SensorValue_t *value)
Prepare measured value to file buffer.
Definition: sensor_FS.c:337
 
uint8_t get_sensor_data_length(ValueFormatMetaLength_t length_code)
Compute real data length (in bytes) from code length.
Definition: sensor.c:20