at24c512.h

来自「ARM入门的好帮手.包含了从简单到相对较复杂的程序.」· C头文件 代码 · 共 51 行

H
51
字号
//*---------------------------------------------------------------------------
//*         ATMEL Microcontroller Software Support  -  ROUSSET  -
//*---------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*---------------------------------------------------------------------------
//* File Name           : at24c512.h
//* Object              : Serial EEPROM Atmel AT24C512 Driver.
//*
//* 1.0 03/06/00 PF     : Creation
//* 1.1 15/01/02 JPP    : Clean
//*---------------------------------------------------------------------------

#ifndef at24c512_h
#define at24c512_h

#include    "drivers/lib_i2c/lib_i2c.h"     //* prototype IC2 function & struc

/*---------------------------  Constants definition -------------------------*/
#define     AT24C512_I2C_ADDRESS        0xA0        //* at24c512 I2C address

//* The write cycle time AT24C512_TWR is the time from a valid stop condition
//* of a write sequence to the end of the internal clear/write cycle.

#define     AT24C512_TWR                10          //* 10 ms for VCC >= 2.7 V

#define     AT24C512_PAGE_LENGTH        128         //* at24c512 structure
#define     AT24C512_NB_PAGE            512
#define     AT24C512_EPROM_SIZE         (AT24C512_NB_PAGE*AT24C512_PAGE_LENGTH) //* 64 Kbyte

/*---------------------------  Structure definition -------------------------*/

extern      I2Cdesc     I2C_line ;

/*---------------------------  Function Prototyping -------------------------*/

extern void tc0_interrupt_handler(void) ;
extern void no_handler_tc (I2Cdesc *I2C_pt) ;

//* export Function
extern void at24_Init( u_int speed );
extern void at24_TransfertEnd(void);
extern void at24_Write(u_short address, u_char *data_array, u_int num_bytes ) ;
extern void at24_Read( u_short address, u_char *data_array, u_int num_bytes ) ;

extern void at91_I2CError(I2Cdesc *I2C_pt) ;

#endif /* at24c512_h */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?