00001 /*! \file i2csw.h \brief software-driven I2C interface using port pins. */ 00002 //***************************************************************************** 00003 // 00004 // File Name : 'i2csw.h' 00005 // Title : software-driven I2C interface using port pins 00006 // Author : Pascal Stang 00007 // Created : 11/22/2000 00008 // Revised : 5/2/2002 00009 // Version : 1.1 00010 // Target MCU : Atmel AVR series 00011 // Editor Tabs : 4 00012 // 00013 // This code is distributed under the GNU Public License 00014 // which can be found at http://www.gnu.org/licenses/gpl.txt 00015 // 00016 //***************************************************************************** 00017 00018 #ifndef I2CSW_H 00019 #define I2CSW_H 00020 00021 #include "global.h" 00022 00023 // include project-dependent settings 00024 #include "i2cswconf.h" 00025 00026 // defines and constants 00027 #define READ 0x01 // I2C READ bit 00028 00029 // functions 00030 00031 // initialize I2C interface pins 00032 void i2cInit(void); 00033 00034 // send I2C data to <device> register <sub> 00035 void i2cSend(BYTE device, BYTE sub, BYTE length, BYTE *data); 00036 00037 // receive I2C data from <device> register <sub> 00038 void i2cReceive(BYTE device, BYTE sub, BYTE length, BYTE *data); 00039 00040 #endif