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

#include <tcu.h>

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

Public Member Functions

virtual void update (gear_e)
 
virtual void init ()
 
virtual gear_e getCurrentGear () const
 
virtual TransmissionControllerMode getMode () const
 

Protected Member Functions

virtual gear_e setCurrentGear (gear_e)
 
void postState ()
 
void measureShiftTime (gear_e)
 
float isShiftCompleted ()
 

Protected Attributes

gear_e currentGear = NEUTRAL
 

Private Attributes

Timer m_shiftTimer
 
bool m_shiftTime
 
gear_e m_shiftTimeGear
 

Additional Inherited Members

- Data Fields inherited from tcu_controller_s
int8_t tcuCurrentGear = (int8_t)0
 
uint8_t alignmentFill_at_1 [1] = {}
 
scaled_channel< uint16_t, 100, 1 > tcRatio = (uint16_t)0
 
float lastShiftTime = (float)0
 
uint8_t tcu_currentRange = (uint8_t)0
 
int8_t pressureControlDuty = (int8_t)0
 
int8_t torqueConverterDuty = (int8_t)0
 
uint8_t alignmentFill_at_11 [1] = {}
 
bool isShifting: 1 {}
 
bool unusedBit_9_1: 1 {}
 
bool unusedBit_9_2: 1 {}
 
bool unusedBit_9_3: 1 {}
 
bool unusedBit_9_4: 1 {}
 
bool unusedBit_9_5: 1 {}
 
bool unusedBit_9_6: 1 {}
 
bool unusedBit_9_7: 1 {}
 
bool unusedBit_9_8: 1 {}
 
bool unusedBit_9_9: 1 {}
 
bool unusedBit_9_10: 1 {}
 
bool unusedBit_9_11: 1 {}
 
bool unusedBit_9_12: 1 {}
 
bool unusedBit_9_13: 1 {}
 
bool unusedBit_9_14: 1 {}
 
bool unusedBit_9_15: 1 {}
 
bool unusedBit_9_16: 1 {}
 
bool unusedBit_9_17: 1 {}
 
bool unusedBit_9_18: 1 {}
 
bool unusedBit_9_19: 1 {}
 
bool unusedBit_9_20: 1 {}
 
bool unusedBit_9_21: 1 {}
 
bool unusedBit_9_22: 1 {}
 
bool unusedBit_9_23: 1 {}
 
bool unusedBit_9_24: 1 {}
 
bool unusedBit_9_25: 1 {}
 
bool unusedBit_9_26: 1 {}
 
bool unusedBit_9_27: 1 {}
 
bool unusedBit_9_28: 1 {}
 
bool unusedBit_9_29: 1 {}
 
bool unusedBit_9_30: 1 {}
 
bool unusedBit_9_31: 1 {}
 

Detailed Description

Definition at line 18 of file tcu.h.

Member Function Documentation

◆ getCurrentGear()

gear_e TransmissionControllerBase::getCurrentGear ( ) const
virtual

Definition at line 26 of file tcu.cpp.

26 {
27 return currentGear;
28}

Referenced by postState(), setCurrentGear(), and Generic4TransmissionController::update().

Here is the caller graph for this function:

◆ getMode()

virtual TransmissionControllerMode TransmissionControllerBase::getMode ( ) const
inlinevirtual

Reimplemented in SimpleTransmissionController, Generic4TransmissionController, and Gm4l6xTransmissionController.

Definition at line 27 of file tcu.h.

Referenced by GearControllerBase::update().

Here is the caller graph for this function:

◆ init()

void TransmissionControllerBase::init ( )
virtual

Reimplemented in SimpleTransmissionController, Generic4TransmissionController, and Gm4l6xTransmissionController.

Definition at line 14 of file tcu.cpp.

14 {
15}

Referenced by GearControllerBase::initTransmissionController().

Here is the caller graph for this function:

◆ isShiftCompleted()

float TransmissionControllerBase::isShiftCompleted ( )
protected

Definition at line 48 of file tcu.cpp.

48 {
51 // If gear detection is set up and the gear we are trying to shift into has been detected
52 if (detected.Valid && m_shiftTime && m_shiftTimeGear == detected.Value) {
53 m_shiftTime = false;
54 return m_shiftTimer.getElapsedSeconds();
55 // If ISS isn't configured, we want to use a fixed value.
56 } else if (!iss.Valid && m_shiftTime && m_shiftTimer.hasElapsedMs(config->tcu_shiftTime)) {
57 m_shiftTime = false;
58 // convert ms to seconds for gauge
59 return config->tcu_shiftTime * 0.001;
60 } else {
61 // a return value of 0 means the shift is not completed yet
62 return 0;
63 }
64}
virtual SensorResult get() const =0
static constexpr persistent_config_s * config

Referenced by Generic4TransmissionController::update().

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

◆ measureShiftTime()

void TransmissionControllerBase::measureShiftTime ( gear_e  gear)
protected

Definition at line 42 of file tcu.cpp.

42 {
43 m_shiftTime = true;
44 m_shiftTimer.reset();
45 m_shiftTimeGear = gear;
46}

Referenced by Generic4TransmissionController::update().

Here is the caller graph for this function:

◆ postState()

void TransmissionControllerBase::postState ( )
protected

Definition at line 30 of file tcu.cpp.

30 {
31#if EFI_TUNER_STUDIO
33 auto rpm = Sensor::get(SensorType::Rpm);
34 if (iss.Valid && rpm.Valid) {
35 tcRatio = rpm.Value / iss.Value;
36 }
38#endif
39}
virtual gear_e getCurrentGear() const
Definition tcu.cpp:26
scaled_channel< uint16_t, 100, 1 > tcRatio

Referenced by update().

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

◆ setCurrentGear()

gear_e TransmissionControllerBase::setCurrentGear ( gear_e  gear)
protectedvirtual

Definition at line 21 of file tcu.cpp.

21 {
22 currentGear = gear;
23 return getCurrentGear();
24}

Referenced by SimpleTransmissionController::update(), and Generic4TransmissionController::update().

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

◆ update()

void TransmissionControllerBase::update ( gear_e  )
virtual

Reimplemented in SimpleTransmissionController, Generic4TransmissionController, and Gm4l6xTransmissionController.

Definition at line 17 of file tcu.cpp.

17 {
18 postState();
19}

Referenced by GearControllerBase::update(), and SimpleTransmissionController::update().

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

Field Documentation

◆ currentGear

gear_e TransmissionControllerBase::currentGear = NEUTRAL
protected

Definition at line 31 of file tcu.h.

Referenced by getCurrentGear(), and setCurrentGear().

◆ m_shiftTime

bool TransmissionControllerBase::m_shiftTime
private

Definition at line 21 of file tcu.h.

Referenced by isShiftCompleted(), and measureShiftTime().

◆ m_shiftTimeGear

gear_e TransmissionControllerBase::m_shiftTimeGear
private

Definition at line 22 of file tcu.h.

Referenced by isShiftCompleted(), and measureShiftTime().

◆ m_shiftTimer

Timer TransmissionControllerBase::m_shiftTimer
private

Definition at line 20 of file tcu.h.

Referenced by isShiftCompleted(), and measureShiftTime().


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