12345678910111213141516171819202122232425 |
- #ifndef __EEPROM_H
- #define __EEPROM_H
- #include "stm32f1xx_hal.h"
- #include "crc_cal.h"
- #include "var.h"
- #define EEPROM_BEGIN_ADDRESS 0x0800FC00
- #define EEPROM_END_ADDRESS 0x0800FFFF
- #define EEPROM_FLAG_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)0 //Flash数据写入标志 4bytes + 4bytes
- #define EEPROM_CHECK_CODE_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)8 //校验码 12bytes + 4bytes
- #define EEPROM_USER_PARAM_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)24 //出厂参数 16bytes + 4bytes
- #define EEPROM_MODE_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)44 //型号 16bytes + 4bytes
- #define EEPROM_SN_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)64 //序列号 16bytes + 4bytes
- #define EEPROM_MAC_INFO_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)84 //生产信息 32bytes + 4bytes
- #define EEPROM_LOG_INFO_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)120 //历史信息 16bytes + 4bytes
- #define EEPROM_USER_INFO1_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)140 //自定义字符串1 16bytes + 4bytes
- #define EEPROM_USER_INFO2_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)160 //自定义字符串2 16bytes + 4bytes
- #define EEPROM_USER_INFO3_ADDR_OFFSET EEPROM_BEGIN_ADDRESS + (uint32_t)180 //自定义字符串3 16bytes + 4bytes
- extern void EEPROM_Check(void);
- extern void EEPROM_DataUpdate(void);
- #endif
|