rusEFI
The most advanced open source ECU
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 char * getName () const
 
void setName (const char *)
 
const char * getShortName () 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 char * shortName = 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 char * name = nullptr
 

Detailed Description

OutputPin which is reported on Engine Sniffer

Definition at line 111 of file efi_output.h.

Constructor & Destructor Documentation

◆ NamedOutputPin() [1/2]

NamedOutputPin::NamedOutputPin ( )

Definition at line 392 of file efi_gpio.cpp.

392  : OutputPin() {
393 }
Single output pin reference and state.
Definition: efi_output.h:50

◆ NamedOutputPin() [2/2]

NamedOutputPin::NamedOutputPin ( const char *  name)
explicit

Definition at line 395 of file efi_gpio.cpp.

395  : OutputPin() {
396  name = p_name;
397 }
const char * name
Definition: efi_output.h:133

Member Function Documentation

◆ getName()

const char * NamedOutputPin::getName ( ) const

◆ getShortName()

const char * NamedOutputPin::getShortName ( ) const

Definition at line 407 of file efi_gpio.cpp.

407  {
408  return shortName == nullptr ? name : shortName;
409 }
const char * shortName
Definition: efi_output.h:129

Referenced by addEngineSnifferOutputPinEvent(), and printEngineSnifferPinMappings().

Here is the caller graph for this function:

◆ setHigh() [1/2]

void NamedOutputPin::setHigh ( )
virtual

Reimplemented in InjectorOutputPin, and IgnitionOutputPin.

Definition at line 415 of file efi_gpio.cpp.

415  {
416  setHigh(nullptr);
417 }
virtual void setHigh()
Definition: efi_gpio.cpp:415

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

Here is the caller graph for this function:

◆ setHigh() [2/2]

void NamedOutputPin::setHigh ( const char *  msg)
virtual

Definition at line 419 of file efi_gpio.cpp.

419  {
420 #if EFI_UNIT_TEST
421  if (verboseMode) {
422  efiPrintf("pin %s goes high", name);
423  }
424 #endif // EFI_UNIT_TEST
425 #if EFI_DEFAILED_LOGGING
426 // signal->hi_time = hTimeNow();
427 #endif /* EFI_DEFAILED_LOGGING */
428 
429  // turn the output level ACTIVE
430  setValue(msg, true);
431 
432 #if EFI_ENGINE_SNIFFER
434 #endif /* EFI_ENGINE_SNIFFER */
435 }
void setValue(const char *msg, int logicValue, bool isForce=false)
Definition: efi_gpio.cpp:583
bool verboseMode
void addEngineSnifferOutputPinEvent(NamedOutputPin *pin, FrontDirection frontDirection)
static const char * msg

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

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 InjectorOutputPin, and IgnitionOutputPin.

Definition at line 437 of file efi_gpio.cpp.

437  {
438  setLow(nullptr);
439 }
virtual void setLow()
Definition: efi_gpio.cpp:437

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

Here is the caller graph for this function:

◆ setLow() [2/2]

void NamedOutputPin::setLow ( const char *  msg)
virtual

Definition at line 441 of file efi_gpio.cpp.

441  {
442 #if EFI_UNIT_TEST
443  if (verboseMode) {
444  efiPrintf("pin %s goes low", name);
445  }
446 #endif // EFI_UNIT_TEST
447 
448  // turn off the output
449  setValue(msg, false);
450 
451 #if EFI_ENGINE_SNIFFER
453 #endif /* EFI_ENGINE_SNIFFER */
454 }

Referenced by endIntegration(), 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 403 of file efi_gpio.cpp.

403  {
404  name = p_name;
405 }

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 456 of file efi_gpio.cpp.

456  {
457 #if EFI_GPIO_HARDWARE
458  if (isInitialized() && getLogicValue()) {
459  setValue("stop", false);
460  efiPrintf("turning off %s", name);
461  return true;
462  }
463 #endif /* EFI_GPIO_HARDWARE */
464  return false;
465 }
bool getLogicValue() const
Definition: efi_gpio.cpp:646
bool isInitialized() const
Definition: efi_gpio.cpp:536

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 133 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 129 of file efi_output.h.

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


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