rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
hw_layer
sensors
lps25.h
Go to the documentation of this file.
1
/**
2
* @file lps25.h
3
* @brief Driver for the ST LPS22HB and LPS25HB pressure sensor
4
*
5
* @date February 6, 2020
6
* @author Matthew Kennedy, (c) 2020
7
*/
8
9
#pragma once
10
11
#include "
i2c_bb.h
"
12
13
class
Lps25
{
14
public
:
15
// Returns true if the sensor was initialized successfully.
16
bool
init
(
brain_pin_e
scl,
brain_pin_e
sda);
17
18
expected<float>
readPressureKpa
();
19
bool
hasInit
()
const
{
20
return
m_hasInit
;
21
}
22
23
private
:
24
BitbangI2c
m_i2c
;
25
26
enum class
Type
{
27
Lps22
,
28
Lps25
,
29
};
30
31
Type
m_type
;
32
33
bool
m_hasInit
=
false
;
34
35
uint8_t
regCr1
()
const
;
36
};
BitbangI2c
Definition
i2c_bb.h:11
Lps25
Definition
lps25.h:13
Lps25::init
bool init(brain_pin_e scl, brain_pin_e sda)
Definition
lps25.cpp:37
Lps25::hasInit
bool hasInit() const
Definition
lps25.h:19
Lps25::regCr1
uint8_t regCr1() const
Definition
lps25.cpp:116
Lps25::Type
Type
Definition
lps25.h:26
Lps25::Type::Lps25
@ Lps25
Lps25::Type::Lps22
@ Lps22
Lps25::readPressureKpa
expected< float > readPressureKpa()
Definition
lps25.cpp:76
Lps25::m_i2c
BitbangI2c m_i2c
Definition
lps25.h:24
Lps25::m_type
Type m_type
Definition
lps25.h:31
Lps25::m_hasInit
bool m_hasInit
Definition
lps25.h:33
Gpio
Gpio
Definition
rusefi_hw_enums.h:14
i2c_bb.h
Bit-banged I2C driver.
Generated on Sat Sep 27 2025 00:10:07 for rusEFI by
1.9.8