forked from Traumflug/Teacup_Firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analog.c
44 lines (38 loc) · 1.02 KB
/
analog.c
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
/** \file
\brief Analog subsystem
*/
#include "analog.h"
#include "temp.h"
#ifndef __ARM_STM32F411__
/**
OR-combined mask of all channels. Auto-magically generated from
DEFINE_TEMP_SENSOR() entries in config_wrapper.h
*/
#undef DEFINE_TEMP_SENSOR
#define DEFINE_TEMP_SENSOR(name, type, pin, additional) \
| (((type == TT_THERMISTOR) || (type == TT_AD595)) ? (1 << (pin ## _ADC)) : 0)
#ifdef AIO8_PIN
static const uint16_t analog_mask = 0
#else
static const uint8_t analog_mask = 0
#endif
#include "config_wrapper.h"
;
#undef DEFINE_TEMP_SENSOR
/**
A map of the ADC channels of the defined sensors.
*/
#undef DEFINE_TEMP_SENSOR
#define DEFINE_TEMP_SENSOR(name, type, pin, additional) \
((type == TT_THERMISTOR) || (type == TT_AD595)) ? (pin ## _ADC) : 255,
static uint8_t adc_channel[NUM_TEMP_SENSORS] = {
#include "config_wrapper.h"
};
#undef DEFINE_TEMP_SENSOR
#endif
#define TEACUP_C_INCLUDE
#include "analog-avr.c"
#include "analog-lpc.c"
#include "analog-stm32.c"
#undef TEACUP_C_INCLUDE
// No common code so far.