PIC18 LaurTec Library  3.1.1
Open Source C Library for PIC18 Microcontrollers based on C18 - XC8 Compilers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
i2cEEPROM.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3 Author : Mauro Laurenti
4 Version : 1.2
5 
6 Created on Date : 04/09/2006
7 Last update : 30/04/2013
8 
9 CopyRight 2006-2013 all rights are reserved
10 
11 ********************************************************
12 SOFTWARE LICENSE AGREEMENT
13 ********************************************************
14 
15 The usage of the supplied software imply the acceptance of the following license.
16 
17 The software supplied herewith by Mauro Laurenti (the Author) is intended for
18 use solely and exclusively on Microchip PIC Microcontroller (registered mark).
19 The software is owned by the Author, and is protected under applicable
20 copyright laws. All rights are reserved.
21 Any use in violation of the foregoing restrictions may subject the
22 user to criminal sanctions under applicable laws, as well as to civil liability
23 for the breach of the terms and conditions of this license.
24 Commercial use is forbidden without a written acknowledgment with the Author.
25 Personal or educational use is allowed if the application containing the
26 following software doesn't aim to commercial use or monetary earning of any kind.
27 
28 THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES,
29 WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
30 TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
31 PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE AUTHOR SHALL NOT,
32 IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
33 CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
34 
35 
36 ********************************************************
37 PURPOSES
38 ********************************************************
39 
40 These functions allow the user to read/write inside the eeprom
41 that requires 2 address bytes such as the 24LC512.
42 
43 ********************************************************************************/
44 
45 #ifndef I2C_EEPROM_H
46 #define I2C_EEPROM_H
47 
48 #ifdef __XC8
49  #include <xc.h>
50  #ifndef _PIC18
51  #error "The i2cEEPROM Library supports only PIC18 devices"
52  #endif
53 #endif
54 
55 #ifdef __18CXX
56  #include <i2c.h>
57 #endif
58 
59 #include <delay.h>
60 
61 
79 signed char write_I2C_EEPROM( unsigned char control, unsigned int address, unsigned char data );
80 
81 
102 signed char write_I2C_EEPROM_check( unsigned char control, unsigned int address, unsigned char data );
103 
104 
124 signed char read_I2C_EEPROM( unsigned char control, unsigned int address, unsigned char *data );
125 
126 #endif