Remove old api that using i2c. Add interface to allow the compatibily with old api.
[bertos.git] / bertos / drv / lm75.c
index 93c6509e4e3363a28fc9e871357d33b061b0fb3e..d1d0a257fc2f7e6b0b582ac44da716ffc0e0485e 100644 (file)
 
 deg_t lm75_read_1(uint8_t sens_addr)
 {
-       uint8_t data[2];
-       int16_t degree;
-       int16_t deci_degree;
-
-       if( !(i2c_start_w(SELECT_ADDRESS(sens_addr))
-               && i2c_put(LM75_PAD_BYTE)
-               && i2c_start_r(SELECT_ADDRESS(sens_addr))) )
-       {
-               i2c_stop();
-               return EOF;
-       }
-
-       if ( !i2c_recv(data, sizeof(data)) )
-       {
-               i2c_stop();
-               return EOF;
-       }
-       i2c_stop();
-
-       degree = (int16_t)data[0];
-       deci_degree = (int16_t)(((data[1] >> 7) & 1 ) * 5);
-
-       LOG_INFO("[%d.%d C]\n", degree, deci_degree);
-
-       return degree * 10 + deci_degree;
-}
-
-void lm75_init_0(void)
-{
-       // Check dependence
-       MOD_CHECK(i2c);
-       LM75_HW_INIT();
+       return lm75_read_2(&local_i2c_old_api, sens_addr);
 }
 #endif /* !CONFIG_I2C_DISABLE_OLD_API */
 
@@ -123,11 +92,3 @@ deg_t lm75_read_2(I2c *i2c, uint8_t sens_addr)
 
        return degree * 10 + deci_degree;
 }
-
-void lm75_init_1(I2c *i2c)
-{
-       ASSERT(i2c);
-
-       // Check dependence
-       LM75_HW_INIT();
-}