diff options
Diffstat (limited to 'board/nucleo-f411re/board.c')
-rw-r--r-- | board/nucleo-f411re/board.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/board/nucleo-f411re/board.c b/board/nucleo-f411re/board.c index 0f7c57f1e3..d0a84638fd 100644 --- a/board/nucleo-f411re/board.c +++ b/board/nucleo-f411re/board.c @@ -8,7 +8,8 @@ #include "adc_chip.h" #include "common.h" #include "console.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_icm_common.h" +#include "driver/accelgyro_icm426xx.h" #include "ec_version.h" #include "gpio.h" #include "hooks.h" @@ -31,6 +32,7 @@ void user_button_evt(enum gpio_signal signal) static void board_init(void) { gpio_enable_interrupt(GPIO_USER_BUTTON_L); + gpio_enable_interrupt(GPIO_ICM426XX_INT1_L); /* No power control yet */ /* Go to S3 state */ @@ -39,7 +41,7 @@ static void board_init(void) /* Go to S0 state */ hook_notify(HOOK_CHIPSET_RESUME); } -DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_LAST); /* ADC channels */ const struct adc_t adc_channels[] = { @@ -53,29 +55,28 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - {"master", I2C_PORT_MASTER, 100, + {"master", I2C_PORT_MASTER, 400, GPIO_MASTER_I2C_SCL, GPIO_MASTER_I2C_SDA}, }; - const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); /* Base Sensor mutex */ static struct mutex g_base_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct icm_drv_data_t g_icm426xx_data; struct motion_sensor_t motion_sensors[] = { [BASE_ACCEL] = { .name = "Base Accel", .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_BMI160, + .chip = MOTIONSENSE_CHIP_ICM426XX, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_BASE, - .drv = &bmi160_drv, + .drv = &icm426xx_drv, .mutex = &g_base_mutex, - .drv_data = &g_bmi160_data, + .drv_data = &g_icm426xx_data, .port = I2C_PORT_ACCEL, - .addr = BMI160_ADDR0, + .addr = ICM426XX_ADDR0_FLAGS, .rot_standard_ref = NULL, .default_range = 2, /* g, enough for laptop. */ .config = { @@ -95,14 +96,14 @@ struct motion_sensor_t motion_sensors[] = { [BASE_GYRO] = { .name = "Base Gyro", .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_BMI160, + .chip = MOTIONSENSE_CHIP_ICM426XX, .type = MOTIONSENSE_TYPE_GYRO, .location = MOTIONSENSE_LOC_BASE, - .drv = &bmi160_drv, + .drv = &icm426xx_drv, .mutex = &g_base_mutex, - .drv_data = &g_bmi160_data, + .drv_data = &g_icm426xx_data, .port = I2C_PORT_ACCEL, - .addr = BMI160_ADDR0, + .addr = ICM426XX_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = NULL, }, |