Lines Matching +full:startup +full:- +full:time

4  * SPDX-License-Identifier: Apache-2.0
19 const struct icm42605_config *cfg = dev->config; in icm42605_set_fs()
23 result = inv_spi_read(&cfg->spi, REG_ACCEL_CONFIG0, &databuf, 1); in icm42605_set_fs()
31 result = inv_spi_single_write(&cfg->spi, REG_ACCEL_CONFIG0, &databuf); in icm42605_set_fs()
33 result = inv_spi_read(&cfg->spi, REG_GYRO_CONFIG0, &databuf, 1); in icm42605_set_fs()
42 result = inv_spi_single_write(&cfg->spi, REG_GYRO_CONFIG0, &databuf); in icm42605_set_fs()
53 const struct icm42605_config *cfg = dev->config; in icm42605_set_odr()
60 return -ENOTSUP; in icm42605_set_odr()
63 result = inv_spi_read(&cfg->spi, REG_ACCEL_CONFIG0, &databuf, 1); in icm42605_set_odr()
99 result = inv_spi_single_write(&cfg->spi, REG_ACCEL_CONFIG0, &databuf); in icm42605_set_odr()
107 result = inv_spi_read(&cfg->spi, REG_GYRO_CONFIG0, &databuf, 1); in icm42605_set_odr()
139 result = inv_spi_single_write(&cfg->spi, REG_GYRO_CONFIG0, &databuf); in icm42605_set_odr()
149 const struct icm42605_config *cfg = dev->config; in icm42605_sensor_init()
153 result = inv_spi_read(&cfg->spi, REG_WHO_AM_I, &v, 1); in icm42605_sensor_init()
161 result = inv_spi_read(&cfg->spi, REG_DEVICE_CONFIG, &v, 1); in icm42605_sensor_init()
170 result = inv_spi_single_write(&cfg->spi, REG_DEVICE_CONFIG, &v); in icm42605_sensor_init()
182 result = inv_spi_single_write(&cfg->spi, REG_INTF_CONFIG1, &v); 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()
211 result = inv_spi_single_write(&cfg->spi, REG_INTF_CONFIG0, &v); 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()
236 const struct icm42605_data *drv_data = dev->data; in icm42605_turn_on_fifo()
237 const struct icm42605_config *cfg = dev->config; in icm42605_turn_on_fifo()
246 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG, &v); in icm42605_turn_on_fifo()
252 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG1, &v); in icm42605_turn_on_fifo()
257 result = inv_spi_read(&cfg->spi, REG_FIFO_COUNTH, burst_read, 2); in icm42605_turn_on_fifo()
262 result = inv_spi_read(&cfg->spi, REG_FIFO_DATA, burst_read, 3); in icm42605_turn_on_fifo()
268 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG, &v); in icm42605_turn_on_fifo()
273 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG1, &fifo_en); in icm42605_turn_on_fifo()
278 result = inv_spi_single_write(&cfg->spi, REG_INT_SOURCE0, &int0_en); in icm42605_turn_on_fifo()
283 if (drv_data->tap_en) { in icm42605_turn_on_fifo()
285 result = inv_spi_single_write(&cfg->spi, REG_APEX_CONFIG0, &v); in icm42605_turn_on_fifo()
291 result = inv_spi_single_write(&cfg->spi, REG_SIGNAL_PATH_RESET, &v); in icm42605_turn_on_fifo()
297 result = inv_spi_single_write(&cfg->spi, REG_BANK_SEL, &v); in icm42605_turn_on_fifo()
303 result = inv_spi_single_write(&cfg->spi, REG_INT_SOURCE6, &v); in icm42605_turn_on_fifo()
309 result = inv_spi_single_write(&cfg->spi, REG_BANK_SEL, &v); in icm42605_turn_on_fifo()
321 const struct icm42605_data *drv_data = dev->data; in icm42605_turn_off_fifo()
322 const struct icm42605_config *cfg = dev->config; in icm42605_turn_off_fifo()
329 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG, &v); in icm42605_turn_off_fifo()
335 result = inv_spi_single_write(&cfg->spi, REG_FIFO_CONFIG1, &v); in icm42605_turn_off_fifo()
340 result = inv_spi_read(&cfg->spi, REG_FIFO_COUNTH, burst_read, 2); in icm42605_turn_off_fifo()
345 result = inv_spi_read(&cfg->spi, REG_FIFO_DATA, burst_read, 3); in icm42605_turn_off_fifo()
350 result = inv_spi_single_write(&cfg->spi, REG_INT_SOURCE0, &int0_en); in icm42605_turn_off_fifo()
355 if (drv_data->tap_en) { 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()
368 result = inv_spi_single_write(&cfg->spi, REG_BANK_SEL, &v); in icm42605_turn_off_fifo()
374 result = inv_spi_single_write(&cfg->spi, REG_INT_SOURCE6, &v); in icm42605_turn_off_fifo()
380 result = inv_spi_single_write(&cfg->spi, REG_BANK_SEL, &v); in icm42605_turn_off_fifo()
391 struct icm42605_data *drv_data = dev->data; in icm42605_turn_on_sensor()
392 const struct icm42605_config *cfg = dev->config; in icm42605_turn_on_sensor()
397 if (drv_data->sensor_started) { in icm42605_turn_on_sensor()
399 return -EALREADY; in icm42605_turn_on_sensor()
402 icm42605_set_fs(dev, drv_data->accel_sf, drv_data->gyro_sf); in icm42605_turn_on_sensor()
404 icm42605_set_odr(dev, drv_data->accel_hz, drv_data->gyro_hz); in icm42605_turn_on_sensor()
409 result = inv_spi_single_write(&cfg->spi, REG_PWR_MGMT0, &v); in icm42605_turn_on_sensor()
414 /* Accelerometer sensor need at least 10ms startup time in icm42605_turn_on_sensor()
415 * Gyroscope sensor need at least 30ms startup time in icm42605_turn_on_sensor()
421 drv_data->sensor_started = true; in icm42605_turn_on_sensor()
428 const struct icm42605_config *cfg = dev->config; in icm42605_turn_off_sensor()
432 result = inv_spi_read(&cfg->spi, REG_PWR_MGMT0, &v, 1); in icm42605_turn_off_sensor()
437 result = inv_spi_single_write(&cfg->spi, REG_PWR_MGMT0, &v); in icm42605_turn_off_sensor()
442 /* Accelerometer sensor need at least 10ms startup time in icm42605_turn_off_sensor()
443 * Gyroscope sensor need at least 30ms startup time in icm42605_turn_off_sensor()