Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Zephyr driver for Bosch BMI088 IMU

License

NotificationsYou must be signed in to change notification settings

teamspatzenhirn/bmi088_zephyr_driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

This is a west module.You can integrate it in your application by adding the project to your west manifest:

manifest:remotes:    -name:teamspatzenhirnurl-base:https://github.com/teamspatzenhirnprojects:    -name:bmi088_zephyr_driverremote:teamspatzenhirnrevision:<current commit hash>path:modules/bmi088

Enable the sensor by defining its location and properties in the devicetree (overlay).Gyro and accelerometer are handled separately, since that's how the sensor is built.It would be possible to use just one of the sensors, but it's currently not possible tocompletely deactivate half of the driver, just because we usually need both sensors.

For sensor configuration the gyro provides thebandwidth devicetree setting, theaccelerometer provides oversampling rateosr and output data rateodr, see thedatasheet for valid values.

&lpspi4 {gyro:bmi088_gyr@0 {compatible="bosch,bmi088-gyr";reg=<0>;spi-max-frequency=<10000000>;// datasheet page 39bandwidth=<0x06>;// corner-frequency at 64 Hzstatus="okay";    };acc:bmi088_acc@1 {compatible="bosch,bmi088-acc";reg=<1>;spi-max-frequency=<10000000>;// datasheet page 16 and 29// corner-frequency at 80 Hzodr=<0x0B>;// 800 Hzosr=<0x08>;// 4 times oversampledstatus="okay";    };};

Example of reading sensor values:

#defineGYRO_NODEDT_NODELABEL(gyro)constexprconst device *gyro_sensor_dev = DEVICE_DT_GET(GYRO_NODE);#defineACCELEROMETER_NODEDT_NODELABEL(gyro)constexprconst device *accel_sensor_dev = DEVICE_DT_GET(ACCELEROMETER_NODE);voidsensor_readout() {sensor_sample_fetch(gyro_sensor_dev);    sensor_value gyro[3];sensor_channel_get(gyro_sensor_dev, SENSOR_CHAN_GYRO_XYZ, gyro);LOG_INF("Gyro x: %f °/s y: %f °/s z: %f °/s",sensor_value_to_double(gyro[0]),sensor_value_to_double(gyro[1]),sensor_value_to_double(gyro[2]));sensor_sample_fetch(accel_sensor_dev);    sensor_value accel[3];sensor_channel_get(accel_sensor_dev, SENSOR_CHAN_ACCEL_XYZ, accel);LOG_INF("Accelerometer x: %f m/s2 y: %f m/s2 z: %f m/s2",sensor_value_to_double(accel[0]),sensor_value_to_double(accel[1]),sensor_value_to_double(accel[2]));}

Git history

This driver has been extracted from our Zephyr fork.For the full git history of the driver, refer to this commit in out fork,which is the last version before moving the driver here:https://github.com/teamspatzenhirn/zephyr/tree/858548919eb664fc364dad0226e3dcf71586292b/drivers/sensor/bmi088

Writing Out-Of-Tree Drivers

Since this was kind of a pain to figure out, here are a few helpful links if you want to do this:

About

Zephyr driver for Bosch BMI088 IMU

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp