Skip to content

IRNAS/irnas-bme690-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRNAS BME690 driver zephyr

This driver is used for BOSCH's BME690 sensor. This driver is intended for use with Zephyr.

Instalation

To use this driver add the below snippet to you west.yml file:

- name: irnas-bme69x-driver
  repo-path: irnas-bme69x-driver
  path: irnas/irnas-bme69x-driver
  remote: irnas
  revision: v1.0.1

After adding the above snippet to your west.yml file, run east update in your terminal.

DTS

A node needs to be added to your device-tree file aswell:

If you will be using the I²C(0) connection

&i2c0{
    bme69x: bme69x@76 {
        compatible = "irnas,bme69x";
        label = "bme69x";
        reg = <0x76>;
        status = "okay";
    };
};

If you will be using the SPI(0) connection

&spi0{
    bme69x: bme69x@76 {
        compatible = "irnas,bme69x";
        label = "bme69x";
        reg = <0x76>;
        status = "okay";
    };
};

Warning

SPI communication support has been implemented but not tested. Use at your own risk.

Usage

The driver will initialize at boot and can be accessed via:

const struct device *bme69x_sensor = DEVICE_DT_GET(DT_NODELABEL(bme69x));

The driver exposes internal structure types and function calls to users for users to use freely. From here there are two options for controlling the driver:

Control via Zephyr Sensor API

User can configure and control parts of the sensor with:

  • sensor_attr_set
  • sensor_sample_fetch
  • sensor_channel_get

Control via BOSCH's API

To use BOSCH's API the user first need to get the bme69x_dev pointer from the driver. That can be done using the exposed function:

struct bme69x_dev *bme69x_get_bme69x_dev_ptr(const struct device *dev);

by providing the function with a pointer to the sensor device, the user gets the bme69x pointer which is then used to control most BOSCH API functions.

BSEC Library

This driver also supports the use of the BSEC library, but does not provide the library by itself. The users need to acquire it on their own behalf.

Read more about acquiring the BSEC library and its integration in the README.md file.

About

BME690 sensor driver ported for zephyr

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors