NULL
This commit is contained in:
50
user/Device/CAT24c512.h
Executable file
50
user/Device/CAT24c512.h
Executable file
@@ -0,0 +1,50 @@
|
||||
#ifndef __CAT24C512_H_
|
||||
#define __CAT24C512_H_
|
||||
#include "../MCU/lhl_gpio.h"
|
||||
#ifndef EEPROM_SIZE
|
||||
#define EEPROM_SIZE 65536
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MAX1 = 0x00,
|
||||
MAX2,
|
||||
MAX3
|
||||
}GPIO1_TypeDef;
|
||||
|
||||
#define WAIT_WRITE_OVER 5
|
||||
#define I2C_TIME_OUT 10
|
||||
|
||||
/******************************************************************************/
|
||||
#define EEPROM_WP_OUTPUT() EnableOutput(EEPROM_WP_GPIO, EEPROM_WP_PINPOS)
|
||||
#define SET_EEPROM_WP() SET_PIN(EEPROM_WP_GPIO, EEPROM_WP_PIN)
|
||||
#define CLR_EEPROM_WP() CLR_PIN(EEPROM_WP_GPIO, EEPROM_WP_PIN)
|
||||
#define DisableWriteEEPROM() SET_EEPROM_WP()
|
||||
#define EnableWriteEEPROM() CLR_EEPROM_WP()
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
extern u32 isReadParameterOK;
|
||||
//******************************************************************************
|
||||
void EEPROMInit(void);
|
||||
void WaitWriteOver(u8 eepromAdr);
|
||||
void WriteByteToEEPROM(u16 address, u8 wrtData, u8 eepromAdr);
|
||||
u8 ReadByteFromEEPROM(u16 address, u8 eepromAdr);
|
||||
void ResetWriteAddr(u16 address, u8 eepromAdr);
|
||||
void WriteMultiByteToEEPROM(u16 address, u8 *wrtData, u16 dataLenth, u8 eepromAdr);
|
||||
void ReadMultiByteFromEEPROM(u16 address, u8 *wrtData, u16 dataLenth, u8 eepromAdr);
|
||||
void ClearMultiByteToEEPROM(u16 address, u8 dataLenth, u8 eepromAdr);
|
||||
|
||||
|
||||
u16 ReadShortParameterFromEEPROM(u16 parameterAdr, u16 parameterDefault);
|
||||
u32 ReadLongParameterFromEEPROM(u16 parameterAdr, u32 parameterDefault);
|
||||
u16 WriteShortParameterToEEPROM(u16 WRAddr);
|
||||
u32 WriteLongParameterToEEPROM(u16 WRAddr);
|
||||
|
||||
|
||||
#if(!REC_ACC_USE_FRAM)
|
||||
//void WriteMultiByteToFRAM(u16 address, u8 *wrtData, u8 dataLenth);
|
||||
//void ReadMultiByteFromFRAM(u16 address, u8 *wrtData, u8 dataLenth);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user