Skip to content

Commit c06dd5a

Browse files
authored
Merge pull request #2 from NoahRosa/master
Implement LPS22HH library
2 parents f7f4a5e + 40aa97a commit c06dd5a

File tree

7 files changed

+3404
-0
lines changed

7 files changed

+3404
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
11
# LPS22HH
22
Arduino library to support the LPS22HH 260-1260 hPa absolute digital ouput barometer
3+
4+
## API
5+
6+
This sensor uses I2C or SPI to communicate.
7+
For I2C it is then required to create a TwoWire interface before accessing to the sensors:
8+
9+
dev_i2c = new TwoWire(I2C_SDA, I2C_SCL);
10+
dev_i2c->begin();
11+
12+
For SPI it is then required to create a SPI interface before accessing to the sensors:
13+
14+
dev_spi = new SPIClass(SPI_MOSI, SPI_MISO, SPI_SCK);
15+
dev_spi->begin();
16+
17+
An instance can be created and enbaled when the I2C bus is used following the procedure below:
18+
19+
PressTemp = new LPS22HHSensor(dev_i2c);
20+
PressTemp->Enable();
21+
22+
An instance can be created and enbaled when the SPI bus is used following the procedure below:
23+
24+
PressTemp = new LPS22HHSensor(dev_spi, CS_PIN);
25+
PressTemp->Enable();
26+
27+
The access to the sensor values is done as explained below:
28+
29+
Read pressure and temperature.
30+
31+
PressTemp->GetPressure(&pressure);
32+
PressTemp->GetTemperature(&temperature);
33+
34+
## Documentation
35+
36+
You can find the source files at
37+
https://github.com/stm32duino/LPS22HH
38+
39+
The LPS22HH datasheet is available at
40+
https://www.st.com/content/st_com/en/products/mems-and-sensors/pressure-sensors/lps22hh.html

keywords.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#######################################
2+
# Syntax Coloring Map For LPS22HH
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
LPS22HHSensor KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
15+
ReadID KEYWORD2
16+
Enable KEYWORD2
17+
Disable KEYWORD2
18+
GetOutputDataRate KEYWORD2
19+
SetOutputDataRate KEYWORD2
20+
GetPressure KEYWORD2
21+
Get_PRESS_DRDY_Status KEYWORD2
22+
GetTemperature KEYWORD2
23+
Get_TEMP_DRDY_Status KEYWORD2
24+
Read_Reg KEYWORD2
25+
Write_Reg KEYWORD2
26+
Get_FIFO_Data KEYWORD2
27+
Get_FIFO_FTh_Status KEYWORD2
28+
Get_FIFO_Full_Status KEYWORD2
29+
Get_FIFO_Ovr_Status KEYWORD2
30+
Get_FIFO_Level KEYWORD2
31+
Reset_FIFO_Interrupt KEYWORD2
32+
Set_FIFO_Interrupt KEYWORD2
33+
Set_FIFO_Mode KEYWORD2
34+
Set_FIFO_Watermark_Level KEYWORD2
35+
Stop_FIFO_On_Watermark KEYWORD2
36+
Set_One_Shot KEYWORD2
37+
Get_One_Shot_Status KEYWORD2
38+
39+
#######################################
40+
# Constants (LITERAL1)
41+
#######################################
42+
43+
LPS22HH_OK LITERAL1
44+
LPS22HH_ERROR LITERAL1

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=STM32duino LPS22HH
2+
version=1.0.0
3+
author=SRA
4+
maintainer=stm32duino
5+
sentence=Nano pressure sensor.
6+
paragraph=This library provides Arduino support for the nano pressure sensor LPS22HH for STM32 boards.
7+
category=Sensors
8+
url=https://github.com/stm32duino/LPS22HH
9+
architectures=stm32, avr, sam

0 commit comments

Comments
 (0)