|
|
|
|
#ifndef __24CXX_H
|
|
|
|
|
#define __24CXX_H
|
|
|
|
|
#include "myiic.h"
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD>ѧϰʹ<EFBFBD>ã<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD><EFBFBD>;
|
|
|
|
|
//ALIENTEKս<EFBFBD><EFBFBD>STM32<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//24CXX<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD>ʺ<EFBFBD>24C01~24C16,24C32~256δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>֤!)
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD>@ALIENTEK
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳:www.openedv.com
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:2012/9/9
|
|
|
|
|
//<EFBFBD>汾<EFBFBD><EFBFBD>V1.0
|
|
|
|
|
//<EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//Copyright(C) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿƼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾ 2009-2019
|
|
|
|
|
//All rights reserved
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#define AT24C01 127
|
|
|
|
|
#define AT24C02 255
|
|
|
|
|
#define AT24C04 511
|
|
|
|
|
#define AT24C08 1023
|
|
|
|
|
#define AT24C16 2047
|
|
|
|
|
#define AT24C32 4095
|
|
|
|
|
#define AT24C64 8191
|
|
|
|
|
#define AT24C128 16383
|
|
|
|
|
#define AT24C256 32767
|
|
|
|
|
//Mini STM32<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD>24c02<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>EE_TYPEΪAT24C02
|
|
|
|
|
#define EE_TYPE AT24C02
|
|
|
|
|
|
|
|
|
|
u8 AT24CXX_ReadOneByte(u16 ReadAddr); //ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>ȡһ<EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
void AT24CXX_WriteOneByte(u16 WriteAddr,u8 DataToWrite); //ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַд<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
void AT24CXX_WriteLenByte(u16 WriteAddr,u32 DataToWrite,u8 Len);//ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>ʼд<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
u32 AT24CXX_ReadLenByte(u16 ReadAddr,u8 Len); //ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void AT24CXX_Write(u16 WriteAddr,u8 *pBuffer,u16 NumToWrite); //<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>ʼд<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void AT24CXX_Read(u16 ReadAddr,u8 *pBuffer,u16 NumToRead); //<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
u8 AT24CXX_Check(void); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void AT24CXX_Init(void); //<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>IIC
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|