eeprom stuff
This commit is contained in:
31
cube/User/Inc/eeprom.h
Normal file
31
cube/User/Inc/eeprom.h
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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();
|
||||
int eepromReadStorage();
|
||||
|
||||
#endif /* EEPROM_H_ */
|
Reference in New Issue
Block a user