18 lines
833 B
C
18 lines
833 B
C
|
|
#ifndef __24C02_H
|
||
|
|
#define __24C02_H
|
||
|
|
|
||
|
|
#include "main.h"
|
||
|
|
|
||
|
|
#define M24C02_WADDR 0xA0 // 24C02 写地址
|
||
|
|
#define M24C02_RADDR 0xA1 // 24C02 读地址
|
||
|
|
|
||
|
|
|
||
|
|
uint8_t m24c02ReadOneByte(uint8_t ); // 从 24C02 指定地址读取一个字节
|
||
|
|
uint8_t m24c02WriteOneByte(uint8_t ,uint8_t ); // 向指定地址写入一个字节
|
||
|
|
uint8_t m24c02ReadSequential(uint8_t,uint8_t *,uint16_t); // 从指定地址连续读取指定长度数据
|
||
|
|
uint8_t eepromReadData(uint8_t ,void *, uint16_t); // 从 EEPROM 指定地址读取数据
|
||
|
|
uint8_t eepromWriteData(uint8_t, void *, uint16_t); // 向 EEPROM 指定地址写入数据(按页写入)
|
||
|
|
void eepromReadInfo(void); // 从 EEPROM 读取或验证 MQTT 配置信息
|
||
|
|
|
||
|
|
#endif
|