32 lines
493 B
C
32 lines
493 B
C
/*
|
|
* eeprom.h
|
|
*
|
|
* Created on: Jun 7, 2017
|
|
* Author: wn
|
|
*/
|
|
|
|
#ifndef EEPROM_H_
|
|
#define EEPROM_H_
|
|
|
|
#include "stm32f1xx_hal.h"
|
|
|
|
|
|
#define STORAGE_ADDRESS 0x20
|
|
|
|
|
|
typedef struct {
|
|
uint32_t magic;
|
|
uint32_t savedTemperature;
|
|
uint32_t savedTime;
|
|
uint32_t operatingTime;
|
|
} tStorage;
|
|
|
|
|
|
void eepromWrite(uint16_t addr, uint8_t *buf, uint8_t len);
|
|
void eepromRead(uint16_t addr, uint8_t *buf, uint8_t len);
|
|
|
|
void eepromWriteStorage();
|
|
uint8_t eepromReadStorage();
|
|
|
|
#endif /* EEPROM_H_ */
|