TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
tm_stm32_am2301.h
1 
37 #ifndef TM_AM2301_H
38 #define TM_AM2301_H 100
39 
40 /* C++ detection */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
90 #include "stm32fxxx_hal.h"
91 #include "defines.h"
92 #include "tm_stm32_delay.h"
93 #include "tm_stm32_gpio.h"
94 
104 #ifndef AM2301_PIN
105 #define AM2301_PORT GPIOD
106 #define AM2301_PIN GPIO_PIN_1
107 #endif
108 
125 typedef enum {
135 
139 typedef struct {
140  int16_t Temp;
142  uint16_t Hum;
144  GPIO_TypeDef* GPIOx;
145  uint16_t GPIO_Pin;
146 } TM_AM2301_t;
147 
165 TM_AM2301_Result_t TM_AM2301_Init(TM_AM2301_t* AMStruct, GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
166 
175 
188 /* C++ detection */
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 
194 #endif
Definition: tm_stm32_am2301.h:126
Definition: tm_stm32_am2301.h:129
Definition: tm_stm32_am2301.h:133
TM_AM2301_Result_t
Definition: tm_stm32_am2301.h:125
AM2301 working structure.
Definition: tm_stm32_am2301.h:139
Definition: tm_stm32_am2301.h:130
TM_AM2301_Result_t TM_AM2301_Read(TM_AM2301_t *AMStruct)
Reads data from sensor.
GPIO_TypeDef * GPIOx
Definition: tm_stm32_am2301.h:144
int16_t Temp
Definition: tm_stm32_am2301.h:140
uint16_t GPIO_Pin
Definition: tm_stm32_am2301.h:145
Definition: tm_stm32_am2301.h:127
Definition: tm_stm32_am2301.h:128
TM_AM2301_Result_t TM_AM2301_Init(TM_AM2301_t *AMStruct, GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
Initializes AM2301 sensor.
uint16_t Hum
Definition: tm_stm32_am2301.h:142
Definition: tm_stm32_am2301.h:132
Definition: tm_stm32_am2301.h:131