⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 at24c512.h

📁 ARM入门的好帮手.包含了从简单到相对较复杂的程序.
💻 H
字号:
//*---------------------------------------------------------------------------
//*         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
//* 1.2 04/02/02 PFi    : Parameter PIO_DESC added to at24_Init function
//*                     : mck variable added to at24_Write function.
//*---------------------------------------------------------------------------

#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( const PioCtrlDesc *pio_pt, u_int speed, u_int sda, u_int scl );
extern void at24_TransfertEnd(void);
extern void at24_Write(u_short address, u_char *data_array, u_int num_bytes, u_int mck ) ;
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -