Files
motor/Common/i2c/EEprom_M24C64.h
T

30 lines
659 B
C
Raw Normal View History

2024-09-26 22:32:20 +08:00
#ifndef _M24C64_H_
#define _M24C64_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "I2CDevice.h"
#define HAL_EEP_M24C64_I2C_ADDR (0x50) //0xa0>>1
typedef struct eeprom_M24C64{
const char *name;
I2C_DEV_t *_dev;
} EEprom_M24C64_t;
extern bool EEprom_M24C64_init(EEprom_M24C64_t *eep, const char *name, I2C_DEV_t *dev);
extern bool EEprom_M24C64_read(EEprom_M24C64_t *eep, uint16_t offset, uint8_t* Buf, uint16_t Size);
extern bool EEprom_M24C64_write(EEprom_M24C64_t *eep, uint16_t Addr, uint8_t* Buf, uint16_t Size);
extern bool EEprom_M24C64_clear_sector(EEprom_M24C64_t *eep, uint32_t end_sector);
#ifdef __cplusplus
}
#endif
#endif