@@ -72,7 +72,7 @@ int lsm303dlhc_init(lsm303dlhc_t *dev, i2c_t i2c, gpio_t acc_pin, gpio_t mag_pin
72
72
res += i2c_write_reg (dev -> i2c , dev -> acc_address ,
73
73
LSM303DLHC_REG_CTRL3_A , LSM303DLHC_CTRL3_A_I1_NONE );
74
74
/* configure acc data ready pin */
75
- gpio_init (acc_pin , GPIO_DIR_IN , GPIO_NOPULL );
75
+ gpio_init (acc_pin , GPIO_IN );
76
76
77
77
/* configure magnetometer and temperature */
78
78
/* enable temperature output and set sample rate */
@@ -87,7 +87,7 @@ int lsm303dlhc_init(lsm303dlhc_t *dev, i2c_t i2c, gpio_t acc_pin, gpio_t mag_pin
87
87
LSM303DLHC_REG_MR_M , LSM303DLHC_MAG_MODE_CONTINUOUS );
88
88
i2c_release (dev -> i2c );
89
89
/* configure mag data ready pin */
90
- gpio_init (mag_pin , GPIO_DIR_IN , GPIO_NOPULL );
90
+ gpio_init (mag_pin , GPIO_IN );
91
91
92
92
return (res < 7 ) ? -1 : 0 ;
93
93
}
@@ -217,7 +217,7 @@ int lsm303dlhc_enable(lsm303dlhc_t *dev)
217
217
tmp = (LSM303DLHC_CTRL4_A_BDU | LSM303DLHC_CTRL4_A_SCALE_2G | LSM303DLHC_CTRL4_A_HR );
218
218
res += i2c_write_reg (dev -> i2c , dev -> acc_address , LSM303DLHC_REG_CTRL4_A , tmp );
219
219
res += i2c_write_reg (dev -> i2c , dev -> acc_address , LSM303DLHC_REG_CTRL3_A , LSM303DLHC_CTRL3_A_I1_DRDY1 );
220
- gpio_init (dev -> acc_pin , GPIO_DIR_IN , GPIO_NOPULL );
220
+ gpio_init (dev -> acc_pin , GPIO_IN );
221
221
222
222
tmp = LSM303DLHC_TEMP_EN | LSM303DLHC_TEMP_SAMPLE_75HZ ;
223
223
res += i2c_write_reg (dev -> i2c , dev -> mag_address , LSM303DLHC_REG_CRA_M , tmp );
@@ -229,7 +229,7 @@ int lsm303dlhc_enable(lsm303dlhc_t *dev)
229
229
LSM303DLHC_REG_MR_M , LSM303DLHC_MAG_MODE_CONTINUOUS );
230
230
i2c_release (dev -> i2c );
231
231
232
- gpio_init (dev -> mag_pin , GPIO_DIR_IN , GPIO_NOPULL );
232
+ gpio_init (dev -> mag_pin , GPIO_IN );
233
233
234
234
return (res < 6 ) ? -1 : 0 ;
235
235
}
0 commit comments