PIC18 LaurTec Library
3.0 Beta
Open Source C Library for PIC18 Microcontrollers based on C18 - XC8 Compilers
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
PCF8574.h
Go to the documentation of this file.
1
/*******************************************************************************
2
3
Author : Mauro Laurenti
4
Version : 1.1
5
Created on Date : 19/03/2011
6
Last update : 02/02/2013
7
8
CopyRight 2006/2011 all rights are reserved
9
10
********************************************************
11
SOFTWARE LICENSE AGREEMENT
12
********************************************************
13
14
The usage of the supplied software imply the acceptance of the following license.
15
16
The software supplied herewith by Mauro Laurenti (the Author) is intended for
17
use solely and exclusively on Microchip PIC Microcontroller (registered mark).
18
The software is owned by the Author, and is protected under applicable
19
copyright laws. All rights are reserved.
20
Any use in violation of the foregoing restrictions may subject the
21
user to criminal sanctions under applicable laws, as well as to civil liability
22
for the breach of the terms and conditions of this license.
23
Commercial use is forbidden without a written acknowledgment with the Author.
24
Personal or educational use is allowed if the application containing the
25
following software doesn't aim to commercial use or monetary earning of any kind.
26
27
THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES,
28
WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
29
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
30
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE AUTHOR SHALL NOT,
31
IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
32
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
33
34
********************************************************
35
PURPOSES
36
********************************************************
37
38
These functions allow the user to read/write to the data
39
port of the I2C I/O exender PCF8574.
40
Either PCF8574 or PCF8574A can be used. The user must use the
41
proper address calling the functions.
42
43
PCF8574 Address : 0100xxx0
44
PCF8574A Address : 0111xxx0
45
46
xxx = A2 A1 A0 (External Address Pins)
47
48
*******************************************************************************/
49
50
#ifndef PCF8574_H
51
#define PCF8574_H
52
53
54
#ifdef __XC8
55
#include <xc.h>
56
#ifndef _PIC18
57
#error "The PCF8574 Library supports only PIC18 devices"
58
#endif
59
#endif
60
61
#ifdef __18CXX
62
#include <i2c.h>
63
#endif
64
65
85
signed
char
PCF8574_write_data
(
unsigned
char
control,
unsigned
char
data );
86
87
107
signed
char
PCF8574_read_data
(
unsigned
char
control,
unsigned
char
*data);
108
109
110
111
#endif
LaurTec_PIC_libraries_v_3.0
inc
PCF8574.h
Generated on Fri Feb 8 2013 23:22:49 for PIC18 LaurTec Library by
1.8.3.1