rusEFI
The most advanced open source ECU
|
Single output pin reference and state. More...
#include <efi_output.h>
Public Member Functions | |
void | initPin (const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError=false) |
void | initPin (const char *msg, brain_pin_e brainPin) |
void | deInit () |
bool | isInitialized () const |
bool | getAndSet (int logicValue) |
void | setValue (const char *msg, int logicValue, bool isForce=false) |
TEST_VIRTUAL void | setValue (int logicValue, bool isForce=false) |
void | toggle () |
bool | getLogicValue () const |
brain_pin_diag_e | getDiag () const |
void | resetToggleStats () |
Data Fields | |
ioportid_t | m_port = 0 |
uint8_t | m_pin = 0 |
int | pinToggleCounter = 0 |
Timer | pinToggleTimer |
uint32_t | durationsInStateMs [2] |
brain_pin_e | brainPin = Gpio::Unassigned |
bool | ext = false |
int8_t | currentLogicValue = INITIAL_PIN_STATE |
Private Member Functions | |
void | setDefaultPinState (pin_output_mode_e mode) |
void | setOnchipValue (int electricalValue) |
Private Attributes | |
pin_output_mode_e | mode = OM_DEFAULT |
Single output pin reference and state.
Definition at line 50 of file efi_output.h.
void OutputPin::deInit | ( | ) |
Definition at line 781 of file efi_gpio.cpp.
Referenced by initPin(), luaDeInitPins(), stopHip9001_pins(), stopTriggerEmulatorPins(), stopVvtControlPins(), and RegisteredOutputPin::unregister().
bool OutputPin::getAndSet | ( | int | logicValue | ) |
Definition at line 552 of file efi_gpio.cpp.
Referenced by disengageStarterIfNeeded(), and onStartStopButtonToggle().
brain_pin_diag_e OutputPin::getDiag | ( | ) | const |
Definition at line 657 of file efi_gpio.cpp.
Referenced by benchOff(), and SensorChecker::onSlowCallback().
bool OutputPin::getLogicValue | ( | ) | const |
Definition at line 646 of file efi_gpio.cpp.
Referenced by canDashboardHaltech(), getAndSet(), getHellenBoardEnabled(), IdleController::getRunningOpenLoop(), Engine::isMainRelayEnabled(), lua_fan(), populateFrame(), slowStartStopButtonCallback(), NamedOutputPin::stop(), toggle(), updateFlags(), and updateTunerStudioState().
void OutputPin::initPin | ( | const char * | msg, |
brain_pin_e | brainPin | ||
) |
Definition at line 686 of file efi_gpio.cpp.
void OutputPin::initPin | ( | const char * | msg, |
brain_pin_e | brainPin, | ||
pin_output_mode_e | outputMode, | ||
bool | forceInitWithFatalError = false |
||
) |
Definition at line 690 of file efi_gpio.cpp.
Referenced by boardInitHardware(), configureHellenCanTerminator(), hellenMegaAccelerometerPreInitCS2Pin(), RegisteredOutputPin::init(), SimpleTransmissionController::init(), Generic4TransmissionController::init(), Gm4l6xTransmissionController::init(), initAccelerometer(), initErrorLed(), initGpPwm(), StepDirectionStepper::initialize(), initMiscOutputPins(), initPin(), initStatusLeds(), initWarningRunningPins(), nm_bus_init(), portInitAdc(), runSchedulingPrecisionTestIfNeeded(), setHellenEnPin(), DcHardware::start(), EnginePins::startAuxValves(), startHip9001_pins(), EnginePins::startIgnitionPins(), EnginePins::startInjectionPins(), startSimplePwmExt(), startSmartCsPins(), and startTriggerEmulatorPins().
bool OutputPin::isInitialized | ( | ) | const |
Definition at line 536 of file efi_gpio.cpp.
Referenced by assertPinAssigned(), hellenMegaAccelerometerPreInitCS2Pin(), initAccelerometer(), isGdiEngine(), HpfpController::onFastCallback(), HpfpController::scheduleNextCycle(), NamedOutputPin::stop(), and InjectionEvent::update().
void OutputPin::resetToggleStats | ( | ) |
Definition at line 575 of file efi_gpio.cpp.
Referenced by resetPinStats().
|
private |
we track current pin status so that we do not touch the actual hardware if we want to write new pin bit which is same as current pin value. This maybe helps in case of status leds, but maybe it's a total over-engineering
Definition at line 651 of file efi_gpio.cpp.
Referenced by initPin().
|
private |
Definition at line 560 of file efi_gpio.cpp.
Referenced by setValue().
void OutputPin::setValue | ( | const char * | msg, |
int | logicValue, | ||
bool | isForce = false |
||
) |
Definition at line 583 of file efi_gpio.cpp.
Referenced by applyPinState(), PwmConfig::applyPwmValue(), benchOff(), benchOn(), blink_digits(), boardOnConfigurationChange(), configureHellenCanTerminator(), TwoPinDcMotor::disable(), TwoPinDcMotor::enable(), firmwareError(), getAndSet(), hellenDisableEn(), hellenEnableEn(), hellenMegaAccelerometerPreInitCS2Pin(), hipThread(), StepDirectionStepper::initialize(), nm_bus_init(), AcController::onSlowCallback(), FuelPumpController::onSlowCallback(), HarleyAcr::onSlowCallback(), MainRelayController::onSlowCallback(), Engine::OnTriggerSynchronization(), Engine::periodicSlowCallback(), StepDirectionStepper::pulse(), readSlowAnalogInputs(), InjectorOutputPin::reset(), runSchedulingPrecisionTestIfNeeded(), TwoPinDcMotor::set(), setDefaultPinState(), StepDirectionStepper::setDirection(), NamedOutputPin::setHigh(), NamedOutputPin::setLow(), GppwmChannel::setOutput(), PwmWrapper::setSimplePwmDutyCycle(), Generic4TransmissionController::setTccState(), setValue(), DcHardware::start(), startSmartCsPins(), NamedOutputPin::stop(), toggle(), turnAllPinsOff(), and SimpleTransmissionController::update().
void OutputPin::setValue | ( | int | logicValue, |
bool | isForce = false |
||
) |
void OutputPin::toggle | ( | ) |
Definition at line 548 of file efi_gpio.cpp.
Referenced by TriggerDecoderBase::decodeTriggerEvent(), and toggleTestAndScheduleNext().
brain_pin_e OutputPin::brainPin = Gpio::Unassigned |
Definition at line 87 of file efi_output.h.
Referenced by deInit(), getDiag(), initPin(), SensorChecker::onSlowCallback(), runBench(), setOnchipValue(), and setValue().
int8_t OutputPin::currentLogicValue = INITIAL_PIN_STATE |
Definition at line 94 of file efi_output.h.
Referenced by EnginePins::debug(), fireSparkBySettingPinLow(), getLogicValue(), InjectorOutputPin::reset(), setValue(), and startDwellByTurningSparkPinHigh().
uint32_t OutputPin::durationsInStateMs[2] |
Definition at line 82 of file efi_output.h.
Referenced by resetToggleStats(), runBench(), sendPinStatePackets(), and setValue().
bool OutputPin::ext = false |
Definition at line 91 of file efi_output.h.
Referenced by deInit(), initPin(), isInitialized(), and setValue().
uint8_t OutputPin::m_pin = 0 |
Definition at line 73 of file efi_output.h.
Referenced by initPin(), nm_bus_init(), and setOnchipValue().
ioportid_t OutputPin::m_port = 0 |
Definition at line 72 of file efi_output.h.
Referenced by initPin(), isInitialized(), nm_bus_init(), and setOnchipValue().
|
private |
Definition at line 105 of file efi_output.h.
Referenced by setDefaultPinState(), and setValue().
int OutputPin::pinToggleCounter = 0 |
Definition at line 77 of file efi_output.h.
Referenced by initPin(), resetToggleStats(), runBench(), sendPinStatePackets(), and setValue().
Timer OutputPin::pinToggleTimer |
Definition at line 81 of file efi_output.h.
Referenced by setValue().