Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
BME280 Class Reference
BME280 Environmental sensor. More...
#include <BME280.h>
Public Member Functions | |
| BME280 (PinName sda, PinName scl, int addr) | |
| BME280 I2C Interface. | |
| BME280 (PinName sck, PinName miso, PinName mosi, PinName cs) | |
| BME280 SPI Interface. | |
| ~BME280 () | |
| BME280 destructor. | |
| void | reset (void) |
| software reset | |
| void | init (void) |
| initialization | |
| void | trigger (void) |
| trigger for one-shot measure | |
| uint8_t | busy (void) |
| check status register for the device activity | |
| uint8_t | getID (void) |
| get device ID | |
| float | getTemperature (void) |
| get Temperature | |
| float | getHumidity (void) |
| get Humidity | |
| float | getPressure (void) |
| get Pressure | |
Detailed Description
BME280 Environmental sensor.
- Note:
- Note: Interface selection is done by the value of CSB (chip select)
- if CSB is pulled-up, I2C interface is active.
- if CSB is pulled-down, SPI interface is active.
- After CSB has been pulled down once (regardless of whether any clock cycle occurred)
- the I2C interface is disabled until the next power-on-reset.
Definition at line 25 of file BME280.h.
Constructor & Destructor Documentation
| BME280 | ( | PinName | sda, |
| PinName | scl, | ||
| int | addr | ||
| ) |
BME280 I2C Interface.
- Parameters:
-
sda SDA pin scl SCL pin addr address of the I2C peripheral
Definition at line 219 of file BME280.cpp.
| BME280 | ( | PinName | sck, |
| PinName | miso, | ||
| PinName | mosi, | ||
| PinName | cs | ||
| ) |
BME280 SPI Interface.
- Parameters:
-
sck SPI SCKL pin miso SPI Master In Slave Out pin mosi SPI Master Out Slave In pin cs SPI Chip Select pin
Definition at line 228 of file BME280.cpp.
| ~BME280 | ( | ) |
BME280 destructor.
Definition at line 238 of file BME280.cpp.
Member Function Documentation
| uint8_t busy | ( | void | ) |
check status register for the device activity
- Parameters:
-
none
- Returns:
- uint8_t measuring (0x08) or in NVM udpate (0x01)
Definition at line 318 of file BME280.cpp.
| float getHumidity | ( | void | ) |
get Humidity
- Parameters:
-
none
- Returns:
- float humidity in %
Definition at line 381 of file BME280.cpp.
| uint8_t getID | ( | void | ) |
get device ID
- Parameters:
-
none
- Returns:
- uint8_t ID for BME280 0x60
Definition at line 325 of file BME280.cpp.
| float getPressure | ( | void | ) |
get Pressure
- Parameters:
-
none
- Returns:
- float pressure in hPa
Definition at line 352 of file BME280.cpp.
| float getTemperature | ( | void | ) |
get Temperature
- Parameters:
-
none
- Returns:
- float temperature in degree Celsious
Definition at line 332 of file BME280.cpp.
| void init | ( | void | ) |
| void reset | ( | void | ) |
| void trigger | ( | void | ) |
trigger for one-shot measure
- Parameters:
-
none
- Returns:
- none
Definition at line 306 of file BME280.cpp.
Generated on Sat Jul 30 2022 14:00:05 by
1.7.2