hw/bsp/blueberry/src/hal_bsp.c
int
config_mpu6500_sensor(void)
{
#if MYNEWT_VAL(MPU6500_ONB)
    int rc;
    struct os_dev *dev;
    struct mpu6500_cfg cfg;

    dev = (struct os_dev *) os_dev_open("mpu6500_0", OS_TIMEOUT_NEVER, NULL);
    assert(dev != NULL);

    memset(&cfg, 0, sizeof(cfg));

    cfg.mask = SENSOR_TYPE_ACCELEROMETER | SENSOR_TYPE_GYROSCOPE;
    cfg.accel_range = MPU6500_ACCEL_RANGE_16;
    cfg.gyro_range = MPU6500_GYRO_RANGE_2000;
    cfg.sample_rate_div = MPU6500_GYRO_RATE_200;
    cfg.lpf_cfg = 0;
    cfg.int_enable = 0;
    cfg.int_cfg = 0;

    rc = mpu6500_config((struct mpu6500 *)dev, &cfg);
    SYSINIT_PANIC_ASSERT(rc == 0);

    os_dev_close(dev);
#endif
    return 0;
}
/**
 * MPU6500 Sensor default configuration
 *
 * @return 0 on success, non-zero on failure
 */
MPU6500 Sensor default configuration
@return 0 on success, non-zero on failure
MPU6500 Sensor default configuration @return 0 on success non - zero on failure
int
config_mpu6500_sensor(void)
{
#if MYNEWT_VAL(MPU6500_ONB)
    int rc;
    struct os_dev *dev;
    struct mpu6500_cfg cfg;
    dev = (struct os_dev *) os_dev_open("mpu6500_0", OS_TIMEOUT_NEVER, NULL);
    assert(dev != NULL);
    memset(&cfg, 0, sizeof(cfg));
    cfg.mask = SENSOR_TYPE_ACCELEROMETER | SENSOR_TYPE_GYROSCOPE;
    cfg.accel_range = MPU6500_ACCEL_RANGE_16;
    cfg.gyro_range = MPU6500_GYRO_RANGE_2000;
    cfg.sample_rate_div = MPU6500_GYRO_RATE_200;
    cfg.lpf_cfg = 0;
    cfg.int_enable = 0;
    cfg.int_cfg = 0;
    rc = mpu6500_config((struct mpu6500 *)dev, &cfg);
    SYSINIT_PANIC_ASSERT(rc == 0);
    os_dev_close(dev);
#endif
    return 0;
}
int config_mpu6500_sensor ( void ) { #if MYNEWT_VAL ( MPU6500_ONB ) int rc ; struct os_dev * dev ; struct mpu6500_cfg cfg ; dev = ( struct os_dev * ) os_dev_open ( " " , OS_TIMEOUT_NEVER , NULL ) ; assert ( dev != NULL ) ; memset ( & cfg , 0 , sizeof ( cfg ) ) ; cfg . mask = SENSOR_TYPE_ACCELEROMETER | SENSOR_TYPE_GYROSCOPE ; cfg . accel_range = MPU6500_ACCEL_RANGE_16 ; cfg . gyro_range = MPU6500_GYRO_RANGE_2000 ; cfg . sample_rate_div = MPU6500_GYRO_RATE_200 ; cfg . lpf_cfg = 0 ; cfg . int_enable = 0 ; cfg . int_cfg = 0 ; rc = mpu6500_config ( ( struct mpu6500 * ) dev , & cfg ) ; SYSINIT_PANIC_ASSERT ( rc == 0 ) ; os_dev_close ( dev ) ; #endif return 0 ; }
MPU6500 Sensor default configuration
 @return 0 on success, non-zero on failure
MPU6500 Sensor default configuration @return 0 on success non - zero on failure