forked from rusefi/rusefi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadc_inputs.h
More file actions
31 lines (26 loc) · 706 Bytes
/
adc_inputs.h
File metadata and controls
31 lines (26 loc) · 706 Bytes
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
/**
* @file adc_inputs.h
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
#include "rusefi_hw_enums.h"
static inline bool isAdcChannelValid(adc_channel_e hwChannel) {
if (hwChannel <= EFI_ADC_NONE) {
return false;
} else if (hwChannel >= EFI_ADC_LAST_CHANNEL) {
/* this should not happen!
* if we have enum out of range somewhere in settings
* that means something goes terribly wrong
* TODO: should we say something?
*/
return false;
} else {
return true;
}
}
#define adcToVoltsDivided(adc) (adcToVolts(adc) * engineConfiguration->analogInputDividerCoefficient)
#define GPT_FREQ_FAST 100000
#define GPT_PERIOD_FAST 10
#include "boards.h"