OSDN Git Service

[SCHEMATIC] Modify SW/MW/LW Preamp, insert galbanic-isolator replace of common-mode...
[openi2cradio/OpenI2CRadio.git] / i2c_eeprom.h
1 /*
2  * OpenI2CRADIO
3  * I2C EEPROM Handler
4  * Copyright (C) 2013-08-25 K.Ohta <whatisthis.sowhat at gmail.com>
5  * License: GPL2+LE
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2,
10  *  or (at your option) any later version.
11  *  This library / program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  *  See the GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this library; see the file COPYING. If not, write to the
18  *  Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
19  *  MA 02110-1301, USA.
20  *
21  *  As a special exception, if you link this(includeed from sdcc) library
22  *  with other files, some of which are compiled with SDCC,
23  *  to produce an executable, this library does not by itself cause
24  *  the resulting executable to be covered by the GNU General Public License.
25  *  This exception does not however invalidate any other reasons why
26  *  the executable file might be covered by the GNU General Public License.
27  */
28
29 #ifndef I2C_EEPROM_H
30 #define I2C_EEPROM_H
31
32
33
34 #include <stdarg.h>
35 #include <stdio.h>
36 #ifdef __SDCC
37 #include <delay.h>
38 #include <pic18fregs.h>
39 #endif
40
41 #include "i2c_io.h"
42 #include "idle.h"
43
44
45
46 #ifdef  __cplusplus
47 extern "C" {
48 #endif
49
50 #define I2CEEPROM_ADDR 0xa0
51 #define I2C_ROM_PAGE_SIZE 32
52
53
54
55 extern unsigned char i2c_eeprom_bytewrite(unsigned char i2caddr, unsigned int addr, unsigned char data);
56 extern unsigned char i2c_eeprom_byteread(unsigned char i2caddr, unsigned int addr);
57 extern unsigned char i2c_eeprom_burstwrite(unsigned char i2caddr, unsigned int addr, unsigned char *data, unsigned int bytes);
58 extern unsigned char i2c_eeprom_burstread(unsigned char i2caddr, unsigned int addr, unsigned char *data, unsigned int bytes);
59
60
61
62 #ifdef  __cplusplus
63 }
64 #endif
65
66 #endif  /* I2C_EEPROM_H */
67