X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Fbenchmark%2Fkernel-core_avr%2Fhw%2Fhw_i2c_bitbang.h;fp=examples%2Fbenchmark%2Fkernel-core_avr%2Fhw%2Fhw_i2c_bitbang.h;h=4822af7c81462edea4647179aa79f75e0513df2e;hb=a86a8b231ae610974f053b1d2bd9172582f60a25;hp=0000000000000000000000000000000000000000;hpb=1d10dbcdf05ceaf77f1f6a394e6ee63050d6c89a;p=bertos.git diff --git a/examples/benchmark/kernel-core_avr/hw/hw_i2c_bitbang.h b/examples/benchmark/kernel-core_avr/hw/hw_i2c_bitbang.h new file mode 100644 index 00000000..4822af7c --- /dev/null +++ b/examples/benchmark/kernel-core_avr/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 */