clean up bem280 lib
This commit is contained in:
parent
28201b6ba5
commit
98748d3e6d
1 changed files with 1 additions and 22 deletions
23
bme280.c
23
bme280.c
|
|
@ -1,7 +1,6 @@
|
||||||
#include "bme280.h"
|
#include "bme280.h"
|
||||||
#include "hardware/i2c.h"
|
|
||||||
#include "pico/binary_info.h"
|
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
|
#include "hardware/i2c.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
/*
|
/*
|
||||||
|
|
@ -25,29 +24,9 @@
|
||||||
- IIR Filter off
|
- IIR Filter off
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Define the custom pins for I2C
|
|
||||||
#define I2C_SDA_PIN 14 // Replace with your custom SDA pin
|
|
||||||
#define I2C_SCL_PIN 15 // Replace with your custom SCL pin
|
|
||||||
|
|
||||||
// Define the I2C instance to use (i2c0 or i2c1)
|
|
||||||
#define I2C_PORT i2c1
|
|
||||||
|
|
||||||
// device has default bus address of 0x76
|
// device has default bus address of 0x76
|
||||||
#define ADDR _u(0x76)
|
#define ADDR _u(0x76)
|
||||||
|
|
||||||
// hardware registers
|
|
||||||
#define REG_CONFIG _u(0xF5)
|
|
||||||
#define REG_CTRL_MEAS _u(0xF4)
|
|
||||||
// #define REG_RESET _u(0xE0)
|
|
||||||
|
|
||||||
// #define REG_TEMP_XLSB _u(0xFC)
|
|
||||||
// #define REG_TEMP_LSB _u(0xFB)
|
|
||||||
// #define REG_TEMP_MSB _u(0xFA)
|
|
||||||
|
|
||||||
// #define REG_PRESSURE_XLSB _u(0xF9)
|
|
||||||
// #define REG_PRESSURE_LSB _u(0xF8)
|
|
||||||
// #define REG_PRESSURE_MSB _u(0xF7)
|
|
||||||
|
|
||||||
static void bmp280_get_compensation_params(i2c_inst_t *i2c,
|
static void bmp280_get_compensation_params(i2c_inst_t *i2c,
|
||||||
bme280_compensation_params *params) {
|
bme280_compensation_params *params) {
|
||||||
// raw temp and pressure values need to be calibrated according to
|
// raw temp and pressure values need to be calibrated according to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue