rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Functions
tps.h File Reference

Detailed Description

Date
Nov 15, 2013
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file tps.h.

Data Structures

struct  SentTps
 

Functions

constexpr int convertVoltageTo10bitADC (float voltage)
 
void grabTPSIsClosed ()
 
void grabTPSIsWideOpen ()
 
void grabPedalIsUp ()
 
void grapTps1PrimaryIsClosed ()
 
void grapTps1PrimaryIsOpen ()
 
void grabPedalIsWideOpen ()
 
void sentTpsDecode (SentInput sentCh)
 
float decodeTpsSentValue (float sentValue)
 
bool isDigitalTps1 ()
 

Function Documentation

◆ convertVoltageTo10bitADC()

constexpr int convertVoltageTo10bitADC ( float  voltage)
inlineconstexpr

Definition at line 21 of file tps.h.

21 {
22 return (int) (voltage * TPS_TS_CONVERSION);
23}

Referenced by cypressBoardDefaultConfiguration(), EtbImpl< TBase >::doAutocal(), kinetis_boardConfigOverrides(), setDefaultEngineConfiguration(), setPrometheusDefaults(), setSubaru2011(), setSubaruEG33Defaults(), and updateThrottles().

Here is the caller graph for this function:

◆ decodeTpsSentValue()

float decodeTpsSentValue ( float  sentValue)

Definition at line 59 of file tps.cpp.

59 {
62 return interpolateMsg("tps", /*x1*/0xE48, /*y1*/0, /*x2*/0x1A0, /*y2*/POSITION_FULLY_OPEN, /*x*/sentValue);
64 return interpolateMsg("tps", /*x1*/ 250, /*y1*/0, /*x2*/ 3560, /*y2*/POSITION_FULLY_OPEN, /*x*/sentValue);
65 default:
66 return interpolateMsg("tps", /*x1*/engineConfiguration->customSentTpsMin, /*y1*/0, /*x2*/engineConfiguration->customSentTpsMax, /*y2*/POSITION_FULLY_OPEN, /*x*/sentValue);
67 }
68}
float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, float x)
Linear interpolation by two points.
static constexpr engine_configuration_s * engineConfiguration

Referenced by sentTpsDecode().

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

◆ grabPedalIsUp()

void grabPedalIsUp ( )

search for 'maintainConstantValue' to find how this TS magic works

Definition at line 31 of file tps.cpp.

31 {
32 /**
33 * search for 'maintainConstantValue' to find how this TS magic works
34 */
37}
virtual float getRaw() const
Definition sensor.h:148
@ AcceleratorPedalPrimary
@ AcceleratorPedalSecondary
static void onGrabPedal()
Definition tps.cpp:23
void tsCalibrationSetData(TsCalMode mode, float value, float value2, float timeoutMs)

Referenced by handleCommandX14().

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

◆ grabPedalIsWideOpen()

void grabPedalIsWideOpen ( )

Definition at line 39 of file tps.cpp.

Referenced by handleCommandX14().

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

◆ grabTPSIsClosed()

void grabTPSIsClosed ( )

◆ grabTPSIsWideOpen()

void grabTPSIsWideOpen ( )

◆ grapTps1PrimaryIsClosed()

void grapTps1PrimaryIsClosed ( )

Definition at line 45 of file tps.cpp.

Referenced by handleCommandX14().

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

◆ grapTps1PrimaryIsOpen()

void grapTps1PrimaryIsOpen ( )

Definition at line 50 of file tps.cpp.

Referenced by handleCommandX14().

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

◆ isDigitalTps1()

bool isDigitalTps1 ( )

Definition at line 83 of file tps.cpp.

Referenced by initTps(), and sentTpsDecode().

Here is the caller graph for this function:

◆ sentTpsDecode()

void sentTpsDecode ( SentInput  sentCh)

Definition at line 71 of file tps.cpp.

71 {
72 if ((!isDigitalTps1()) || (engineConfiguration->EtbSentInput != sentCh)) {
73 return;
74 }
75 // todo: move away from weird float API
76 float sentValue = getSentValue(sentCh);
77 float tpsValue = decodeTpsSentValue(sentValue);
78
80}
void setValidValue(float value, efitick_t timestamp)
efitick_t getTimeNowNt()
Definition efitime.cpp:19
float getSentValue(SentInput input)
Definition sent.cpp:135
bool isDigitalTps1()
Definition tps.cpp:83
SentTps sentTps
Definition init_tps.cpp:181
float decodeTpsSentValue(float sentValue)
Definition tps.cpp:59

Referenced by SentDecoderThread().

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

Go to the source code of this file.