BeRTOS
hw_i2c_bitbang.h
Go to the documentation of this file.
00001 
00041 #ifndef HW_I2C_BITBANG_H
00042 #define HW_I2C_BITBANG_H
00043 
00044 #warning TODO:This is an example implementation, you must implement it!
00045 
00046 #define SDA_HI  do { /* Implement me:Set SDA High by setting SDA pin as input */ } while (0)
00047 #define SDA_LO  do { /* Implement me:Set SDA Low by setting SDA pin as open collector output */ } while (0)
00048 #define SCL_HI  do { /* Implement me:Set SCL High by setting SCL pin as input */ } while (0)
00049 #define SCL_LO  do { /* Implement me:Set SCL Low by setting SCL pin as open collector output */ } while (0)
00050 
00051 
00052 #define SCL_IN       (true) /* Implement me: read SDA pin state */
00053 #define SDA_IN       (true) /* Implement me: read SCL pin state */
00054 
00058 #define I2C_BITBANG_HW_INIT do { /* Implement me! */ } while (0)
00059 
00063 #define I2C_HALFBIT_DELAY() do { /* Implement me! */ } while (0)
00064 
00065 
00066 /*
00067  * New api
00068  */
00069 #include <cfg/compiler.h>
00070 
00071 INLINE void i2c_sdaHi(int dev)
00072 {
00073     (void)(dev);
00074     /* Implement me:Set SDA High by setting SDA pin as input */
00075 }
00076 
00077 INLINE void i2c_sdaLo(int dev)
00078 {
00079     (void)(dev);
00080     /* Implement me:Set SDA Low by setting SDA pin as open collector output */
00081 }
00082 
00083 INLINE void i2c_sclHi(int dev)
00084 {
00085     (void)(dev);
00086     /* Implement me:Set SCL High by setting SCL pin as input */
00087 }
00088 
00089 INLINE void i2c_sclLo(int dev)
00090 {
00091     (void)(dev);
00092     /* Implement me:Set SCL Low by setting SCL pin as open collector output */
00093 }
00094 
00095 INLINE bool i2c_sdaIn(int dev)
00096 {
00097     (void)(dev);
00098     /* Implement me: read SDA pin state */
00099     return true;
00100 }
00101 
00102 INLINE bool i2c_sclIn(int dev)
00103 {
00104     (void)(dev);
00105     /* Implement me: read SCL pin state */
00106     return true;
00107 }
00108 
00112 INLINE void i2c_halfbitDelay(int dev)
00113 {
00114     (void)(dev);
00115     /* Implement me! */
00116 }
00117 
00121 INLINE void i2c_bitbangInit(int dev)
00122 {
00123     (void)(dev);
00124     /* Implement me! */
00125 }
00126 
00127 #endif /* HW_I2C_BITBANG_H */