rusEFI
The most advanced open source ECU
|
Low level ADC code.
rusEfi uses two ADC devices on the same 16 pins at the moment. Two ADC devices are used in orde to distinguish between fast and slow devices. The idea is that but only having few channels in 'fast' mode we can sample those faster?
At the moment rusEfi does not allow to have more than 16 ADC channels combined. At the moment there is no flexibility to use any ADC pins, only the hardcoded choice of 16 pins.
Slow ADC group is used for IAT, CLT, AFR, VBATT etc - this one is currently sampled at 500Hz
Fast ADC group is used for MAP, MAF HIP - this one is currently sampled at 10KHz We need frequent MAP for map_averaging.cpp
10KHz equals one measurement every 3.6 degrees at 6000 RPM
Definition in file adc_inputs.cpp.
Variables | |
static NO_CACHE adcsample_t | slowAdcSamples [SLOW_ADC_CHANNEL_COUNT] |
static adc_channel_mode_e | adcHwChannelEnabled [HW_MAX_ADC_INDEX] |
static uint32_t | slowAdcCounter = 0 |
static int | adcDebugReporting = false |
static ADCConversionGroup | adcgrpcfgFast |
static NO_CACHE adcsample_t | fastAdcSampleBuf [ADC_BUF_DEPTH_FAST *ADC_MAX_CHANNELS_COUNT] |
static float | mcuTemperature |
static GPTConfig | fast_adc_config |
static uint32_t | slowAdcConversionCount = 0 |
static uint32_t | slowAdcErrorsCount = 0 |
static SlowAdcController | slowAdcController |
adc_channel_e | |
float __attribute__ | ( | (weak) | ) |
Definition at line 24 of file adc_inputs.cpp.
|
static |
AdcDevice fastAdc& adcgrpcfgFast | ( | fastAdcSampleBuf | ) |
void addChannel | ( | const char * | name, |
adc_channel_e | setting, | ||
adc_channel_mode_e | mode | ||
) |
Definition at line 402 of file adc_inputs.cpp.
Referenced by addAdcChannelForTrigger(), configureInputs(), and setAdcChannelOverrides().
|
static |
order of analog channels here is totally random and has no meaning we also have some weird implementation with internal indices - that all has no meaning, it's just a random implementation which does not mean anything.
Definition at line 430 of file adc_inputs.cpp.
Referenced by initAdcInputs().
|
static |
Definition at line 169 of file adc_inputs.cpp.
adc_channel_mode_e getAdcMode | ( | adc_channel_e | hwChannel | ) |
Definition at line 228 of file adc_inputs.cpp.
Referenced by AdcSubscription::PrintInfo().
|
static |
Definition at line 85 of file adc_inputs.cpp.
Referenced by getInternalAdcValue(), and printFullAdcReport().
int getInternalAdcValue | ( | const char * | msg, |
adc_channel_e | hwChannel | ||
) |
Definition at line 201 of file adc_inputs.cpp.
float getMCUInternalTemperature | ( | void | ) |
Definition at line 197 of file adc_inputs.cpp.
Referenced by populateFrame(), and updateMiscSensors().
int getSlowAdcCounter | ( | ) |
Definition at line 364 of file adc_inputs.cpp.
float getVoltage | ( | const char * | msg, |
adc_channel_e | hwChannel | ||
) |
Definition at line 51 of file adc_inputs.cpp.
Referenced by getVoltageDivided(), AdcSubscription::PrintInfo(), printMAPInfo(), showHipInfo(), and AdcSubscription::UpdateSubscribers().
float getVoltageDivided | ( | const char * | msg, |
adc_channel_e | hwChannel | ||
) |
Definition at line 46 of file adc_inputs.cpp.
Referenced by getAfr(), and updateRawSensors().
void initAdcInputs | ( | ) |
Definition at line 452 of file adc_inputs.cpp.
Referenced by initHardware().
|
static |
Definition at line 306 of file adc_inputs.cpp.
Referenced by initAdcInputs().
void printFullAdcReport | ( | void | ) |
Definition at line 315 of file adc_inputs.cpp.
Referenced by initSettings(), and printFullAdcReportIfNeeded().
void printFullAdcReportIfNeeded | ( | void | ) |
Definition at line 479 of file adc_inputs.cpp.
Referenced by updateDevConsoleState().
void removeChannel | ( | const char * | name, |
adc_channel_e | setting | ||
) |
Definition at line 419 of file adc_inputs.cpp.
Referenced by setAdcChannelOverrides().
|
static |
Definition at line 351 of file adc_inputs.cpp.
Referenced by initAdcInputs().
void waitForSlowAdc | ( | uint32_t | lastAdcCounter | ) |
Definition at line 356 of file adc_inputs.cpp.
Referenced by initHardware(), and StepperMotorBase::setInitialPosition().
adc_channel_e |
Definition at line 487 of file adc_inputs.cpp.
Referenced by printAdcValue(), and printFullAdcReport().
|
static |
Definition at line 82 of file adc_inputs.cpp.
Referenced by printFullAdcReportIfNeeded(), and setAdcDebugReporting().
|
static |
Definition at line 122 of file adc_inputs.cpp.
Referenced by fast_adc_callback().
|
static |
Definition at line 43 of file adc_inputs.cpp.
Referenced by addChannel(), configureInputs(), getInternalAdcValue(), and removeChannel().
|
static |
Definition at line 221 of file adc_inputs.cpp.
Referenced by initAdcInputs().
|
static |
Definition at line 166 of file adc_inputs.cpp.
|
static |
Definition at line 195 of file adc_inputs.cpp.
Referenced by getMCUInternalTemperature().
|
static |
Definition at line 450 of file adc_inputs.cpp.
Referenced by initAdcInputs().
|
static |
Definition at line 312 of file adc_inputs.cpp.
Referenced by printFullAdcReport().
|
static |
Definition at line 79 of file adc_inputs.cpp.
Referenced by getSlowAdcCounter(), and waitForSlowAdc().
|
static |
Definition at line 313 of file adc_inputs.cpp.
|
static |
Definition at line 41 of file adc_inputs.cpp.
Referenced by getInternalAdcValue(), and printFullAdcReport().