Lines Matching full:bma4xx

1 /* Bosch BMA4xx 3-axis accelerometer driver
18 LOG_MODULE_REGISTER(bma4xx, CONFIG_SENSOR_LOG_LEVEL);
19 #include "bma4xx.h"
42 struct bma4xx_data *bma4xx = dev->data; in bma4xx_attr_set_offset() local
56 return bma4xx->hw_ops->write_reg(dev, reg_addr, reg_val[0]); in bma4xx_attr_set_offset()
66 return bma4xx->hw_ops->write_data(dev, reg_addr, (uint8_t *)reg_val, in bma4xx_attr_set_offset()
116 struct bma4xx_data *bma4xx = dev->data; in bma4xx_attr_set_odr() local
126 status = bma4xx->hw_ops->update_reg(dev, BMA4XX_REG_ACCEL_CONFIG, BMA4XX_MASK_ACC_CONF_ODR, in bma4xx_attr_set_odr()
132 bma4xx->accel_odr = reg_val; in bma4xx_attr_set_odr()
168 struct bma4xx_data *bma4xx = dev->data; in bma4xx_attr_set_range() local
178 status = bma4xx->hw_ops->update_reg(dev, BMA4XX_REG_ACCEL_RANGE, BMA4XX_MASK_ACC_RANGE, in bma4xx_attr_set_range()
184 bma4xx->accel_fs_range = reg_val; in bma4xx_attr_set_range()
198 struct bma4xx_data *bma4xx = dev->data; in bma4xx_attr_set_bwp() local
200 return bma4xx->hw_ops->update_reg(dev, BMA4XX_REG_ACCEL_CONFIG, BMA4XX_MASK_ACC_CONF_BWP, in bma4xx_attr_set_bwp()
230 struct bma4xx_data *bma4xx = dev->data; in bma4xx_chip_init() local
242 status = bma4xx->hw_ops->read_reg(dev, BMA4XX_REG_CHIP_ID, &bma4xx->chip_id); in bma4xx_chip_init()
247 LOG_DBG("chip_id is 0x%02x", bma4xx->chip_id); in bma4xx_chip_init()
249 if (bma4xx->chip_id != BMA4XX_CHIP_ID_BMA422) { in bma4xx_chip_init()
254 status = bma4xx->hw_ops->write_reg(dev, BMA4XX_REG_CMD, BMA4XX_CMD_SOFT_RESET); in bma4xx_chip_init()
263 bma4xx->accel_fs_range = BMA4XX_RANGE_4G; in bma4xx_chip_init()
264 bma4xx->accel_bwp = BMA4XX_BWP_NORM_AVG4; in bma4xx_chip_init()
265 bma4xx->accel_odr = BMA4XX_ODR_100; in bma4xx_chip_init()
268 status = bma4xx->hw_ops->update_reg(dev, BMA4XX_REG_ACCEL_CONFIG, BMA4XX_BIT_ACC_PERF_MODE, in bma4xx_chip_init()
276 status = bma4xx->hw_ops->update_reg(dev, BMA4XX_REG_POWER_CTRL, BMA4XX_BIT_ACC_EN, in bma4xx_chip_init()
291 * @brief Read accelerometer data from the BMA4xx
295 struct bma4xx_data *bma4xx = dev->data; in bma4xx_sample_fetch() local
300 status = bma4xx->hw_ops->read_data(dev, BMA4XX_REG_DATA_8, (uint8_t *)&read_data, in bma4xx_sample_fetch()
321 * @brief Read temperature register on BMA4xx
325 struct bma4xx_data *bma4xx = dev->data; in bma4xx_temp_fetch() local
328 status = bma4xx->hw_ops->read_reg(dev, BMA4XX_REG_TEMPERATURE, temp); in bma4xx_temp_fetch()
345 struct bma4xx_data *bma4xx = dev->data; in bma4xx_submit_one_shot() local
368 edata->header.accel_fs = bma4xx->accel_fs_range; in bma4xx_submit_one_shot()
565 * All that's left is to divide by the bma4xx's maximum range BIT(11). in bma4xx_convert_raw_accel_to_q31()