www.pudn.com > iccavr_lib.rar > at25.h, change:1999-08-25,size:891b
/* ** Header file : at25.h */ #ifndef __AT25__H #define __AT25__H /* ** Constants for the /CS signal on the SPI EEPROM ** In this case the PB4 (/SS) pin is used. */ #define AT25Enable PORTB &= 0xE0 #define AT25Disable PORTB |= 0x10 /* ** Constants for the status register. */ #define BLOCK_PROTECT_NONE 0x00 #define BLOCK_PROTECT_QUARTER 0x04 #define BLOCK_PROTECT_HALF 0x08 #define BLOCK_PROTECT_ALL 0x0C #define WRITE_PROTECT_ENABLE 0x80 #define WRITE_ENABLE 0x02 #define WRITE_CYCLE_IN_PROGRESS 0x01 void AT25Init(void); void AT25WriteEnable( void); void AT25WriteDisable(void); unsigned char AT25ReadStatusReg(void); void AT25WriteStatusReg(unsigned char); unsigned char AT25Read(unsigned int); void AT25Write(unsigned int, unsigned char); #endif /* ** End of Header file */