X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fhw%2Fhw_i2c_bitbang.h;fp=bertos%2Fhw%2Fhw_i2c_bitbang.h;h=e6f0b18e7ea4c48bfd5c78dff436ffa46363947c;hb=18d992e2630742a2bb49b6f9267515fd8ae6c886;hp=0000000000000000000000000000000000000000;hpb=60b28c97a62f39dcb90ce51401730917650324b3;p=bertos.git diff --git a/bertos/hw/hw_i2c_bitbang.h b/bertos/hw/hw_i2c_bitbang.h new file mode 100644 index 00000000..e6f0b18e --- /dev/null +++ b/bertos/hw/hw_i2c_bitbang.h @@ -0,0 +1,61 @@ +/** + * \file + * + * + * \brief Macro for I2C bitbang operation. + * + * + * \version $Id$ + * + * \author Francesco Sacchi + */ + +#ifndef HW_I2C_BITBANG_H +#define HW_I2C_BITBANG_H + +#warning TODO:This is an example implementation, you must implement it! + +#define SDA_HI /* Implement me:Set SDA High by setting SDA pin as input */ +#define SDA_LO /* Implement me:Set SDA Low by setting SDA pin as open collector output */ +#define SCL_HI /* Implement me:Set SCL High by setting SCL pin as input */ +#define SCL_LO /* Implement me:Set SCL Low by setting SCL pin as open collector output */ + + +#define SCL_IN (true) /* Implement me: read SDA pin state */ +#define SDA_IN (true) /* Implement me: read SCL pin state */ + +/** + * This macro should set SDA and SCL lines as input. + */ +#define I2C_BITBANG_HW_INIT /* Implement me! */ + +#endif /* HW_I2C_BITBANG_H */