23 #ifndef INCLUDED_I2C_BITBANG_H
24 #define INCLUDED_I2C_BITBANG_H
42 bool write (
int addr,
const unsigned char *buf,
int nbytes);
45 int read (
int addr,
unsigned char *buf,
int max_bytes);
51 void write_bit (
bool bit);
52 bool write_byte (
char byte);
54 void set_sda (
bool bit) { d_io->set_sda (bit); }
55 void set_scl (
bool bit) { d_io->set_scl (bit); }
56 bool get_sda () {
return d_io->get_sda (); }
virtual int read(int addr, unsigned char *buf, int max_bytes)=0
abstract class for controlling i2c bus
Definition: i2c.h:35
class for controlling i2c bus
Definition: i2c_bitbang.h:34
#define GR_CORE_API
Definition: gr_core_api.h:30
virtual bool write(int addr, const unsigned char *buf, int nbytes)=0
GR_CORE_API i2c_sptr make_i2c_bitbang(i2c_bbio_sptr io)
~i2c_bitbang()
Definition: i2c_bitbang.h:39