rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
controllers
sensors
hella_oil_level.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
stored_value_sensor.h
"
4
5
class
HellaOilLevelSensor
:
public
StoredValueSensor
{
6
public
:
7
HellaOilLevelSensor
(
SensorType
type
) :
StoredValueSensor
(
type
, MS2NT(2000)) {}
8
9
void
init
(
brain_pin_e
pin
);
10
void
deInit
();
11
12
void
onEdge
(efitick_t nowNt);
13
14
private
:
15
brain_pin_e
m_pin
=
Gpio::Unassigned
;
16
17
// Measures the width of positive pulses (rising -> falling)
18
Timer
m_pulseTimer
;
19
20
// Measures the time between pulses (rising -> rising)
21
Timer
m_betweenPulseTimer
;
22
23
enum class
NextPulse
{
None
,
Temp
,
Level
,
Diag
};
24
NextPulse
m_nextPulse
=
NextPulse::None
;
25
};
HellaOilLevelSensor
Definition
hella_oil_level.h:5
HellaOilLevelSensor::NextPulse
NextPulse
Definition
hella_oil_level.h:23
HellaOilLevelSensor::NextPulse::None
@ None
HellaOilLevelSensor::NextPulse::Temp
@ Temp
HellaOilLevelSensor::NextPulse::Level
@ Level
HellaOilLevelSensor::NextPulse::Diag
@ Diag
HellaOilLevelSensor::m_pin
brain_pin_e m_pin
Definition
hella_oil_level.h:15
HellaOilLevelSensor::init
void init(brain_pin_e pin)
Definition
hella_oil_level.cpp:13
HellaOilLevelSensor::m_pulseTimer
Timer m_pulseTimer
Definition
hella_oil_level.h:18
HellaOilLevelSensor::HellaOilLevelSensor
HellaOilLevelSensor(SensorType type)
Definition
hella_oil_level.h:7
HellaOilLevelSensor::m_betweenPulseTimer
Timer m_betweenPulseTimer
Definition
hella_oil_level.h:21
HellaOilLevelSensor::deInit
void deInit()
Definition
hella_oil_level.cpp:30
HellaOilLevelSensor::onEdge
void onEdge(efitick_t nowNt)
Definition
hella_oil_level.cpp:42
HellaOilLevelSensor::m_nextPulse
NextPulse m_nextPulse
Definition
hella_oil_level.h:24
Sensor::type
SensorType type() const
Definition
sensor.h:162
StoredValueSensor
Base class for sensors that compute a value on one thread, and want to make it available to consumers...
Definition
stored_value_sensor.h:30
Gpio
Gpio
Definition
rusefi_hw_enums.h:14
Gpio::Unassigned
@ Unassigned
SensorType
SensorType
Definition
sensor_type.h:18
pin
brain_pin_e pin
Definition
stm32_adc.cpp:15
stored_value_sensor.h
Base class for a sensor that has its value asynchronously set, then later retrieved by a consumer.
Generated on Fri Sep 26 2025 00:10:15 for rusEFI by
1.9.8