rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Functions
dac.h File Reference

Data Structures

class  Dac
 

Functions

void initDac ()
 
void setDacVoltage (int channel, float voltage)
 

Function Documentation

◆ initDac()

void initDac ( )

Definition at line 42 of file dac.cpp.

42 {
43 bool dacIsUsed = false;
44 for (size_t i = 0;i<DAC_OUTPUT_COUNT;i++) {
46 if (isBrainPinValid(pin)) {
47 // setting up the output pin as analog as suggested by the Reference Manual.
48 efiSetPadMode("dac", pin, PAL_MODE_INPUT_ANALOG);
49 dacIsUsed = true;
50 }
51 }
52 if (dacIsUsed) {
53 // DAC peripheral changes associated pin behaviour regardless of actual pin mode
56 }
57}
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
void Start(DACConfig &config)
Definition dac.cpp:18
static DACConfig dacConfig
Definition dac.cpp:7
static Dac dacs[]
Definition dac.cpp:35
static constexpr engine_configuration_s * engineConfiguration
bool isBrainPinValid(brain_pin_e brainPin)
brain_pin_e pin
Definition stm32_adc.cpp:15

Referenced by initHardware().

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

◆ setDacVoltage()

void setDacVoltage ( int  channel,
float  voltage 
)

Definition at line 59 of file dac.cpp.

59 {
60 dacs[channel].SetVoltage(0, voltage);
61}
uint16_t channel
Definition adc_inputs.h:104
void SetVoltage(int channel, float volage)
Definition dac.cpp:23

Referenced by configureRusefiLuaHooks().

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

Go to the source code of this file.