esp32-devkitc: Add BMP180 sensor support
This commit is contained in:
parent
6fb0fd6825
commit
6481eb6523
1 changed files with 44 additions and 0 deletions
|
@ -66,6 +66,14 @@
|
|||
# include "esp32_board_wlan.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32_I2C
|
||||
# include "esp32_board_i2c.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_BMP180
|
||||
# include "esp32_bmp180.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32_AES_ACCELERATOR
|
||||
# include "esp32_aes.h"
|
||||
#endif
|
||||
|
@ -293,6 +301,42 @@ int esp32_bringup(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I2C_DRIVER
|
||||
|
||||
#ifdef CONFIG_ESP32_I2C0
|
||||
ret = esp32_i2c_register(0);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize I2C Driver for I2C0: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32_I2C1
|
||||
ret = esp32_i2c_register(1);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize I2C Driver for I2C1: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_BMP180
|
||||
/* Try to register BMP180 device in I2C0 */
|
||||
|
||||
ret = board_bmp180_initialize(0, 0);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize BMP180 driver: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BUTTONS
|
||||
/* Register the BUTTON driver */
|
||||
|
||||
|
|
Loading…
Reference in a new issue