init bme_280 lib
This commit is contained in:
parent
08fb2efc86
commit
f7da5a3712
4 changed files with 188 additions and 3 deletions
36
bme280.h
Normal file
36
bme280.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef BME280_H
|
||||
#define BME280_H
|
||||
#include "hardware/i2c.h"
|
||||
typedef struct {
|
||||
// temperature params
|
||||
uint16_t dig_t1;
|
||||
int16_t dig_t2;
|
||||
int16_t dig_t3;
|
||||
|
||||
// pressure params
|
||||
uint16_t dig_p1;
|
||||
int16_t dig_p2;
|
||||
int16_t dig_p3;
|
||||
int16_t dig_p4;
|
||||
int16_t dig_p5;
|
||||
int16_t dig_p6;
|
||||
int16_t dig_p7;
|
||||
int16_t dig_p8;
|
||||
int16_t dig_p9;
|
||||
|
||||
// humidity params
|
||||
uint16_t dig_h1;
|
||||
int16_t dig_h2;
|
||||
int16_t dig_h3;
|
||||
int16_t dig_h4;
|
||||
int16_t dig_h5;
|
||||
} bme280_compensation_params;
|
||||
|
||||
typedef struct {
|
||||
i2c_inst_t *i2c;
|
||||
bme280_compensation_params params;
|
||||
} bme280_config;
|
||||
|
||||
void bme280_init(bme280_config *config, i2c_inst_t *i2c,
|
||||
uint8_t sda_pin, uint8_t scl_pin);
|
||||
#endif /* BME280_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue