📄 lib24c16.h
字号:
//**********************************************************************
//* PROJECT: Library for 24c01/02/04/08/16 serial EEPROM
//* Copyright (C) 2003, Pedro Ignacio Martos (pi_martos@hotmail.com)
//**********************************************************************
//* FILE: lib24c16.h
//**********************************************************************
//* CHANGES:
//* date author description
//* --------------------------------------------------------------------
//* 07/29/03 pmartos (pi_martos@hotmail.com) initial release
//**********************************************************************
//* DESCRIPTION:
//* This file contains a simple read/write routines for I2C EEPROMS up
//* to 2KBytes; based on AN 614 from Microchip
//* (http://www.microchip.com)
//**********************************************************************
// This file is part of lib24c16
//*
//* lib24c16 is free software; you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation; either version 2 of the License, or
//* (at your option) any later version.
//*
//* lib24c16 is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with lib24c16; if not, write to the Free Software
//* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
//* USA
//**********************************************************************
//* FUNCTIONS DECLARED:
//* void weeprom (char page, char direction, char datum);
//* char reeprom (char page, char direction);
//**********************************************************************
//* NOTES:
//* you need to define the port pins where the memory is connected like
//* this:
//* bit at 0x90 SCK; // P1_0 = EEPROM SCK
//* bit at 0x91 SDA; // P1_1 = EEPROM SDA
//*
//* - For parts other than 24c16, 'page' must be set according to the
//* logical values in pins A0, A1 & A2 (see particular datasheet)
//* - Remember the 10mS busy time in writing cycle
//* - The routines closely resembles the assembler code of the AN
//**********************************************************************
//* COMPILE TIME OPTIONS: sdcc.exe <filename.c> lib24c16.rel
//* DEBUG OPTIONS: None
//**********************************************************************
//* TO DO:
//* - add a conditional to avoid multiple definition
//**********************************************************************
// Prototipe declaration
void weeprom (char page, char direccion, char dato);
char reeprom (char page, char direccion);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -