X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=boards%2Fstm32-p103%2Fhw%2Fhw_i2c_bitbang.h;fp=boards%2Fstm32-p103%2Fhw%2Fhw_i2c_bitbang.h;h=4822af7c81462edea4647179aa79f75e0513df2e;hb=a256e501c16b63a423267f8621d6bdcda20d3f3a;hp=0000000000000000000000000000000000000000;hpb=316505254b7c56603441d01182c5e71470f1a3ff;p=bertos.git diff --git a/boards/stm32-p103/hw/hw_i2c_bitbang.h b/boards/stm32-p103/hw/hw_i2c_bitbang.h new file mode 100644 index 00000000..4822af7c --- /dev/null +++ b/boards/stm32-p103/hw/hw_i2c_bitbang.h @@ -0,0 +1,66 @@ +/** + * \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 do { /* Implement me:Set SDA High by setting SDA pin as input */ } while (0) +#define SDA_LO do { /* Implement me:Set SDA Low by setting SDA pin as open collector output */ } while (0) +#define SCL_HI do { /* Implement me:Set SCL High by setting SCL pin as input */ } while (0) +#define SCL_LO do { /* Implement me:Set SCL Low by setting SCL pin as open collector output */ } while (0) + + +#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 do { /* Implement me! */ } while (0) + +/** + * Half bit delay routine used to generate the correct timings. + */ +#define I2C_HALFBIT_DELAY() do { /* Implement me! */ } while (0) + +#endif /* HW_I2C_BITBANG_H */