sensor.h 573 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #ifndef _SENSOR_H_
  3. #define _SENSOR_H_
  4. #if defined(__GNUC__)
  5. # include <avr/io.h>
  6. #elif defined(__ICCAVR__)
  7. # include <ioavr.h>
  8. # include <intrinsics.h>
  9. # include <stdint.h>
  10. #endif
  11. /* Status code */
  12. typedef enum {
  13. AHT_St_OK = 0,
  14. AHT_St_Err,
  15. AHT_St_Bsy,
  16. AHT_St_CRC
  17. } aht20_st_t;
  18. /* Data type */
  19. typedef struct {
  20. uint16_t Humidity;
  21. int16_t Temperature;
  22. } aht20_t;
  23. /* Function */
  24. aht20_st_t AHT20_Init(void);
  25. aht20_st_t AHT20_StartMeasure(void);
  26. aht20_st_t AHT20_SoftReset(void);
  27. aht20_st_t AHT20_GetData(aht20_t * data);
  28. #endif /* _SENSOR_H_ */