123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef AM2301_H_
- #define AM2301_H_
- #include <stdint.h>
- #include "common_config.h"
- #include "stm32f4xx.h"
- #define DHT_TIMEOUT 10000
- #define DHT_POLLING_CONTROL 1
- #define DHT_POLLING_INTERVAL_DHT11 2000
- #define DHT_POLLING_INTERVAL_DHT22 1000
- typedef enum
- {
- CONNECTION_ERR = 0,
- READ_ERR,
- PARITY_ERR,
- CONNECTION_OK,
- DATA_OK,
-
- } AM2301_t;
- typedef struct {
- float hum;
- float temp;
- uint8_t ErrorCycle;
- uint8_t SensorState;
- } at2301_data_t;
- typedef struct {
- gpio_t ow_pin;
- IRQn_Type irq;
- } at2301_sensor;
- extern at2301_data_t sAM2301Sensorsdata[MAX_T_SENSORS];
- void DHT_Task_Init(void);
- #endif
|