25 lines
627 B
C
25 lines
627 B
C
#ifndef EEPROM_H_
|
|
#define EEPROM_H_
|
|
|
|
#include <stdint.h>
|
|
#include <spi.h>
|
|
#include <config.h>
|
|
|
|
|
|
typedef struct __attribute__((__packed__)) s_deviceStats {
|
|
uint32_t totalRunningHours;
|
|
uint32_t totalPowercycles;
|
|
uint32_t totalRequests;
|
|
uint32_t totalFailures;
|
|
} t_deviceStats;
|
|
|
|
void eepromInit();
|
|
void eepromWrite(uint16_t addr, uint8_t *buf, uint8_t len);
|
|
void eepromRead(uint16_t addr, uint8_t *buf, uint8_t len);
|
|
void eepromSpiTxCpltCallback(SPI_HandleTypeDef *hspi);
|
|
t_deviceStats* getGlobalDeviceStats();
|
|
void eepromReadConfigBlock(uint8_t blockNum, t_configBlock *destConfigBlock);
|
|
|
|
|
|
#endif /* EEPROM_H_ */
|