forked from Traumflug/Teacup_Firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
temp.h
46 lines (33 loc) · 1.02 KB
/
temp.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef _TEMP_H
#define _TEMP_H
#include "config_wrapper.h"
#include <stdint.h>
/*
NOTES
no point in specifying a port- all the different temp sensors we have must be on a particular port. The MAX6675 must be on the SPI, and the thermistor and AD595 must be on an analog port.
we still need to specify which analog pins we use in machine.h for the analog sensors however, otherwise the analog subsystem won't read them.
*/
#undef DEFINE_TEMP_SENSOR
#define DEFINE_TEMP_SENSOR(name, type, pin, additional) TEMP_SENSOR_ ## name,
typedef enum {
#include "config_wrapper.h"
NUM_TEMP_SENSORS,
TEMP_SENSOR_none
} temp_sensor_t;
#undef DEFINE_TEMP_SENSOR
typedef enum {
TT_THERMISTOR,
TT_MAX6675,
TT_AD595,
TT_PT100,
TT_INTERCOM,
TT_DUMMY,
} temp_type_t;
#define temp_tick temp_sensor_tick
void temp_init(void);
void temp_sensor_tick(void);
uint8_t temp_achieved(void);
void temp_set(temp_sensor_t index, uint16_t temperature);
uint16_t temp_get(temp_sensor_t index);
void temp_print(temp_sensor_t index);
#endif /* _TEMP_H */