Robot Control Library
|
Interface to the BMP280 barometer.
<rc/bmp.h>
Data Structures | |
struct | rc_bmp_data_t |
Typedefs | |
typedef enum rc_bmp_oversample_t | rc_bmp_oversample_t |
typedef enum rc_bmp_filter_t | rc_bmp_filter_t |
typedef struct rc_bmp_data_t | rc_bmp_data_t |
Functions | |
int | rc_bmp_init (rc_bmp_oversample_t oversample, rc_bmp_filter_t filter) |
powers on the barometer and initializes it with the given oversample and filter settings. More... | |
int | rc_bmp_set_sea_level_pressure_pa (double pa) |
If you know the current sea level pressure for your region and weather, you can use this to correct the altititude reading. More... | |
int | rc_bmp_power_off (void) |
Puts the barometer into a low power state, should be called at the end of your program before close. More... | |
int | rc_bmp_read (rc_bmp_data_t *data) |
Reads the newest temperature and pressure measurments from the barometer over the I2C bus. More... | |
enum rc_bmp_oversample_t |
Setting given to rc_bmp_init which defines the oversampling done internally to the barometer. For example, if BMP_OVERSAMPLE_16 is used then the barometer will average 16 samples before updating the data registers. The more oversampling used, the slower the data registers will update. You should pick an oversample that provides an update rate slightly slower than the rate at which you will be reading the barometer.
Enumerator | |
---|---|
BMP_OVERSAMPLE_1 | update rate 182 HZ |
BMP_OVERSAMPLE_2 | update rate 133 HZ |
BMP_OVERSAMPLE_4 | update rate 87 HZ |
BMP_OVERSAMPLE_8 | update rate 51 HZ |
BMP_OVERSAMPLE_16 | update rate 28 HZ |
enum rc_bmp_filter_t |
int rc_bmp_init | ( | rc_bmp_oversample_t | oversample, |
rc_bmp_filter_t | filter | ||
) |
powers on the barometer and initializes it with the given oversample and filter settings.
Optionally call rc_bmp_set_sea_level_pressure_pa afterwards to change the sea level pressure from default.
[in] | oversample | see rc_bmp_oversample_t |
[in] | filter | see rc_bmp_filter_t |
int rc_bmp_set_sea_level_pressure_pa | ( | double | pa | ) |
If you know the current sea level pressure for your region and weather, you can use this to correct the altititude reading.
This is not necessary if you only care about differential altitude from a starting point. Must be called after rc_bmp_init to have an effect.
[in] | pa | sea level pressure in pascals |
int rc_bmp_power_off | ( | void | ) |
Puts the barometer into a low power state, should be called at the end of your program before close.
int rc_bmp_read | ( | rc_bmp_data_t * | data | ) |
Reads the newest temperature and pressure measurments from the barometer over the I2C bus.
data | pointer to data struct where new data will be written. |