CANopenLinux
CANopenNode on Linux devices
|
Data initialize, store and restore functions with Linux. More...
Files | |
file | CO_storageLinux.h |
CANopen data storage object for Linux. | |
Functions | |
CO_ReturnError_t | CO_storageLinux_init (CO_storage_t *storage, CO_CANmodule_t *CANmodule, OD_entry_t *OD_1010_StoreParameters, OD_entry_t *OD_1011_RestoreDefaultParam, CO_storage_entry_t *entries, uint8_t entriesCount, uint32_t *storageInitError) |
Initialize data storage object (Linux specific) | |
uint32_t | CO_storageLinux_auto_process (CO_storage_t *storage, bool_t closeFiles) |
Automatically save data if differs from previous call. | |
Data initialize, store and restore functions with Linux.
See also Data storage base.
CO_ReturnError_t CO_storageLinux_init | ( | CO_storage_t * | storage, |
CO_CANmodule_t * | CANmodule, | ||
OD_entry_t * | OD_1010_StoreParameters, | ||
OD_entry_t * | OD_1011_RestoreDefaultParam, | ||
CO_storage_entry_t * | entries, | ||
uint8_t | entriesCount, | ||
uint32_t * | storageInitError ) |
Initialize data storage object (Linux specific)
This function should be called by application after the program startup, before CO_CANopenInit(). This function initializes storage object, OD extensions on objects 1010 and 1011, reads data from file, verifies them and writes data to addresses specified inside entries. This function internally calls CO_storage_init().
storage | This object will be initialized. It must be defined by application and must exist permanently. | |
CANmodule | CAN device, used for CO_LOCK_OD() macro. | |
OD_1010_StoreParameters | OD entry for 0x1010 -"Store parameters". Entry is optional, may be NULL. | |
OD_1011_RestoreDefaultParam | OD entry for 0x1011 -"Restore default parameters". Entry is optional, may be NULL. | |
entries | Pointer to array of storage entries, see CO_storage_init. | |
entriesCount | Count of storage entries | |
[out] | storageInitError | If function returns CO_ERROR_DATA_CORRUPT, then this variable contains a bit mask from subIndexOD values, where data was not properly initialized. If other error, then this variable contains index or erroneous entry. |
uint32_t CO_storageLinux_auto_process | ( | CO_storage_t * | storage, |
bool_t | closeFiles ) |
Automatically save data if differs from previous call.
Should be called cyclically by program. Each interval it verifies, if crc checksum of data differs from previous checksum. If it does, data are saved into pre-opened file.
storage | This object |
closeFiles | If true, then all files will be closed. Use on end of the program. |