Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#ifndef wire_h
#define wire_h
#define MAX_BUFFER 4
void i2c_master(void);
void i2c_slave(uint8_t address);
void i2c_beginTransmission(uint8_t address);
uint8_t i2c_endTransmission(uint8_t sentStop);
uint8_t i2c_writeByte(uint8_t data);
uint8_t i2c_writeBytes(uint8_t *data, uint8_t bytes);
void i2c_onReceiveService(uint8_t* inBytes, int numBytes);
void i2c_onRequestService(void);
void i2c_onReceive( void(*function)(uint8_t));
void i2c_onRequest( void(*function)(void));
struct {
uint8_t rxBuffer[MAX_BUFFER];
uint8_t rxBufferIndex;
uint8_t rxBufferLength;
uint8_t txAddress;
uint8_t txBuffer[MAX_BUFFER];
uint8_t txBufferIndex;
uint8_t txBufferLength;
void (*user_onRequest)(void);
void (*user_onReceive)(uint8_t);
union {
uint8_t internal;
struct {
uint8_t transmitting:1;
uint8_t rved:7;
};
};
} wire;
#endif