CANopenNode
CO_OD_storage.h
Go to the documentation of this file.
1 
27 #ifndef CO_OD_STORAGE_H
28 #define CO_OD_STORAGE_H
29 
30 
31 #include "301/CO_driver.h"
32 #include "301/CO_SDOserver.h"
33 
34 #include <stdio.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
52 CO_SDO_abortCode_t CO_ODF_1010(CO_ODF_arg_t *ODF_arg);
53 
57 CO_SDO_abortCode_t CO_ODF_1011(CO_ODF_arg_t *ODF_arg);
58 
59 
76  uint8_t *odAddress,
77  uint32_t odSize,
78  char *filename);
79 
80 
97 int CO_OD_storage_restoreSecure(char *filename);
98 
99 
105 typedef struct {
108  char *filename;
110  FILE *fp;
113 
114 
131  CO_OD_storage_t *odStor,
132  uint8_t *odAddress,
133  uint32_t odSize,
134  char *filename);
135 
136 
153  CO_OD_storage_t *odStor,
154  uint32_t timer1usDiff,
155  uint32_t delay_us);
156 
157 
164 
167 #ifdef __cplusplus
168 }
169 #endif /* __cplusplus */
170 
171 #endif /* CO_OD_STORAGE_H */
uint32_t
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
CO_driver.h
Interface between CAN hardware and CANopenNode.
CO_OD_storage_restoreSecure
int CO_OD_storage_restoreSecure(char *filename)
Remove OD storage file.
Definition: CO_OD_storage.c:181
CO_OD_storage_autoSave
CO_ReturnError_t CO_OD_storage_autoSave(CO_OD_storage_t *odStor, uint32_t timer1usDiff, uint32_t delay_us)
Automatically save memory block if differs from file.
Definition: CO_OD_storage.c:292
CO_OD_storage_t
Object Dictionary storage object.
Definition: CO_OD_storage.h:105
CO_ODF_1010
CO_SDO_abortCode_t CO_ODF_1010(CO_ODF_arg_t *ODF_arg)
Callback for use inside CO_OD_configure() function for OD object 1010.
Definition: CO_OD_storage.c:42
CO_ReturnError_t
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
CO_OD_storage_t::odAddress
uint8_t * odAddress
From CO_OD_storage_init()
Definition: CO_OD_storage.h:106
CO_OD_storage_saveSecure
int CO_OD_storage_saveSecure(uint8_t *odAddress, uint32_t odSize, char *filename)
Save memory block to a file.
Definition: CO_OD_storage.c:102
CO_OD_storage_autoSaveClose
void CO_OD_storage_autoSaveClose(CO_OD_storage_t *odStor)
Closes file opened by CO_OD_storage_autoSave.
Definition: CO_OD_storage.c:369
CO_SDOserver.h
CANopen Service Data Object - server protocol.
CO_OD_storage_init
CO_ReturnError_t CO_OD_storage_init(CO_OD_storage_t *odStor, uint8_t *odAddress, uint32_t odSize, char *filename)
Initialize OD storage object and load data from file.
Definition: CO_OD_storage.c:224
CO_ODF_1011
CO_SDO_abortCode_t CO_ODF_1011(CO_ODF_arg_t *ODF_arg)
Callback for use inside CO_OD_configure() function for OD object 1011.
Definition: CO_OD_storage.c:72
CO_SDO_abortCode_t
CO_SDO_abortCode_t
SDO abort codes.
Definition: CO_SDOserver.h:333
CO_OD_storage_t::fp
FILE * fp
If CO_OD_storage_autoSave() is used, file stays opened and fp is stored here.
Definition: CO_OD_storage.h:110
CO_OD_storage_t::lastSavedUs
uint32_t lastSavedUs
used with CO_OD_storage_autoSave.
Definition: CO_OD_storage.h:111
CO_OD_storage_t::odSize
uint32_t odSize
From CO_OD_storage_init()
Definition: CO_OD_storage.h:107
CO_OD_storage_t::filename
char * filename
From CO_OD_storage_init()
Definition: CO_OD_storage.h:108
uint8_t
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151