sensor.h 584 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. AHT10_St_OK = 0,
  14. AHT10_St_Err,
  15. AHT10_St_Bsy
  16. } aht10_st_t;
  17. /* Data type */
  18. typedef struct {
  19. uint8_t Status;
  20. uint16_t Humidity;
  21. int16_t Temperature;
  22. } aht10_t;
  23. /* Function */
  24. aht10_st_t AHT10_Init(void);
  25. aht10_st_t AHT10_StartMeasure(void);
  26. aht10_st_t AHT10_SoftReset(void);
  27. aht10_st_t AHT10_GetData(aht10_t * data);
  28. #endif /* _SENSOR_H_ */