2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file adc_inputs.h
|
|
|
|
*
|
|
|
|
* @date Dec 7, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2020-04-01 18:32:21 -07:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2021-02-07 15:54:41 -08:00
|
|
|
#include "rusefi_hw_enums.h"
|
|
|
|
|
2024-03-28 18:20:40 -07:00
|
|
|
inline bool isAdcChannelValid(adc_channel_e hwChannel) {
|
2024-05-05 08:45:25 -07:00
|
|
|
/* Compiler will optimize, keep following if as a reminder */
|
|
|
|
if (hwChannel >= EFI_ADC_TOTAL_CHANNELS) {
|
2021-01-05 13:02:20 -08:00
|
|
|
/* 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;
|
|
|
|
}
|
2024-05-05 08:45:25 -07:00
|
|
|
return ((hwChannel > EFI_ADC_NONE) && (hwChannel < EFI_ADC_TOTAL_CHANNELS));
|
2021-01-05 13:02:20 -08:00
|
|
|
}
|
|
|
|
|
2021-12-01 10:35:44 -08:00
|
|
|
#define adcToVoltsDivided(adc) (adcToVolts(adc) * engineConfiguration->analogInputDividerCoefficient)
|
|
|
|
#define GPT_FREQ_FAST 100000
|
|
|
|
#define GPT_PERIOD_FAST 10
|
|
|
|
|
2019-09-22 06:56:06 -07:00
|
|
|
#include "boards.h"
|