2020-11-04 23:46:55 +01:00
|
|
|
#ifndef EEPROM_H_
|
|
|
|
#define EEPROM_H_
|
|
|
|
|
2020-11-05 13:05:19 +01:00
|
|
|
#include <stdint.h>
|
2020-11-05 14:38:10 +01:00
|
|
|
#include <spi.h>
|
2020-11-04 23:46:55 +01:00
|
|
|
|
2020-11-20 12:32:00 +01:00
|
|
|
|
|
|
|
typedef struct __attribute__((__packed__)) s_deviceStats {
|
|
|
|
uint32_t totalRunningHours;
|
|
|
|
uint32_t totalPowercycles;
|
|
|
|
uint32_t totalRequests;
|
|
|
|
uint32_t totalFailures;
|
|
|
|
} t_deviceStats;
|
|
|
|
|
2020-11-05 14:38:10 +01:00
|
|
|
void eepromInit();
|
2020-11-04 23:46:55 +01:00
|
|
|
void eepromWrite(uint16_t addr, uint8_t *buf, uint8_t len);
|
|
|
|
void eepromRead(uint16_t addr, uint8_t *buf, uint8_t len);
|
2020-11-05 14:38:10 +01:00
|
|
|
void eepromSpiTxCpltCallback(SPI_HandleTypeDef *hspi);
|
2020-11-20 12:32:00 +01:00
|
|
|
t_deviceStats* getGlobalDeviceStats();
|
2020-11-05 14:38:10 +01:00
|
|
|
|
2020-11-04 23:46:55 +01:00
|
|
|
#endif /* EEPROM_H_ */
|