bmp180: make a lower level interface available and support oversampling.
An application using multiple I2C devices will need it's own loop. This reworks the code to make the detection, calibration constant loading, and measurment functions available too without having to use the bmp810 task which is still retained. Adds support for oversampling. Fixes a bug in the calculation of the temperature. Better error handling. Checks for I2C errors and errors in the loading of the calibration constants and propagates these up.
This commit is contained in:
parent
6915caf49c
commit
05bbe48bd4
3 changed files with 190 additions and 155 deletions
|
@ -73,7 +73,7 @@ void bmp180_task(void *pvParameters)
|
|||
bmp180_trigger_measurement(com_queue);
|
||||
break;
|
||||
case MY_EVT_BMP180:
|
||||
printf("%s: Received BMP180 Event temp:=%d.%d°C press=%d.%02dhPa\n", __FUNCTION__, \
|
||||
printf("%s: Received BMP180 Event temp:=%d.%dC press=%d.%02dhPa\n", __FUNCTION__, \
|
||||
(int32_t)ev.bmp180_data.temperature, abs((int32_t)(ev.bmp180_data.temperature*10)%10), \
|
||||
ev.bmp180_data.pressure/100, ev.bmp180_data.pressure%100 );
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue