summaryrefslogtreecommitdiffstats
path: root/firmware/sensor.h
blob: 8662fa9f77e624cb8f511e478f0f7ad77818c789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef SENSOR_H_
#define SENSOR_H_

#include "util.h"

#include <stdint.h>


/* Measurement result. */
struct sensor_result {
	/* The number of the sensor this result belongs to. */
	uint8_t nr;
	/* The raw ADC value of the measurement. */
	uint16_t value;
};

/* The largest sensor ADC value. */
#define SENSOR_MAX	0x3FF

void sensor_start(uint8_t nr);
void sensor_cancel(void);
bool sensor_poll(struct sensor_result *res);

bool sensors_idle(void);

void sensor_init(void);

#endif /* SENSOR_H_ */
bues.ch cgit interface