esp32-devkitc: Add BMP180 sensor support

This commit is contained in:
Alan C. Assis 2021-04-04 11:50:22 -03:00 committed by Xiang Xiao
parent 6fb0fd6825
commit 6481eb6523

View file

@ -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 */