Adafruit BME680 Library
|
Functions | |
int8_t | bme680_init (struct bme680_dev *dev) |
This API is the entry point. It reads the chip-id and calibration data from the sensor. More... | |
int8_t | bme680_set_regs (const uint8_t *reg_addr, const uint8_t *reg_data, uint8_t len, struct bme680_dev *dev) |
This API writes the given data to the register address of the sensor. More... | |
int8_t | bme680_get_regs (uint8_t reg_addr, uint8_t *reg_data, uint16_t len, struct bme680_dev *dev) |
This API reads the data from the given register address of the sensor. More... | |
int8_t | bme680_soft_reset (struct bme680_dev *dev) |
This API performs the soft reset of the sensor. More... | |
int8_t | bme680_set_sensor_mode (struct bme680_dev *dev) |
This API is used to set the power mode of the sensor. More... | |
int8_t | bme680_get_sensor_mode (struct bme680_dev *dev) |
This API is used to get the power mode of the sensor. More... | |
void | bme680_set_profile_dur (uint16_t duration, struct bme680_dev *dev) |
This API is used to set the profile duration of the sensor. More... | |
void | bme680_get_profile_dur (uint16_t *duration, struct bme680_dev *dev) |
This API is used to get the profile duration of the sensor. More... | |
int8_t | bme680_get_sensor_data (struct bme680_field_data *data, struct bme680_dev *dev) |
This API reads the pressure, temperature and humidity and gas data from the sensor, compensates the data and store it in the bme680_data structure instance passed by the user. More... | |
int8_t | bme680_set_sensor_settings (uint16_t desired_settings, struct bme680_dev *dev) |
This API is used to set the oversampling, filter and T,P,H, gas selection settings in the sensor. More... | |
int8_t | bme680_get_sensor_settings (uint16_t desired_settings, struct bme680_dev *dev) |
This API is used to get the oversampling, filter and T,P,H, gas selection settings in the sensor. More... | |
void bme680_get_profile_dur | ( | uint16_t * | duration, |
struct bme680_dev * | dev | ||
) |
This API is used to get the profile duration of the sensor.
[in] | dev | : Structure instance of bme680_dev. |
[in] | duration | : Duration of the measurement in ms. |
int8_t bme680_get_regs | ( | uint8_t | reg_addr, |
uint8_t * | reg_data, | ||
uint16_t | len, | ||
struct bme680_dev * | dev | ||
) |
This API reads the data from the given register address of the sensor.
[in] | reg_addr | : Register address from where the data to be read |
[out] | reg_data | : Pointer to data buffer to store the read data. |
[in] | len | : No of bytes of data to be read. |
[in] | dev | : Structure instance of bme680_dev. |
zero | -> Success / +ve value -> Warning / -ve value -> Error |
int8_t bme680_get_sensor_data | ( | struct bme680_field_data * | data, |
struct bme680_dev * | dev | ||
) |
This API reads the pressure, temperature and humidity and gas data from the sensor, compensates the data and store it in the bme680_data structure instance passed by the user.
[out] | data | Structure instance to hold the data. |
[in] | dev | : Structure instance of bme680_dev. |
zero | -> Success / +ve value -> Warning / -ve value -> Error |
int8_t bme680_get_sensor_mode | ( | struct bme680_dev * | dev | ) |
This API is used to get the power mode of the sensor.
[in] | dev | : Structure instance of bme680_dev |
value | mode |
---|---|
0x00 | BME680_SLEEP_MODE |
0x01 | BME680_FORCED_MODE |
zero | -> Success / +ve value -> Warning / -ve value -> Error |
int8_t bme680_get_sensor_settings | ( | uint16_t | desired_settings, |
struct bme680_dev * | dev | ||
) |
This API is used to get the oversampling, filter and T,P,H, gas selection settings in the sensor.
[in] | dev | : Structure instance of bme680_dev. |
[in] | desired_settings | : Variable used to select the settings which are to be get from the sensor. |
zero | -> Success / +ve value -> Warning / -ve value -> Error. |
int8_t bme680_init | ( | struct bme680_dev * | dev | ) |
This API is the entry point. It reads the chip-id and calibration data from the sensor.
CPP guard
[in,out] | dev | : Structure instance of bme680_dev |
zero | -> Success / +ve value -> Warning / -ve value -> Error |
void bme680_set_profile_dur | ( | uint16_t | duration, |
struct bme680_dev * | dev | ||
) |
This API is used to set the profile duration of the sensor.
[in] | dev | : Structure instance of bme680_dev. |
[in] | duration | : Duration of the measurement in ms. |
int8_t bme680_set_regs | ( | const uint8_t * | reg_addr, |
const uint8_t * | reg_data, | ||
uint8_t | len, | ||
struct bme680_dev * | dev | ||
) |
This API writes the given data to the register address of the sensor.
[in] | reg_addr | : Register address from where the data to be written. |
[in] | reg_data | : Pointer to data buffer which is to be written in the sensor. |
[in] | len | : No of bytes of data to write.. |
[in] | dev | : Structure instance of bme680_dev. |
zero | -> Success / +ve value -> Warning / -ve value -> Error |
int8_t bme680_set_sensor_mode | ( | struct bme680_dev * | dev | ) |
This API is used to set the power mode of the sensor.
[in] | dev | : Structure instance of bme680_dev |
value | mode |
---|---|
0x00 | BME680_SLEEP_MODE |
0x01 | BME680_FORCED_MODE |
zero | -> Success / +ve value -> Warning / -ve value -> Error |
int8_t bme680_set_sensor_settings | ( | uint16_t | desired_settings, |
struct bme680_dev * | dev | ||
) |
This API is used to set the oversampling, filter and T,P,H, gas selection settings in the sensor.
[in] | dev | : Structure instance of bme680_dev. |
[in] | desired_settings | : Variable used to select the settings which are to be set in the sensor. Macros | Functionality----------------------—|-------------------------------------------— BME680_OST_SEL | To set temperature oversampling. BME680_OSP_SEL | To set pressure oversampling. BME680_OSH_SEL | To set humidity oversampling. BME680_GAS_MEAS_SEL | To set gas measurement setting. BME680_FILTER_SEL | To set filter setting. BME680_HCNTRL_SEL | To set humidity control setting. BME680_RUN_GAS_SEL | To set run gas setting. BME680_NBCONV_SEL | To set NB conversion setting. BME680_GAS_SENSOR_SEL | To set all gas sensor related settings |
zero | -> Success / +ve value -> Warning / -ve value -> Error. |
int8_t bme680_soft_reset | ( | struct bme680_dev * | dev | ) |
This API performs the soft reset of the sensor.
[in] | dev | : Structure instance of bme680_dev. |
zero | -> Success / +ve value -> Warning / -ve value -> Error. |