|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Go to the source code of this file.
Macros | |
| #define | SPI_READ 0x80U /* bit 7 = 1: read (p.21) */ |
| #define | CTRL3_SW_RESET 0x01U /* self-clearing (p.51) */ |
| #define | RESET_POLLS 10U /* 1 ms apart; reset takes far less */ |
Enumerations | |
| enum | { REG_COUNTER_BDR_REG1 = 0x0B , REG_INT1_CTRL = 0x0D , REG_WHO_AM_I = 0x0F , REG_CTRL1_XL = 0x10 , REG_CTRL2_G = 0x11 , REG_CTRL3_C = 0x12 , REG_CTRL4_C = 0x13 , REG_OUT_TEMP_L = 0x20 } |
Functions | |
| static int | write_reg (const dev_bus_t *bus, uint8_t reg, uint8_t value) |
| static int | read_reg (const dev_bus_t *bus, uint8_t reg, uint8_t *value) |
| int | ism330_init (const dev_bus_t *bus) |
| int | ism330_power_down (const dev_bus_t *bus) |
| static int16_t | le16 (const uint8_t *p) |
| int | ism330_read (const dev_bus_t *bus, ism330_sample_t *out) |
Variables | |
| struct { | |
| uint8_t reg | |
| uint8_t value | |
| } | config [] |
| #define CTRL3_SW_RESET 0x01U /* self-clearing (p.51) */ |
Definition at line 17 of file dev_ism330dhcx.c.
Referenced by ism330_init().
| #define RESET_POLLS 10U /* 1 ms apart; reset takes far less */ |
Definition at line 18 of file dev_ism330dhcx.c.
Referenced by ism330_init().
| #define SPI_READ 0x80U /* bit 7 = 1: read (p.21) */ |
Definition at line 16 of file dev_ism330dhcx.c.
| anonymous enum |
| Enumerator | |
|---|---|
| REG_COUNTER_BDR_REG1 | |
| REG_INT1_CTRL | |
| REG_WHO_AM_I | |
| REG_CTRL1_XL | |
| REG_CTRL2_G | |
| REG_CTRL3_C | |
| REG_CTRL4_C | |
| REG_OUT_TEMP_L | |
Definition at line 5 of file dev_ism330dhcx.c.
| int ism330_init | ( | const dev_bus_t * | bus | ) |
Definition at line 45 of file dev_ism330dhcx.c.
References config, CTRL3_SW_RESET, DEV_ERR_BUS, DEV_ERR_ID, DEV_ERR_PARAM, DEV_ERR_TIMEOUT, DEV_ERR_VERIFY, DEV_OK, ISM330_WHO_AM_I_VALUE, read_reg(), reg, REG_CTRL3_C, REG_WHO_AM_I, RESET_POLLS, and write_reg().
Referenced by init_imu(), test_bus_error_is_reported(), test_dead_bus_reads_ff_and_is_refused(), test_init_writes_the_datasheet_configuration(), test_missing_arguments_are_refused(), test_register_that_does_not_read_back_fails(), test_reset_that_never_finishes_times_out(), and test_wrong_identity_is_refused_before_any_write().
| int ism330_power_down | ( | const dev_bus_t * | bus | ) |
Definition at line 81 of file dev_ism330dhcx.c.
References DEV_ERR_BUS, DEV_ERR_PARAM, DEV_OK, REG_CTRL1_XL, REG_CTRL2_G, and write_reg().
Referenced by sensors_core_stop().
| int ism330_read | ( | const dev_bus_t * | bus, |
| ism330_sample_t * | out ) |
Definition at line 96 of file dev_ism330dhcx.c.
References DEV_ERR_BUS, DEV_ERR_PARAM, DEV_OK, le16(), REG_OUT_TEMP_L, and SPI_READ.
Referenced by read_imu(), test_missing_arguments_are_refused(), and test_read_decodes_the_burst().
|
static |
|
static |
Definition at line 37 of file dev_ism330dhcx.c.
Referenced by ism330_init().
|
static |
Definition at line 32 of file dev_ism330dhcx.c.
Referenced by ism330_init(), and ism330_power_down().
| const struct { ... } config[] |
| uint8_t reg |
Definition at line 21 of file dev_ism330dhcx.c.
| uint8_t value |
Definition at line 22 of file dev_ism330dhcx.c.