44 #include "dev/acc-sensor.h"
57 if(!i2c_read_reg (kLIS3L02DQ_SLAVE_ADDR,CTRL_REG1, ®, 1))
87 i2c_read_reg(kLIS3L02DQ_SLAVE_ADDR, reg_addr, (int8u *)&i2c_data, 1);
89 if(MEMS_GetFullScale()==ACC_HIGH_RANGE){
90 return ((int16s)i2c_data)*HIGH_RANGE_SENSITIVITY;
93 return ((int16s)i2c_data)*LOW_RANGE_SENSITIVITY;
99 configure(
int type,
int value)
103 case SENSORS_HW_INIT:
118 return MEMS_SetFullScale((
boolean)value);
121 if(value < ACC_HPF_DISABLE){
122 return i2c_write_reg(kLIS3L02DQ_SLAVE_ADDR, CTRL_REG2, (1<<4) | (int8u)value);
125 return i2c_write_reg(kLIS3L02DQ_SLAVE_ADDR, CTRL_REG2, 0x00);
143 SENSORS_SENSOR(acc_sensor, ACC_SENSOR,
144 value, configure, status);