sensor.h 529 B

1234567891011121314151617181920212223242526272829
  1. #ifndef SENSOR_H_
  2. #define SENSOR_H_
  3. #include "util.h"
  4. #include <stdint.h>
  5. /* Measurement result. */
  6. struct sensor_result {
  7. /* The number of the sensor this result belongs to. */
  8. uint8_t nr;
  9. /* The raw ADC value of the measurement. */
  10. uint16_t value;
  11. };
  12. /* The largest sensor ADC value. */
  13. #define SENSOR_MAX 0x3FF
  14. void sensor_start(uint8_t nr);
  15. void sensor_cancel(void);
  16. bool sensor_poll(struct sensor_result *res);
  17. bool sensors_idle(void);
  18. void sensor_init(void);
  19. #endif /* SENSOR_H_ */