rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Private Attributes
NamedOutputPin Class Reference

#include <efi_output.h>

Inheritance diagram for NamedOutputPin:
Inheritance graph
[legend]
Collaboration diagram for NamedOutputPin:
Collaboration graph
[legend]

Public Member Functions

 NamedOutputPin ()
 
 NamedOutputPin (const char *name)
 
virtual void setHigh (const char *msg)
 
virtual void setLow (const char *msg)
 
virtual void setHigh ()
 
virtual void setLow ()
 
const chargetName () const
 
void setName (const char *)
 
const chargetShortName () const
 
bool stop ()
 
- Public Member Functions inherited from OutputPin
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

const charshortName = nullptr
 
- Data Fields inherited from OutputPin
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 Attributes

const charname = nullptr
 

Detailed Description

OutputPin which is reported on Engine Sniffer

Definition at line 110 of file efi_output.h.

Constructor & Destructor Documentation

◆ NamedOutputPin() [1/2]

NamedOutputPin::NamedOutputPin ( )

Definition at line 415 of file efi_gpio.cpp.

415 : OutputPin() {
416}
Single output pin reference and state.
Definition efi_output.h:49

◆ NamedOutputPin() [2/2]

NamedOutputPin::NamedOutputPin ( const char name)
explicit

Definition at line 418 of file efi_gpio.cpp.

418 : OutputPin() {
419 name = p_name;
420}
const char * name
Definition efi_output.h:132

Member Function Documentation

◆ getName()

const char * NamedOutputPin::getName ( ) const

◆ getShortName()

const char * NamedOutputPin::getShortName ( ) const

Definition at line 430 of file efi_gpio.cpp.

430 {
431 return shortName == nullptr ? name : shortName;
432}
const char * shortName
Definition efi_output.h:128

Referenced by printEngineSnifferPinMappings().

Here is the caller graph for this function:

◆ setHigh() [1/2]

void NamedOutputPin::setHigh ( )
virtual

Reimplemented in IgnitionOutputPin, and InjectorOutputPin.

Definition at line 438 of file efi_gpio.cpp.

438 {
439 setHigh(nullptr);
440}
virtual void setHigh()
Definition efi_gpio.cpp:438

Referenced by setHigh(), IgnitionOutputPin::setHigh(), and InjectorOutputPin::setHigh().

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

◆ setHigh() [2/2]

void NamedOutputPin::setHigh ( const char msg)
virtual

Definition at line 442 of file efi_gpio.cpp.

442 {
443#if EFI_UNIT_TEST
444 if (verboseMode) {
445 efiPrintf("pin %s goes high", name);
446 }
447#endif // EFI_UNIT_TEST
448#if EFI_DETAILED_LOGGING
449// signal->hi_time = hTimeNow();
450#endif /* EFI_DETAILED_LOGGING */
451
452 // turn the output level ACTIVE
453 setValue(msg, true);
454
455#if EFI_ENGINE_SNIFFER
457#endif /* EFI_ENGINE_SNIFFER */
458}
void setValue(const char *msg, int logicValue, bool isForce=false)
Definition efi_gpio.cpp:604
void addEngineSnifferOutputPinEvent(NamedOutputPin *pin, FrontDirection frontDirection)
bool verboseMode

Referenced by auxPlainPinTurnOn(), and HpfpController::pinTurnOn().

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

◆ setLow() [1/2]

void NamedOutputPin::setLow ( )
virtual

Reimplemented in IgnitionOutputPin, and InjectorOutputPin.

Definition at line 460 of file efi_gpio.cpp.

460 {
461 setLow(nullptr);
462}
virtual void setLow()
Definition efi_gpio.cpp:460

Referenced by setLow(), IgnitionOutputPin::setLow(), and InjectorOutputPin::setLow().

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

◆ setLow() [2/2]

void NamedOutputPin::setLow ( const char msg)
virtual

Definition at line 464 of file efi_gpio.cpp.

464 {
465#if EFI_UNIT_TEST
466 if (verboseMode) {
467 efiPrintf("pin %s goes low", name);
468 }
469#endif // EFI_UNIT_TEST
470
471 // turn off the output
472 setValue(msg, false);
473
474#if EFI_ENGINE_SNIFFER
476#endif /* EFI_ENGINE_SNIFFER */
477}

Referenced by HpfpController::pinTurnOff(), and plainPinTurnOff().

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

◆ setName()

void NamedOutputPin::setName ( const char p_name)

Definition at line 426 of file efi_gpio.cpp.

426 {
427 name = p_name;
428}

Referenced by EnginePins::EnginePins().

Here is the caller graph for this function:

◆ stop()

bool NamedOutputPin::stop ( )
Returns
true if pin was stopped

Definition at line 479 of file efi_gpio.cpp.

479 {
480#if EFI_GPIO_HARDWARE
481 if (isInitialized() && getLogicValue()) {
482 setValue("stop", false);
483 efiPrintf("turning off %s", name);
484 return true;
485 }
486#endif /* EFI_GPIO_HARDWARE */
487 return false;
488}
bool getLogicValue() const
Definition efi_gpio.cpp:667
bool isInitialized() const
Definition efi_gpio.cpp:559

Referenced by EnginePins::stopPins().

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

Field Documentation

◆ name

const char* NamedOutputPin::name = nullptr
private

Definition at line 132 of file efi_output.h.

Referenced by getName(), getShortName(), NamedOutputPin(), setHigh(), setLow(), setName(), and stop().

◆ shortName

const char* NamedOutputPin::shortName = nullptr

rusEfi Engine Sniffer protocol uses these short names to reduce bytes usage

Definition at line 128 of file efi_output.h.

Referenced by EnginePins::EnginePins(), and getShortName().


The documentation for this class was generated from the following files: