diff options
author | Paul Brook | 2009-11-21 00:37:15 +0100 |
---|---|---|
committer | Paul Brook | 2009-11-22 22:27:40 +0100 |
commit | 3cd035d863bd516a2967810c22258d82535c051f (patch) | |
tree | fdbd357881c1df41ca0928ec54c42a6cfe0bdd28 /hw/bitbang_i2c.h | |
parent | DS1338 RTC (diff) | |
download | qemu-3cd035d863bd516a2967810c22258d82535c051f.tar.gz qemu-3cd035d863bd516a2967810c22258d82535c051f.tar.xz qemu-3cd035d863bd516a2967810c22258d82535c051f.zip |
GPIO I2C rework
Reqrite bitbanging I2C implementation. New code improves stop/start
condition handling, and gives more accurate input line level.
Introduce intermediate abstraction layer for I2C bitbanging that
is not connected via a GPIO port.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/bitbang_i2c.h')
-rw-r--r-- | hw/bitbang_i2c.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/bitbang_i2c.h b/hw/bitbang_i2c.h new file mode 100644 index 0000000000..519d2dc22f --- /dev/null +++ b/hw/bitbang_i2c.h @@ -0,0 +1,14 @@ +#ifndef BITBANG_I2C_H +#define BITBANG_I2C_H + +#include "i2c.h" + +typedef struct bitbang_i2c_interface bitbang_i2c_interface; + +#define BITBANG_I2C_SDA 0 +#define BITBANG_I2C_SCL 1 + +bitbang_i2c_interface *bitbang_i2c_init(i2c_bus *bus); +int bitbang_i2c_set(bitbang_i2c_interface *i2c, int line, int level); + +#endif |