6 #include "trigger_scope_config.h"
13 if (
isRunning && adcp->state == ADC_COMPLETE) {
19 ADC_SMPR1_SMP_AN10(TRIGGER_SCOPE_SAMPLE_TIME) |
20 ADC_SMPR1_SMP_AN11(TRIGGER_SCOPE_SAMPLE_TIME) |
21 ADC_SMPR1_SMP_AN12(TRIGGER_SCOPE_SAMPLE_TIME) |
22 ADC_SMPR1_SMP_AN13(TRIGGER_SCOPE_SAMPLE_TIME) |
23 ADC_SMPR1_SMP_AN14(TRIGGER_SCOPE_SAMPLE_TIME) |
24 ADC_SMPR1_SMP_AN15(TRIGGER_SCOPE_SAMPLE_TIME);
27 ADC_SMPR2_SMP_AN0(TRIGGER_SCOPE_SAMPLE_TIME) |
28 ADC_SMPR2_SMP_AN1(TRIGGER_SCOPE_SAMPLE_TIME) |
29 ADC_SMPR2_SMP_AN2(TRIGGER_SCOPE_SAMPLE_TIME) |
30 ADC_SMPR2_SMP_AN3(TRIGGER_SCOPE_SAMPLE_TIME) |
31 ADC_SMPR2_SMP_AN4(TRIGGER_SCOPE_SAMPLE_TIME) |
32 ADC_SMPR2_SMP_AN5(TRIGGER_SCOPE_SAMPLE_TIME) |
33 ADC_SMPR2_SMP_AN6(TRIGGER_SCOPE_SAMPLE_TIME) |
34 ADC_SMPR2_SMP_AN7(TRIGGER_SCOPE_SAMPLE_TIME) |
35 ADC_SMPR2_SMP_AN8(TRIGGER_SCOPE_SAMPLE_TIME) |
36 ADC_SMPR2_SMP_AN9(TRIGGER_SCOPE_SAMPLE_TIME);
51 ADC_SQR3_SQ1_N(TRIGGER_SCOPE_ADC_CH1) | ADC_SQR3_SQ2_N(TRIGGER_SCOPE_ADC_CH2)
54 static constexpr
size_t sampleCount = BIG_BUFFER_SIZE / (2 *
sizeof(uint8_t));
57 chibios_rt::CriticalSectionLocker csl;
61 if (!((TRIGGER_SCOPE_ADC.state == ADC_READY) ||
62 (TRIGGER_SCOPE_ADC.state == ADC_COMPLETE) ||
63 (TRIGGER_SCOPE_ADC.state == ADC_ERROR))) {
106 adcStart(&TRIGGER_SCOPE_ADC,
nullptr);
110 ADCD3.dmamode &= ~(STM32_DMA_CR_PSIZE_MASK | STM32_DMA_CR_MSIZE_MASK);
111 ADCD3.dmamode |= STM32_DMA_CR_PSIZE_BYTE | STM32_DMA_CR_MSIZE_BYTE;
113 efiSetPadMode(
"trg ch1", TRIGGER_SCOPE_PIN_CH1, PAL_MODE_INPUT_ANALOG);
114 #if TRIGGER_SCOPE_HAS_CH2
115 efiSetPadMode(
"trg ch2", TRIGGER_SCOPE_PIN_CH2, PAL_MODE_INPUT_ANALOG);
BigBufferHandle getBigBuffer(BigBufferUser user)
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
const TBuffer * get() const
SingleTimerExecutor scheduler
TunerStudioOutputChannels outputChannels
void schedule(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override
Schedule an action to be executed in the future.
ADCDriver ADCD3
ADC3 driver identifier.
uint16_t adcsample_t
ADC sample data type.
engine_configuration_s * engineConfiguration
static constexpr size_t sampleCount
static const uint32_t smpr1
void triggerScopeEnable()
static scheduling_s restartTimer
static void completionCallback(ADCDriver *adcp)
static const uint32_t smpr2
const BigBufferHandle & triggerScopeGetBuffer()
static BigBufferHandle buffer
void triggerScopeDisable()
static void startSampling(void *=nullptr)
static const ADCConversionGroup adcConvGroupCh1