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 49 of file efi_output.h.
void OutputPin::deInit | ( | ) |
Definition at line 802 of file efi_gpio.cpp.
Referenced by initPin(), luaDeInitPins(), stopTriggerEmulatorPins(), stopVvtControlPins(), and RegisteredOutputPin::unregister().
bool OutputPin::getAndSet | ( | int | logicValue | ) |
Definition at line 575 of file efi_gpio.cpp.
Referenced by disengageStarterIfNeeded(), and doStartCranking().
brain_pin_diag_e OutputPin::getDiag | ( | ) | const |
Definition at line 678 of file efi_gpio.cpp.
Referenced by benchOff(), and SensorChecker::onSlowCallback().
bool OutputPin::getLogicValue | ( | ) | const |
Definition at line 667 of file efi_gpio.cpp.
Referenced by canDashboardHaltech(), configureRusefiLuaHooks(), getAndSet(), getHellenBoardEnabled(), IdleController::getIdlePosition(), IdleController::getRunningOpenLoop(), Engine::isMainRelayEnabled(), populateFrame(), slowStartStopButtonCallback(), NamedOutputPin::stop(), toggle(), updateFlags(), and updateTunerStudioState().
void OutputPin::initPin | ( | const char * | msg, |
brain_pin_e | brainPin | ||
) |
Definition at line 707 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 711 of file efi_gpio.cpp.
Referenced by alphax_2chan_boardInitHardware(), alphax_4chan_boardInitHardware(), alphax_4kGDI_boardInitHardware(), alphax_8chan_boardInitHardware(), alphax_8chan_reva_boardInitHardware(), alphax_gold_boardInitHardware(), alphax_silver_boardInitHardware(), alphax_silver_revA_boardInitHardware(), board_init_ext_gpios(), configureHellenCanTerminator(), hellen154hyundai_f7_boardInitHardware(), hellenMegaAccelerometerPreInitCS2Pin(), RegisteredOutputPin::init(), SimpleTransmissionController::init(), Generic4TransmissionController::init(), Gm4l6xTransmissionController::init(), initAccelerometer(), initErrorLed(), initGpPwm(), StepDirectionStepper::initialize(), initMiscOutputPins(), initPin(), initStatusLeds(), initWarningRunningPins(), nm_bus_init(), portInitAdc(), setHellenEnPin(), DcHardware::start(), EnginePins::startAuxValves(), EnginePins::startIgnitionPins(), EnginePins::startInjectionPins(), startSimplePwmExt(), startSmartCsPins(), and startTriggerEmulatorPins().
bool OutputPin::isInitialized | ( | ) | const |
Definition at line 559 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 598 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 672 of file efi_gpio.cpp.
Referenced by initPin().
|
private |
Definition at line 583 of file efi_gpio.cpp.
Referenced by setValue().
Definition at line 604 of file efi_gpio.cpp.
Referenced by alphax_4kGDI_boardInitHardware(), applyPinState(), PwmConfig::applyPwmValue(), benchOff(), benchOn(), blink_digits(), board_init_ext_gpios(), boardOnConfigurationChange(), configureHellenCanTerminator(), TwoPinDcMotor::disable(), TwoPinDcMotor::enable(), errorHandlerWriteReportFile(), firmwareErrorV(), getAndSet(), hellen154hyundai_f7_boardInitHardware(), hellenMegaAccelerometerPreInitCS2Pin(), StepDirectionStepper::initialize(), nm_bus_init(), AcController::onSlowCallback(), HarleyAcr::onSlowCallback(), MainRelayController::onSlowCallback(), NitrousController::onSlowCallback(), FuelPumpController::onSlowCallback(), VvlController::onSlowCallback(), Engine::OnTriggerSynchronization(), Engine::periodicSlowCallback(), StepDirectionStepper::pulse(), readSlowAnalogInputs(), InjectorOutputPin::reset(), TwoPinDcMotor::set(), setDefaultPinState(), StepDirectionStepper::setDirection(), setHellenEnValue(), NamedOutputPin::setHigh(), NamedOutputPin::setLow(), GppwmChannel::setOutput(), PwmWrapper::setSimplePwmDutyCycle(), Generic4TransmissionController::setTccState(), setValue(), slowAdcEndCB(), DcHardware::start(), startSmartCsPins(), NamedOutputPin::stop(), toggle(), turnAllPinsOff(), and SimpleTransmissionController::update().
void OutputPin::setValue | ( | int | logicValue, |
bool | isForce = false |
||
) |
void OutputPin::toggle | ( | ) |
Definition at line 571 of file efi_gpio.cpp.
Referenced by TriggerDecoderBase::decodeTriggerEvent().
brain_pin_e OutputPin::brainPin = Gpio::Unassigned |
Definition at line 86 of file efi_output.h.
Referenced by deInit(), getDiag(), initPin(), EnginePins::resetForUnitTest(), runBench(), setOnchipValue(), setValue(), and startSimplePwm().
int8_t OutputPin::currentLogicValue = INITIAL_PIN_STATE |
Definition at line 93 of file efi_output.h.
Referenced by fireSparkBySettingPinLow(), getLogicValue(), InjectorOutputPin::reset(), setValue(), and startDwellByTurningSparkPinHigh().
uint32_t OutputPin::durationsInStateMs[2] |
Definition at line 81 of file efi_output.h.
Referenced by resetToggleStats(), runBench(), and setValue().
bool OutputPin::ext = false |
Definition at line 90 of file efi_output.h.
Referenced by deInit(), initPin(), isInitialized(), and setValue().
uint8_t OutputPin::m_pin = 0 |
Definition at line 72 of file efi_output.h.
Referenced by initPin(), nm_bus_init(), and setOnchipValue().
ioportid_t OutputPin::m_port = 0 |
Definition at line 71 of file efi_output.h.
Referenced by initPin(), isInitialized(), nm_bus_init(), and setOnchipValue().
|
private |
Definition at line 104 of file efi_output.h.
Referenced by setDefaultPinState(), and setValue().
int OutputPin::pinToggleCounter = 0 |
Definition at line 76 of file efi_output.h.
Referenced by initPin(), resetToggleStats(), runBench(), and setValue().
Timer OutputPin::pinToggleTimer |
Definition at line 80 of file efi_output.h.
Referenced by setValue().