BME280 I2C integration fixes
This commit is contained in:
parent
5c25ec4d11
commit
dcbb5f6271
@ -49,7 +49,11 @@
|
|||||||
void bme280_init(uint8_t mode);
|
void bme280_init(uint8_t mode);
|
||||||
void bme280_read(uint8_t mode);
|
void bme280_read(uint8_t mode);
|
||||||
|
|
||||||
|
#ifdef I2C_BME280_ADDR
|
||||||
|
#define BME280_ADDR I2C_BME280_ADDR
|
||||||
|
#else
|
||||||
#define BME280_ADDR (0x77 << 1) /* Alternative 0x76 */
|
#define BME280_ADDR (0x77 << 1) /* Alternative 0x76 */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Diffrent BOSCH chip id's */
|
/* Diffrent BOSCH chip id's */
|
||||||
#define BMP085_CHIP_ID 0x55 /* And also BMP180 */
|
#define BMP085_CHIP_ID 0x55 /* And also BMP180 */
|
||||||
|
@ -43,5 +43,6 @@
|
|||||||
* Robert Olsson
|
* Robert Olsson
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "i2c.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -224,5 +224,11 @@ i2c_probe(void)
|
|||||||
probed |= I2C_CO2SA;
|
probed |= I2C_CO2SA;
|
||||||
print_delim(p++, "CO2SA", del);
|
print_delim(p++, "CO2SA", del);
|
||||||
}
|
}
|
||||||
|
watchdog_periodic();
|
||||||
|
if(!i2c_start(I2C_BME280_ADDR)) {
|
||||||
|
i2c_stop();
|
||||||
|
probed |= I2C_BME280;
|
||||||
|
print_delim(p++, "BME280", del);
|
||||||
|
}
|
||||||
return probed;
|
return probed;
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,13 @@
|
|||||||
/* Here we define the i2c address for dev we support */
|
/* Here we define the i2c address for dev we support */
|
||||||
#define I2C_AT24MAC_ADDR 0xB0 /* EUI64 ADDR */
|
#define I2C_AT24MAC_ADDR 0xB0 /* EUI64 ADDR */
|
||||||
#define I2C_SHT2X_ADDR (0x40 << 1) /* SHT2X ADDR */
|
#define I2C_SHT2X_ADDR (0x40 << 1) /* SHT2X ADDR */
|
||||||
|
#define I2C_BME280_ADDR (0x77 << 1) /* Alternative 0x76 */
|
||||||
|
|
||||||
/* Here we define a enumration for devices */
|
/* Here we define a enumration for devices */
|
||||||
#define I2C_AT24MAC (1<<0)
|
#define I2C_AT24MAC (1<<0)
|
||||||
#define I2C_SHT2X (1<<1)
|
#define I2C_SHT2X (1<<1)
|
||||||
#define I2C_CO2SA (1<<2) /* Sense-Air CO2 */
|
#define I2C_CO2SA (1<<2) /* Sense-Air CO2 */
|
||||||
|
#define I2C_BME280 (1<<3)
|
||||||
|
|
||||||
#define I2C_READ 1
|
#define I2C_READ 1
|
||||||
#define I2C_WRITE 0
|
#define I2C_WRITE 0
|
||||||
|
Loading…
Reference in New Issue
Block a user