36 lines
723 B
C
36 lines
723 B
C
#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 */
|