mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
esp32[s2|s3]: Add temperature sensor support
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
e467a16abe
commit
98f5d6adc5
@@ -92,6 +92,10 @@
|
||||
# include "esp32s2_board_rmt.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESPRESSIF_TEMP
|
||||
# include "espressif/esp_temperature_sensor.h"
|
||||
#endif
|
||||
|
||||
#include "esp32s2-saola-1.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -380,6 +384,16 @@ int esp32s2_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESPRESSIF_TEMP
|
||||
struct esp_temp_sensor_config_t cfg = TEMPERATURE_SENSOR_CONFIG(10, 50);
|
||||
ret = esp_temperature_sensor_initialize(cfg);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize temperature sensor driver: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTC_DRIVER
|
||||
/* Instantiate the ESP32 RTC driver */
|
||||
|
||||
|
||||
@@ -117,6 +117,10 @@
|
||||
#include "esp32s3_board_adc.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESPRESSIF_TEMP
|
||||
# include "espressif/esp_temperature_sensor.h"
|
||||
#endif
|
||||
|
||||
#include "esp32s3-devkit.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -259,6 +263,16 @@ int esp32s3_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESPRESSIF_TEMP
|
||||
struct esp_temp_sensor_config_t cfg = TEMPERATURE_SENSOR_CONFIG(10, 50);
|
||||
ret = esp_temperature_sensor_initialize(cfg);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize temperature sensor driver: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTC_DRIVER
|
||||
/* Instantiate the ESP32-S3 RTC driver */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user