/* ----- file I2C_BUS.H ----- */ /* Use it for interfacing the devices connected to the I2C-bus */ /* WARNING: This device-driver is NOT compatible with the following */ /* I2C-bus variants: */ /* - multi-master mode: only one master (the controller) with many slaves */ /* is supported */ /* - fast-mode operation: operating the I2C-bus with 400kbit/s is not */ /* supported */ /* - 10-bit addressing scheme: only 7-bit scheme is supported */ /* NOTE: If the SCL-line is output-only on this target, then the Slow-Down- */ /* Mode is not possible ! In this case set the Slow-Down-Mode value */ /* to ZERO ! */ #ifndef _I2C_BUS_H_ #define _I2C_BUS_H_ #ifndef _MISC_H_ #include "MISC.H" #endif #ifndef _I2C_HARD_H_ /* I2C-hardware interface */ #include "I2C_HARD.H" #endif #define I2C_SUCCESSFUL 0x00 #define I2C_NO_ACKNOWLEDGE 0xFE #define I2C_NOT_IMPLEMENTED 0xFF extern void I2CInit( void ); extern BYTE I2CWrite( BYTE *, BYTE, BYTE, WORD ); extern BYTE I2CRead( BYTE *, BYTE, BYTE, WORD ); extern void I2CStart( void ); extern void I2CStop( void ); extern void I2CSendAck( void ); extern BYTE I2CReceiveAck( void ); extern void I2CSendBit( BYTE ); extern BYTE I2CReceiveBit( void ); extern void I2CWriteByte( BYTE ); extern BYTE I2CReadByte( void ); #endif /* ----- end I2C_BUS.H ----- */