Main Page   Modules   Data Structures   File List   Data Fields   Globals  

i2csw.c File Reference

Software-driven I2C interface using port pins. More...

#include <avr/io.h>
#include "i2csw.h"

Go to the source code of this file.

Defines

#define QDEL   asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop");
#define HDEL   asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop"); asm volatile("nop");
#define I2C_SDL_LO   cbi( SDAPORT, SDA)
#define I2C_SDL_HI   sbi( SDAPORT, SDA)
#define I2C_SCL_LO   cbi( SCLPORT, SCL);
#define I2C_SCL_HI   sbi( SCLPORT, SCL);
#define I2C_SCL_TOGGLE   HDEL; I2C_SCL_HI; HDEL; I2C_SCL_LO;
#define I2C_START   I2C_SDL_LO; QDEL; I2C_SCL_LO;
#define I2C_STOP   HDEL; I2C_SCL_HI; QDEL; I2C_SDL_HI; HDEL;

Functions

UINT i2cPutbyte (u08 b)
u08 i2cGetbyte (UINT last)
void i2cInit (void)
 Initialize I2C EEPROM interface.

void i2cSend (u08 device, u08 subAddr, u08 length, u08 *data)
 Send a byte sequence on the I2C bus.

void i2cReceive (u08 device, u08 subAddr, u08 length, u08 *data)
 Retrieve a byte sequence on the I2C bus.


Detailed Description

Software-driven I2C interface using port pins.

Definition in file i2csw.c.


Generated on Sun Feb 22 19:12:31 2004 for Procyon AVRlib by doxygen1.3-rc2