How to use the BMP280 API

Is there any guide/tutorial on how to use this api https://github.com/BoschSensortec/BMP2-Sensor-API ?

I am currently using the linux module to interface with it for a web thermostat but i would like to integrate the code into my app so i can support more and more sensors as the time goes on. 

 

Best reply by BSTRobin

Hi Iuliean,

Github example code demostrate how to call BMP280 sensor API, https://github.com/BoschSensortec/BMP280_driver/tree/master/examples

According to your hardware connection interface I2C or SPI, implement the following interfaces.
void delay_ms(uint32_t period_ms);
int8_t i2c_reg_write(uint8_t i2c_addr, uint8_t reg_addr, uint8_t *reg_data, uint16_t length);
int8_t i2c_reg_read(uint8_t i2c_addr, uint8_t reg_addr, uint8_t *reg_data, uint16_t length);
int8_t spi_reg_write(uint8_t cs, uint8_t reg_addr, uint8_t *reg_data, uint16_t length);
int8_t spi_reg_read(uint8_t cs, uint8_t reg_addr, uint8_t *reg_data, uint16_t length);

View original
3 replies
Resolved