|
@@ -23,7 +23,18 @@ static portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;
|
|
|
} \
|
|
} \
|
|
|
} while (0)
|
|
} while (0)
|
|
|
|
|
|
|
|
-static esp_err_t dht_attach_pin(){
|
|
|
|
|
|
|
+esp_err_t dht_attach_pin(void);
|
|
|
|
|
+
|
|
|
|
|
+static esp_err_t get_change_time(uint8_t timeout_us, bool expected_level, uint32_t *time_us);
|
|
|
|
|
+
|
|
|
|
|
+static inline esp_err_t dht_communication(uint32_t *data);
|
|
|
|
|
+
|
|
|
|
|
+static inline int16_t data_to_int16(uint8_t MSB, uint8_t LSB);
|
|
|
|
|
+
|
|
|
|
|
+esp_err_t dht_read(float *temperature, float *humidity);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+esp_err_t dht_attach_pin(){
|
|
|
if (DHT_PIN < GPIO_NUM_0 || DHT_PIN >= GPIO_NUM_MAX) {
|
|
if (DHT_PIN < GPIO_NUM_0 || DHT_PIN >= GPIO_NUM_MAX) {
|
|
|
ESP_LOGE(TAG, "Invalid GPIO pin number: %d", DHT_PIN);
|
|
ESP_LOGE(TAG, "Invalid GPIO pin number: %d", DHT_PIN);
|
|
|
return ESP_ERR_INVALID_ARG;
|
|
return ESP_ERR_INVALID_ARG;
|