rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
trigger_scope.h File Reference

Functions

void triggerScopeEnable ()
 
void triggerScopeDisable ()
 
const BigBufferHandletriggerScopeGetBuffer ()
 
void initTriggerScope ()
 

Function Documentation

◆ initTriggerScope()

void initTriggerScope ( )

Definition at line 104 of file trigger_scope.cpp.

104 {
105 // Trigger scope and knock currently mutually exclusive
107 adcStart(&TRIGGER_SCOPE_ADC, nullptr);
108
109 // Manually set ADC DMA to byte mode, as we'll be taking 8 bit samples
110 // Defaults are to sample at 12 bits, and DMA 16-bit words
111 ADCD3.dmamode &= ~(STM32_DMA_CR_PSIZE_MASK | STM32_DMA_CR_MSIZE_MASK);
112 ADCD3.dmamode |= STM32_DMA_CR_PSIZE_BYTE | STM32_DMA_CR_MSIZE_BYTE;
113
114 efiSetPadMode("trg ch1", TRIGGER_SCOPE_PIN_CH1, PAL_MODE_INPUT_ANALOG);
115#if TRIGGER_SCOPE_HAS_CH2
116 efiSetPadMode("trg ch2", TRIGGER_SCOPE_PIN_CH2, PAL_MODE_INPUT_ANALOG);
117#endif
118 }
119}
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
static constexpr engine_configuration_s * engineConfiguration
ADCDriver ADCD3
ADC3 driver identifier.
Definition hal_adc_lld.c:54

Referenced by initHardware().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ triggerScopeDisable()

void triggerScopeDisable ( )

Definition at line 81 of file trigger_scope.cpp.

81 {
82 // we're done with the buffer - let somebody else have it
83 buffer = {};
84
85 isRunning = false;
87}
TunerStudioOutputChannels outputChannels
Definition engine.h:109
static EngineAccessor engine
Definition engine.h:413
static bool isRunning
static BigBufferHandle buffer

Referenced by TunerStudio::handleCrcCommand(), and startSampling().

Here is the caller graph for this function:

◆ triggerScopeEnable()

void triggerScopeEnable ( )

Definition at line 73 of file trigger_scope.cpp.

73 {
75
76 isRunning = true;
77
79}
BigBufferHandle getBigBuffer(BigBufferUser user)
static void startSampling()

Referenced by TunerStudio::handleCrcCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ triggerScopeGetBuffer()

const BigBufferHandle & triggerScopeGetBuffer ( )

Definition at line 92 of file trigger_scope.cpp.

92 {
94
95 // Start the next sample once we've read out this one
96 if (isRunning) {
97 static auto const startSamplingAction{ action_s::make<startSampling>() };
98 engine->scheduler.schedule("trigger scope", &restartTimer, getTimeNowNt() + MS2NT(10), startSamplingAction);
99 }
100
101 return buffer;
102}
SingleTimerExecutor scheduler
Definition engine.h:271
void schedule(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s const &action) override
Schedule an action to be executed in the future.
efitick_t getTimeNowNt()
Definition efitime.cpp:19
static scheduling_s restartTimer

Referenced by TunerStudio::handleCrcCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.