123456789101112131415161718192021222324252627282930313233 |
- #pragma once
- #ifndef _SENSOR_H_
- #define _SENSOR_H_
- #if defined(__GNUC__)
- # include <avr/io.h>
- #elif defined(__ICCAVR__)
- # include <ioavr.h>
- # include <intrinsics.h>
- # include <stdint.h>
- #endif
- /* Status code */
- typedef enum {
- AHT_St_OK = 0,
- AHT_St_Err,
- AHT_St_Bsy,
- AHT_St_CRC
- } aht20_st_t;
- /* Data type */
- typedef struct {
- uint16_t Humidity;
- int16_t Temperature;
- } aht20_t;
- /* Function */
- aht20_st_t AHT20_Init(void);
- aht20_st_t AHT20_StartMeasure(void);
- aht20_st_t AHT20_SoftReset(void);
- aht20_st_t AHT20_GetData(aht20_t * data);
- #endif /* _SENSOR_H_ */
|