rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
tps.h
Go to the documentation of this file.
1/**
2 * @file tps.h
3 * @brief
4 *
5 *
6 * @date Nov 15, 2013
7 * @author Andrey Belomutskiy, (c) 2012-2020
8 */
9
10#pragma once
11
12#include "global.h"
14
15// Scaled to 1000 counts = 5.0 volts
16#define TPS_TS_CONVERSION 200
17
18// we have this '100' magic constant too often for two many other reasons todo: refactor further?
19#define POSITION_FULLY_OPEN 100
20
21constexpr inline int convertVoltageTo10bitADC(float voltage) {
22 return (int) (voltage * TPS_TS_CONVERSION);
23}
24
27void grabPedalIsUp();
31
32#if EFI_SENT_SUPPORT
33
34struct SentTps : public StoredValueSensor {
36 }
37
38 bool isRedundant() const override {
39 return true;
40 }
41};
42
43void sentTpsDecode(SentInput sentCh);
44float decodeTpsSentValue(float sentValue);
45bool isDigitalTps1();
46
47#endif
Base class for sensors that compute a value on one thread, and want to make it available to consumers...
Main engine configuration data structure.
SentInput
SensorType
Definition sensor_type.h:18
Definition tps.h:34
SentTps()
Definition tps.h:35
bool isRedundant() const override
Definition tps.h:38
void grabPedalIsUp()
Definition tps.cpp:31
constexpr int convertVoltageTo10bitADC(float voltage)
Definition tps.h:21
bool isDigitalTps1()
Definition tps.cpp:83
void grabTPSIsWideOpen()
void grabTPSIsClosed()
void grapTps1PrimaryIsClosed()
Definition tps.cpp:45
void grapTps1PrimaryIsOpen()
Definition tps.cpp:50
void sentTpsDecode(SentInput sentCh)
Definition tps.cpp:71
float decodeTpsSentValue(float sentValue)
Definition tps.cpp:59
void grabPedalIsWideOpen()
Definition tps.cpp:39