Lines Matching +full:0 +full:v
48 return 0; in icm42605_set_fs()
105 LOG_DBG("Write Accel ODR 0x%X", databuf); in icm42605_set_odr()
137 LOG_DBG("Write GYRO ODR 0x%X", databuf); in icm42605_set_odr()
150 int result = 0; in icm42605_sensor_init()
151 uint8_t v; in icm42605_sensor_init() local
153 result = inv_spi_read(&cfg->spi, REG_WHO_AM_I, &v, 1); in icm42605_sensor_init()
159 LOG_DBG("WHO AM I : 0x%X", v); in icm42605_sensor_init()
161 result = inv_spi_read(&cfg->spi, REG_DEVICE_CONFIG, &v, 1); in icm42605_sensor_init()
168 v |= BIT_SOFT_RESET; in icm42605_sensor_init()
170 result = inv_spi_single_write(&cfg->spi, REG_DEVICE_CONFIG, &v); in icm42605_sensor_init()
180 v = BIT_GYRO_AFSR_MODE_HFS | BIT_ACCEL_AFSR_MODE_HFS | BIT_CLK_SEL_PLL; in icm42605_sensor_init()
182 result = inv_spi_single_write(&cfg->spi, REG_INTF_CONFIG1, &v); in icm42605_sensor_init()
189 v = BIT_EN_DREG_FIFO_D2A | in icm42605_sensor_init()
193 result = inv_spi_single_write(&cfg->spi, REG_TMST_CONFIG, &v); in icm42605_sensor_init()
200 result = inv_spi_read(&cfg->spi, REG_INTF_CONFIG0, &v, 1); in icm42605_sensor_init()
207 LOG_DBG("Read REG_INTF_CONFIG0 0x%X", v); in icm42605_sensor_init()
209 v |= BIT_UI_SIFS_DISABLE_I2C; in icm42605_sensor_init()
211 result = inv_spi_single_write(&cfg->spi, REG_INTF_CONFIG0, &v); in icm42605_sensor_init()
218 v = 0; in icm42605_sensor_init()
219 result = inv_spi_single_write(&cfg->spi, REG_INT_CONFIG1, &v); in icm42605_sensor_init()
225 result = inv_spi_single_write(&cfg->spi, REG_PWR_MGMT0, &v); in icm42605_sensor_init()
231 return 0; in icm42605_sensor_init()
243 uint8_t v = 0; in icm42605_turn_on_fifo() local
245 v = BIT_FIFO_MODE_BYPASS; in icm42605_turn_on_fifo()
246 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG, &v); in icm42605_turn_on_fifo()
251 v = 0; in icm42605_turn_on_fifo()
252 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG1, &v); in icm42605_turn_on_fifo()
267 v = BIT_FIFO_MODE_STREAM; in icm42605_turn_on_fifo()
268 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG, &v); in icm42605_turn_on_fifo()
284 v = BIT_TAP_ENABLE; in icm42605_turn_on_fifo()
285 result = inv_spi_single_write(&cfg->spi, REG_APEX_CONFIG0, &v); in icm42605_turn_on_fifo()
290 v = BIT_DMP_INIT_EN; in icm42605_turn_on_fifo()
291 result = inv_spi_single_write(&cfg->spi, REG_SIGNAL_PATH_RESET, &v); in icm42605_turn_on_fifo()
296 v = BIT_BANK_SEL_4; in icm42605_turn_on_fifo()
297 result = inv_spi_single_write(&cfg->spi, REG_BANK_SEL, &v); in icm42605_turn_on_fifo()
302 v = BIT_INT_STATUS_TAP_DET; in icm42605_turn_on_fifo()
303 result = inv_spi_single_write(&cfg->spi, REG_INT_SOURCE6, &v); in icm42605_turn_on_fifo()
308 v = BIT_BANK_SEL_0; in icm42605_turn_on_fifo()
309 result = inv_spi_single_write(&cfg->spi, REG_BANK_SEL, &v); in icm42605_turn_on_fifo()
316 return 0; in icm42605_turn_on_fifo()
323 uint8_t int0_en = 0; in icm42605_turn_off_fifo()
326 uint8_t v = 0; in icm42605_turn_off_fifo() local
328 v = BIT_FIFO_MODE_BYPASS; in icm42605_turn_off_fifo()
329 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG, &v); in icm42605_turn_off_fifo()
334 v = 0; in icm42605_turn_off_fifo()
335 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG1, &v); in icm42605_turn_off_fifo()
356 v = 0; in icm42605_turn_off_fifo()
357 result = inv_spi_single_write(&cfg->spi, REG_APEX_CONFIG0, &v); in icm42605_turn_off_fifo()
362 result = inv_spi_single_write(&cfg->spi, REG_SIGNAL_PATH_RESET, &v); in icm42605_turn_off_fifo()
367 v = BIT_BANK_SEL_4; in icm42605_turn_off_fifo()
368 result = inv_spi_single_write(&cfg->spi, REG_BANK_SEL, &v); in icm42605_turn_off_fifo()
373 v = 0; in icm42605_turn_off_fifo()
374 result = inv_spi_single_write(&cfg->spi, REG_INT_SOURCE6, &v); in icm42605_turn_off_fifo()
379 v = BIT_BANK_SEL_0; in icm42605_turn_off_fifo()
380 result = inv_spi_single_write(&cfg->spi, REG_BANK_SEL, &v); in icm42605_turn_off_fifo()
386 return 0; in icm42605_turn_off_fifo()
393 uint8_t v = 0; in icm42605_turn_on_sensor() local
394 int result = 0; in icm42605_turn_on_sensor()
406 v |= BIT_ACCEL_MODE_LNM; in icm42605_turn_on_sensor()
407 v |= BIT_GYRO_MODE_LNM; in icm42605_turn_on_sensor()
409 result = inv_spi_single_write(&cfg->spi, REG_PWR_MGMT0, &v); in icm42605_turn_on_sensor()
423 return 0; in icm42605_turn_on_sensor()
429 uint8_t v = 0; in icm42605_turn_off_sensor() local
430 int result = 0; in icm42605_turn_off_sensor()
432 result = inv_spi_read(&cfg->spi, REG_PWR_MGMT0, &v, 1); in icm42605_turn_off_sensor()
434 v ^= BIT_ACCEL_MODE_LNM; in icm42605_turn_off_sensor()
435 v ^= BIT_GYRO_MODE_LNM; in icm42605_turn_off_sensor()
437 result = inv_spi_single_write(&cfg->spi, REG_PWR_MGMT0, &v); in icm42605_turn_off_sensor()
449 return 0; in icm42605_turn_off_sensor()