Lines Matching defs:data

32 typedef inv_error_t (*load_func_t)(const unsigned char *data);
33 typedef inv_error_t (*save_func_t)(unsigned char *data);
45 size_t total_size; /**< Size in bytes to store non volatile data */
46 load_func_t load[NUM_STORAGE_BOXES]; /**< Callback to load data */
47 save_func_t save[NUM_STORAGE_BOXES]; /**< Callback to save data */
60 /** Used to register your mechanism to load and store non-volative data. This should typical be
62 * @param[in] load_func function pointer you will use to receive data that was stored for you.
63 * @param[in] save_func function pointer you will use to save any data you want saved to
65 * @param[in] size The size in bytes of the amount of data you want loaded and saved.
66 * @param[in] key The key associated with your data type should be unique across MPL.
67 * The key should change when your type of data for storage changes.
70 inv_error_t inv_register_load_store(inv_error_t (*load_func)(const unsigned char *data),
71 inv_error_t (*save_func)(unsigned char *data), size_t size, unsigned int key)
120 /** This function takes a block of data that has been saved in non-volatile memory and pushes
121 * to the proper locations. Multiple error checks are performed on the data.
122 * @param[in] data Data that was saved to be loaded up by MPL
123 * @param[in] length Length of data vector in bytes
126 inv_error_t inv_load_mpl_states(const unsigned char *data, size_t length)
134 if (data == NULL || len == 0)
137 return INV_ERROR_CALIBRATION_LOAD; // No data
138 hd = (struct data_header_t *)data;
140 return INV_ERROR_CALIBRATION_LOAD; // Key changed or data corruption
144 data += sizeof(struct data_header_t);
145 checksum = inv_checksum(data, len);
150 hd = (struct data_header_t *)data;
152 data += sizeof(struct data_header_t);
157 checksum = inv_checksum(data, hd->size);
160 ds.load[entry](data);
164 data = data + hd->size;
171 * @param[out] data Place to store data, size of sz, must be at least size
173 * @param[in] sz Size of data.
176 inv_error_t inv_save_mpl_states(unsigned char *data, size_t sz)
182 if (data == NULL || sz == 0)
185 cur = data + sizeof(struct data_header_t);
199 hd = (struct data_header_t *)data;
200 hd->checksum = inv_checksum(data + sizeof(struct data_header_t),