pimoroni / BreakoutGarden

0 stars 0 forks source link

BM*280 (BME280 and BMP280) #10

Open Gadgetoid opened 3 years ago

Gadgetoid commented 3 years ago
Gadgetoid commented 3 years ago

C++ library currently in patch-bme280-breakouts-dev - https://github.com/pimoroni/pimoroni-pico/tree/patch-bme280-breakouts-dev/drivers/bme280

It's ostensibly for the BME280 but the same code should broadly work with both the BME280 and BMP280, with the omission of humidity readings in the latter. Need some way to handle this in C++ and Python... just an alias?... since in Python there's no need to have two separate sets of bindings if we can help it.

Gadgetoid commented 3 years ago

Maybe drop our custom code and wrap Bosch's official BME280 and BMP280 sensor API libraries? This has been successful with BME68X (https://github.com/pimoroni/pimoroni-pico/pull/143).

The basic step-by-step is:

  1. Submodule in the Bosch library into drivers//src
  2. Add CMakeLists in drivers/ to make the contents of src buildable against the Pico SDK
  3. Add a wrapper to make the library/API bringup easier- IE: it needs to have i2c read/write function pointers passed in at init
  4. Add an example or two