sensor.h 527 B

12345678910111213141516171819202122232425262728293031
  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. int8_t Humidity;
  20. int8_t Temperature;
  21. } aht10_t;
  22. /* Function */
  23. aht10_st_t AHT10_Init(void);
  24. aht10_st_t AHT10_StartMeasure(void);
  25. aht10_st_t AHT10_GetData(aht10_t * data);
  26. #endif /* _SENSOR_H_ */