📓
Enginique Docs
HomeHow-to
  • Documentation Home
  • Single Board Computers
    • Engage
  • Industrial Devices
    • Evolve
      • Calibration
      • Reprogramming
    • Evolve 'R
    • Energy Analyzer
    • R'IO: Mini PLC
  • Sensor Modules
    • Bioacoustics Module
    • CO2 RHT Module
    • Environmental Module
    • Hall Effect Module
    • I2C Adapter Module
    • IMU Module
    • Irradiance Module
    • Positioning Module
    • Presence Module
    • RTD Module
  • Extension Boards
    • NFC Broker
  • Connectivity Modules
    • M.2 BLE 802.15.4 Module
    • M.2 CAT-M NB-IoT Module
    • M.2 Developer Module
    • M.2 LEO Satellite Module
    • M.2 LoRa Module
    • M.2 WiFi Module
  • Robotics
    • Wheeled Robot Controller
  • Environmental Monitoring
    • Air Quality Sensor
      • Modbus Protocol
    • Environmental Sensor
      • Modbus Protocol
    • Depth Sensor
      • Modbus Protocol
    • Irradiance Sensor
      • Modbus Protocol
    • Mechanical Wind Sensor
      • Modbus Protocol
    • Rain Gauge
      • Modbus Protocol
    • Soil Sensor
      • Modbus Protocol
    • Ultrasonic Wind Sensor
      • Modbus Protocol
  • Value-Line Devices
    • Sensor Carrier BLE
    • Sensor Carrier LoRa
  • Communication Protocols
    • CoAP
    • LoRaWAN
    • Matter
    • Modbus
    • MQTT
  • Libraries
    • ACS71240 Current Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • Adrastea-I Cellular Module
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • BME280 Env Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • BME688 Env Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • BGT60TR13C Radar Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • DS18B20 Temp Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • EEPROM Memory
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • Elara-I Positioning Module
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • Irradiance Meter
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • LIS3DH IMU
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • MAX31865 RTD Converter
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • MCP23 Series Expander
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • SCD4x CO2 Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • SEN5x Air Quality Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • ST25R3916 NFC Device
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • SX1262 LoRa Transceiver
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • TMAG5273 Hall Effect Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • TSL2540 Light Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • WL-ICLED
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • WSEN-HIDS Humidity Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • WSEN-PADS Pressure Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • WSEN-TIDS Temperature Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
  • Important Notice
Powered by GitBook

Copyright (c) 2024 Enginique.

On this page
  • Installation
  • Library Overview
  • Data Types
  • Initialization
  • Configuration
  • Readouts
  • Sample
Export as PDF
  1. Libraries
  2. BME280 Env Sensor
  3. STM32

C

This page includes BME280 C library installation guidelines and documentation for STM32CubeIDE.

Last updated 9 months ago

Installation

Installation guidelines are coming soon.

Library Overview

This section includes , library , , and .

Data Types

TPHDData

Defines sensor readout variables.

Struct
typedef struct
{
    float temperature;
    float humidity;
    float pressure;
    float dewPoint;
    float vpd;
} TPHDVData;

Initialization

BME280_Init

Initializes the BME280 sensor.

Prototype
void BME280_Init(
    I2C_HandleTypeDef *_i2c,
    bme280_i2c_address_types_t _i2cAddress)

Parameters

  • _i2c: I2C Handle

  • _i2cAddress: I2C Address

Returns

  • None

Sample
// Sample code is coming soon.

Configuration

BME280_Config

Configures the BME280 sensor.

Prototype
ErrorStatus BME280_Config(
    bme280_ctrl_meas_osrs_t_types_t _temperatureSensorOversampling,
    bme280_ctrl_hum_osrs_h_types_t _humiditySensorOversampling,
    bme280_ctrl_meas_osrs_p_types_t _pressureSensorOversampling,
    bme280_config_filter_iir_types_t _iirFilter,
    bme280_config_standby_time_types_t _standbyTime,
    bme280_ctrl_meas_mode_types_t _measurementMode)

Parameters

  • _temperatureSensorOversampling: Oversampling setting for the temperature sensor.

  • _humiditySensorOversampling: Oversampling setting for the humidity sensor.

  • _pressureSensorOversampling: Oversampling setting for the pressure sensor.

  • _iirFilter: IIR filter setting.

  • _standbyTime: Standby time setting.

  • _measurementMode: Measurement mode setting.

Returns

  • ErrorStatus: Error status.

Sample
// Sample code is coming soon.

BME280_SetMeasurementMode

Sets measurement mode of the BME280 sensor.

Prototype
ErrorStatus BME280_SetMeasurementMode(
    bme280_ctrl_meas_mode_types_t _measurementMode)

Parameters

  • _measurementMode: Measurement mode setting.

Returns

  • ErrorStatus: Error status.

Sample
// Sample code is coming soon.

Readouts

BME280_ReadTPH

Measures temperature, pressure, and humidity using the BME280 sensor.

Prototype
ErrorStatus BME280_ReadTPH(
    bool _forceRead,
    TPHDVData *tphdvData)

Parameters

  • _forceRead (bool): Force sensor to measure one sample.

  • *tphdvData (TPHDVData): Pointer to the TPHDVData struct

Returns

  • ErrorStatus: Error status.

Sample
// Sample code is coming soon.

BME280_ReadTPHDV

Measures temperature, pressure, and relative humidity using the BME280 sensor & calculates dew point and vapor pressure deficit.

Prototype
ErrorStatus BME280_ReadTPHDV(
    bool _forceRead,
    TPHDVData *tphdvData)

Parameters

  • _forceRead (bool): Force sensor to measure one sample.

  • *tphdvData (TPHDVData): Pointer to the TPHDVData struct

Returns

  • ErrorStatus: Error status.

Sample
// Sample code is coming soon.

BME280_ReadTemperature

Reads temperature using the BME280 sensor.

Prototype
ErrorStatus BME280_ReadTemperature(
    bool _forceRead,
    TPHDVData *tphdvData)

Parameters

  • _forceRead (bool): Force sensor to measure one sample.

  • *tphdvData (TPHDVData): Pointer to the TPHDVData struct

Returns

  • ErrorStatus: Error status.

Sample
// Sample code is coming soon.

BME280_ReadPressure

Reads pressure using the BME280 sensor.

Prototype
ErrorStatus BME280_ReadPressure(
    bool _forceRead,
    TPHDVData *tphdvData)

Parameters

  • _forceRead (bool): Force sensor to measure one sample.

  • *tphdvData (TPHDVData): Pointer to the TPHDVData struct

Returns

  • ErrorStatus: Error status.

Sample
// Sample code is coming soon.

BME280_ReadHumidity

Reads humidity using the BME280 sensor.

Prototype
ErrorStatus BME280_ReadHumidity(
    bool _forceRead,
    TPHDVData *tphdvData)

Parameters

  • _forceRead (bool): Force sensor to measure one sample.

  • *tphdvData (TPHDVData): Pointer to the TPHDVData struct

Returns

  • ErrorStatus: Error status.

Sample
// Sample code is coming soon.

BME280_CalculateAltitude

Calculates altitude using sea level pressure and measured pressure data.

Prototype
float BME280_CalculateAltitude(
    float pressure,
    float meanSeaLevelPressure)

Parameters

  • pressure (float): Measured pressure in hectoPascals (hPa)

  • meanSeaLevelPressure (float): Mean sea level pressure in bar

Returns

  • float: Altitude in meters

Sample
// Sample code is coming soon.

Sample

A complete code sample is coming soon.

data types
initialization
configuration
readouts