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

#include <Lps25Sensor.h>

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

Public Member Functions

 Lps25Sensor (Lps25 &sensor)
 
void update ()
 
void showInfo (const char *sensorName) const override
 
- Public Member Functions inherited from StoredValueSensor
SensorResult get () const final override
 
 StoredValueSensor (SensorType type, efidur_t timeoutNt)
 
void invalidate ()
 
void invalidate (UnexpectedCode why)
 
void setValidValue (float value, efitick_t timestamp)
 
void showInfo (const char *sensorName) const override
 
virtual void setTimeout (int timeoutMs)
 
- Public Member Functions inherited from Sensor
bool Register ()
 
const chargetSensorName () const
 
virtual bool hasSensor () const
 
virtual float getRaw () const
 
virtual bool isRedundant () const
 
void unregister ()
 
SensorType type () const
 

Private Attributes

Lps25m_sensor
 

Additional Inherited Members

- Static Public Member Functions inherited from Sensor
static void showAllSensorInfo ()
 
static void showInfo (SensorType type)
 
static void resetRegistry ()
 
static const SensorgetSensorOfType (SensorType type)
 
static SensorResult get (SensorType type)
 
static float getOrZero (SensorType type)
 
static float getRaw (SensorType type)
 
static bool isRedundant (SensorType type)
 
static bool hasSensor (SensorType type)
 
static void setMockValue (SensorType type, float value, bool mockRedundant=false)
 
static void setInvalidMockValue (SensorType type)
 
static void resetMockValue (SensorType type)
 
static void resetAllMocks ()
 
static void inhibitTimeouts (bool inhibit)
 
static const chargetSensorName (SensorType type)
 
- Protected Member Functions inherited from Sensor
 Sensor (SensorType type)
 
- Static Protected Attributes inherited from Sensor
static bool s_inhibitSensorTimeouts = false
 

Detailed Description

Definition at line 6 of file Lps25Sensor.h.

Constructor & Destructor Documentation

◆ Lps25Sensor()

Lps25Sensor::Lps25Sensor ( Lps25 sensor)
explicit

Definition at line 9 of file Lps25Sensor.cpp.

12{
13}
Lps25 * m_sensor
Definition Lps25Sensor.h:14
Base class for sensors that compute a value on one thread, and want to make it available to consumers...
static Lps25Sensor sensor(device)
@ BarometricPressure

Member Function Documentation

◆ showInfo()

void Lps25Sensor::showInfo ( const char sensorName) const
overridevirtual

Implements Sensor.

Definition at line 78 of file sensor_info_printing.cpp.

78 {
79 efiPrintf("%s: LPS25 baro %.2f kPa", sensorName, get().Value);
80}
SensorResult get() const final override
Here is the call graph for this function:

◆ update()

void Lps25Sensor::update ( )

Definition at line 15 of file Lps25Sensor.cpp.

15 {
16 auto result = m_sensor->readPressureKpa();
17
18 if (result) {
19 setValidValue(result.Value, getTimeNowNt());
20 } else {
21 invalidate();
22 }
23}
expected< float > readPressureKpa()
Definition lps25.cpp:76
void setValidValue(float value, efitick_t timestamp)
efitick_t getTimeNowNt()
Definition efitime.cpp:19

Referenced by baroLps25Update().

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

Field Documentation

◆ m_sensor

Lps25* Lps25Sensor::m_sensor
private

Definition at line 14 of file Lps25Sensor.h.

Referenced by update().


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