X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Flpc2378%2Fhw%2Fhw_i2c_bitbang.h;fp=examples%2Flpc2378%2Fhw%2Fhw_i2c_bitbang.h;h=743e28b70e7cf4704ca8975d0166ed000fe67692;hb=ab067bd420a6e48b25d66444d97ee229b48bcb23;hp=0000000000000000000000000000000000000000;hpb=8284fb65c8c8f9fd233da33fd08f1f81b64cb94b;p=bertos.git diff --git a/examples/lpc2378/hw/hw_i2c_bitbang.h b/examples/lpc2378/hw/hw_i2c_bitbang.h new file mode 100644 index 00000000..743e28b7 --- /dev/null +++ b/examples/lpc2378/hw/hw_i2c_bitbang.h @@ -0,0 +1,66 @@ +/** + * \file + * + * + * \brief Macro for I2C bitbang operation. + * + * + * \version $Id: hw_i2c_bitbang.h 2506 2009-04-15 08:29:07Z duplo $ + * + * \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 */