Skip to content

Commit 009ca13

Browse files
authored
Merge pull request #1 from davideq/main
first release
2 parents a40cf33 + 733811c commit 009ca13

File tree

10 files changed

+3114
-2
lines changed

10 files changed

+3114
-2
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: ILPS22QS Continuous Integration
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '*'
8+
- '**.md'
9+
- '**.txt'
10+
pull_request:
11+
paths-ignore:
12+
- '*'
13+
- '**.md'
14+
- '**.txt'
15+
jobs:
16+
astyle_check:
17+
runs-on: ubuntu-latest
18+
name: AStyle check
19+
steps:
20+
# First of all, clone the repo using the checkout action.
21+
- name: Checkout
22+
uses: actions/checkout@main
23+
24+
- name: Astyle check
25+
id: Astyle
26+
uses: stm32duino/actions/astyle-check@main
27+
28+
# Use the output from the `Astyle` step
29+
- name: Astyle Errors
30+
if: failure()
31+
run: |
32+
cat ${{ steps.Astyle.outputs.astyle-result }}
33+
exit 1
34+
codespell:
35+
name: Check for spelling errors
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@main
40+
41+
# See: https://github.com/codespell-project/actions-codespell/blob/master/README.md
42+
- name: Spell check
43+
uses: codespell-project/actions-codespell@master
44+
with:
45+
check_filenames: true
46+
check_hidden: true
47+
# In the event of a false positive, add the word in all lower case to this file:
48+
ignore_words_file: ./extras/codespell-ignore-words-list.txt
49+
lib_build:
50+
runs-on: ubuntu-latest
51+
name: Library compilation
52+
steps:
53+
54+
# First of all, clone the repo using the checkout action.
55+
- name: Checkout
56+
uses: actions/checkout@main
57+
58+
- name: Compilation
59+
id: compile
60+
uses: stm32duino/actions/compile-examples@main
61+
with:
62+
board-pattern: "NUCLEO_L476RG"
63+
64+
# Use the output from the `Compilation` step
65+
- name: Compilation Errors
66+
if: failure()
67+
run: |
68+
cat ${{ steps.compile.outputs.compile-result }}
69+
exit 1

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,45 @@
1-
# ILPS22QS
2-
Arduino library to support the ILPS22QS 1260-4060 hPa absolute digital ouput barometer with embedded Qvar
1+
#ILPS22QS
2+
3+
Arduino library to support the ILPS22QS absolute digital output barometer
4+
5+
## API
6+
7+
This sensor uses I2C or SPI to communicate.
8+
For I2C it is then required to create a TwoWire interface before accessing to the sensors:
9+
10+
TwoWire dev_i2c(I2C_SDA, I2C_SCL);
11+
dev_i2c.begin();
12+
13+
For SPI it is then required to create a SPI interface before accessing to the sensors:
14+
15+
SPIClass dev_spi(SPI_MOSI, SPI_MISO, SPI_SCK);
16+
dev_spi.begin();
17+
18+
An instance can be created and enabled when the I2C bus is used following the procedure below:
19+
20+
ILPS22QSSensor sensor(&dev_i2c);
21+
sensor.begin();
22+
sensor.Enable();
23+
24+
An instance can be created and enabled when the SPI bus is used following the procedure below:
25+
26+
ILPS22QSSensor sensor(&dev_spi, CS_PIN);
27+
sensor.begin();
28+
sensor.Enable();
29+
30+
The access to the sensor values is done as explained below:
31+
32+
Read pressure and temperature.
33+
34+
float pressure;
35+
float temperature;
36+
sensor.GetPressure(&pressure);
37+
sensor.GetTemperature(&temperature);
38+
39+
## Documentation
40+
41+
You can find the source files at
42+
https://github.com/stm32duino/ILPS22QS
43+
44+
TheILPS22QS datasheet is available at
45+
https://www.st.com/content/st_com/en/products/mems-and-sensors/pressure-sensors/ilps22qs.html
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
@file ILPS22QS_DataLogTerminal.ino
3+
@author STMicroelectronics
4+
@brief Example to use the ILPS22QS absolute digital output barometer
5+
*******************************************************************************
6+
Copyright (c) 2025, STMicroelectronics
7+
All rights reserved.
8+
9+
This software component is licensed by ST under BSD 3-Clause license,
10+
the "License"; You may not use this file except in compliance with the
11+
License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause
12+
13+
*******************************************************************************
14+
*/
15+
16+
// Includes
17+
#include <ILPS22QSSensor.h>
18+
19+
// Create an instance of the ILPS22QS sensor
20+
ILPS22QSSensor sensor(&Wire);
21+
22+
void setup()
23+
{
24+
// Initialize LED for status indication
25+
pinMode(LED_BUILTIN, OUTPUT);
26+
27+
// Initialize serial for output
28+
Serial.begin(115200);
29+
30+
// Initialize bus interface
31+
Wire.begin();
32+
33+
// Initialize sensor component
34+
if (sensor.begin() != ILPS22QS_OK) {
35+
Serial.println("Failed to initialize ILPS22QS sensor.");
36+
while (1);
37+
}
38+
39+
// Enable the sensor
40+
if (sensor.Enable() != ILPS22QS_OK) {
41+
Serial.println("Failed to enable ILPS22QS sensor.");
42+
while (1);
43+
}
44+
Serial.println("ILPS22QS sensor initialized and enabled.");
45+
}
46+
47+
void loop()
48+
{
49+
// Variables to store pressure and temperature
50+
float pressure, temperature;
51+
52+
// Read pressure
53+
if (sensor.GetPressure(&pressure) != ILPS22QS_OK) {
54+
Serial.println("Failed to read pressure.");
55+
}
56+
// Read temperature
57+
if (sensor.GetTemperature(&temperature) != ILPS22QS_OK) {
58+
Serial.println("Failed to read temperature.");
59+
}
60+
61+
// Print pressure and temperature values
62+
Serial.print("Press[hPa]:");
63+
Serial.print(pressure, 2);
64+
Serial.print(", Temp[C]:");
65+
Serial.println(temperature, 2);
66+
67+
// LED blinking for status indication
68+
digitalWrite(LED_BUILTIN, HIGH);
69+
delay(250);
70+
digitalWrite(LED_BUILTIN, LOW);
71+
delay(250);
72+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ois
2+
ths

keywords.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#######################################
2+
# Syntax Coloring Map For LPS22DF
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
ILPS22QSSensor KEYWORD1
10+
ILPS22QSStatusTypeDef KEYWORD1
11+
12+
#######################################
13+
# Methods and Functions (KEYWORD2)
14+
#######################################
15+
16+
begin KEYWORD2
17+
end KEYWORD2
18+
ReadID KEYWORD2
19+
Get_Init_Status KEYWORD2
20+
Enable KEYWORD2
21+
Disable KEYWORD2
22+
GetOutputDataRate KEYWORD2
23+
SetOutputDataRate KEYWORD2
24+
GetPressure KEYWORD2
25+
Get_Press_DRDY_Status KEYWORD2
26+
GetTemperature KEYWORD2
27+
Get_Temp_DRDY_Status KEYWORD2
28+
Read_Reg KEYWORD2
29+
Write_Reg KEYWORD2
30+
Set_One_Shot KEYWORD2
31+
Get_One_Shot_Status KEYWORD2
32+
Set_AVG KEYWORD2
33+
Set_LPF KEYWORD2
34+
35+
#######################################
36+
# Constants (LITERAL1)
37+
#######################################
38+
39+
ILPS22QS_OK LITERAL1
40+
ILPS22QS_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 ILPS22QS
2+
version=1.0.0
3+
author=STMicroelectronics
4+
maintainer=stm32duino
5+
sentence=Ultra Low Power inertial measurement unit.
6+
paragraph=This library provides Arduino support for the Ultra Low Power ILPS22QS for STM32 boards.
7+
category=Sensors
8+
url=https://github.com/stm32duino/ILPS22QS
9+
architectures=*

0 commit comments

Comments
 (0)