第一版代码,为了在EEPROM保存参数的时候走STM32的CRC,让Codex修改了一下,现在的效果是无法存储,codex表示原因是CRC方法不同,修改到一半今天的额度使用完了,有待后续解决CRC的bug
This commit is contained in:
27
Interface/Int_EEPROM24xx.h
Normal file
27
Interface/Int_EEPROM24xx.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef INT_EEPROM24XX_H
|
||||
#define INT_EEPROM24XX_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
#define INT_EEPROM_OK 0
|
||||
#define INT_EEPROM_ERR_ARG -1
|
||||
#define INT_EEPROM_ERR_IO -2
|
||||
#define INT_EEPROM_ERR_NOT_INIT -3
|
||||
#define INT_EEPROM_ERR_RANGE -4
|
||||
|
||||
/* Compile-time configuration for M24C64 on this board. */
|
||||
#define INT_EEPROM24XX_DEV_ADDR (0x50u << 1)
|
||||
#define INT_EEPROM24XX_I2C_HANDLE hi2c2
|
||||
#define INT_EEPROM24XX_PAGE_SIZE 32u
|
||||
#define INT_EEPROM24XX_MEM_ADDR_SIZE 2u
|
||||
#define INT_EEPROM24XX_MEM_SIZE_BYTES 8192u
|
||||
#define INT_EEPROM24XX_WRITE_CYCLE_MS 20u
|
||||
#define INT_EEPROM24XX_TIMEOUT_MS 100u
|
||||
|
||||
int32_t Int_EEPROM24xx_Init(void);
|
||||
int32_t Int_EEPROM24xx_Read(uint32_t mem_addr, uint8_t *buf, uint16_t len);
|
||||
int32_t Int_EEPROM24xx_Write(uint32_t mem_addr, const uint8_t *buf, uint16_t len);
|
||||
uint32_t Int_EEPROM24xx_GetLastHalError(void);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user