I2CLCD
HD4470 LCD driver via I2C interface
 All Functions Groups Pages
D:/Projekte/AVR/i2clcd/i2cmaster.h
1 #ifndef _I2CMASTER_H
2 #define _I2CMASTER_H 1
3 /*************************************************************************
4 * Title: C include file for the I2C master interface
5 * (i2cmaster.S or twimaster.c)
6 * Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
7 * File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $
8 * Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
9 * Target: any AVR device
10 * Usage: see Doxygen manual
11 **************************************************************************/
12 
13 #ifdef DOXYGEN
14 
80 #endif /* DOXYGEN */
81 
84 #if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
85 #error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
86 #endif
87 
88 #include <avr/io.h>
89 
91 #define I2C_READ 1
92 
94 #define I2C_WRITE 0
95 
96 
102 extern void i2c_init(void);
103 
104 
110 extern void i2c_stop(void);
111 
112 
120 extern unsigned char i2c_start(unsigned char addr);
121 
122 
130 extern unsigned char i2c_rep_start(unsigned char addr);
131 
132 
140 extern void i2c_start_wait(unsigned char addr);
141 
142 
149 extern unsigned char i2c_write(unsigned char data);
150 
151 
156 extern unsigned char i2c_readAck(void);
157 
162 extern unsigned char i2c_readNak(void);
163 
173 extern unsigned char i2c_read(unsigned char ack);
174 #define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
175 
176 
178 #endif