Skip to content

Commit c491c30

Browse files
authored
Merge pull request #1 from davideq/main
first release
2 parents a0f198c + e5fee50 commit c491c30

File tree

10 files changed

+7524
-1
lines changed

10 files changed

+7524
-1
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: ISM330IS 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: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
11
# ISM330IS
2-
Arduino library to support the ISM330IS 3D accelerometer and 3D gyroscope with ISPU
2+
Arduino library to support the ISM330IS 3D accelerometer and 3D gyroscope
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+
TwoWire dev_i2c(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+
SPIClass dev_spi(SPI_MOSI, SPI_MISO, SPI_SCK);
15+
dev_spi.begin();
16+
17+
An instance can be created and enabled when the I2C bus is used following the procedure below:
18+
19+
ISM330ISSensor AccGyr(&dev_i2c);
20+
AccGyr.begin();
21+
AccGyr.Enable_X();
22+
AccGyr.Enable_G();
23+
24+
An instance can be created and enabled when the SPI bus is used following the procedure below:
25+
26+
ISM330ISSensor AccGyr(&dev_spi, CS_PIN);
27+
AccGyr.begin();
28+
AccGyr.Enable_X();
29+
AccGyr.Enable_G();
30+
31+
The access to the sensor values is done as explained below:
32+
33+
Read accelerometer and gyroscope.
34+
35+
ISM330IS_Axes_t accelerometer;
36+
ISM330IS_Axes_t gyroscope;
37+
AccGyr.Get_X_Axes(accelerometer);
38+
AccGyr.Get_G_Axes(gyroscope);
39+
40+
## Examples
41+
42+
* ISM330IS_DataLog_Terminal: This application shows how to get data from ISM330IS accelerometer and gyroscope and print them on terminal.
43+
44+
## Documentation
45+
46+
You can find the source files at
47+
https://github.com/stm32duino/ISM330IS
48+
49+
The ISM330IS datasheet is available at
50+
https://www.st.com/en/mems-and-sensors/ism330is.html
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
@file ISM330IS_DataLog_Terminal.ino
3+
@author STMicroelectronics
4+
@brief Example to use the ISM330IS inertial measurement sensor
5+
*******************************************************************************
6+
Copyright (c) 2025, STMicroelectronics
7+
All rights reserved.
8+
This software component is licensed by ST under BSD 3-Clause license,
9+
the "License"; You may not use this file except in compliance with the
10+
License. You may obtain a copy of the License at:
11+
opensource.org/licenses/BSD-3-Clause
12+
*******************************************************************************
13+
*/
14+
15+
#include <ISM330ISSensor.h>
16+
17+
ISM330ISSensor sensor(&Wire);
18+
19+
20+
void setup()
21+
{
22+
pinMode(LED_BUILTIN, OUTPUT);
23+
Serial.begin(115200);
24+
Wire.begin();
25+
sensor.begin();
26+
sensor.Enable_X();
27+
sensor.Enable_G();
28+
}
29+
30+
void loop()
31+
{
32+
ISM330IS_Axes_t accel;
33+
ISM330IS_Axes_t angrate;
34+
sensor.Get_X_Axes(&accel);
35+
sensor.Get_G_Axes(&angrate);
36+
37+
Serial.print("Accel-X[mg]:");
38+
Serial.print(accel.x);
39+
Serial.print(",Accel-Y[mg]:");
40+
Serial.print(accel.y);
41+
Serial.print(",Accel-Z[mg]:");
42+
Serial.println(accel.z);
43+
44+
Serial.print("AngRate-X[mdps]:");
45+
Serial.print(angrate.x);
46+
Serial.print(",AngRate-Y[mdps]:");
47+
Serial.print(angrate.y);
48+
Serial.print(",AngRate-Z[mdps]:");
49+
Serial.println(angrate.z);
50+
51+
blink(LED_BUILTIN);
52+
}
53+
54+
inline void blink(int pin)
55+
{
56+
digitalWrite(pin, HIGH);
57+
delay(25);
58+
digitalWrite(pin, LOW);
59+
delay(975);
60+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DOUT

keywords.txt

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#######################################
2+
# Syntax Coloring Map For ISM330IS
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
ISM330ISSensor KEYWORD1
10+
ISM330IS_SensorIntPin_t KEYWORD1
11+
ISM330IS_AxesRaw_t KEYWORD1
12+
ISM330IS_Axes_t KEYWORD1
13+
ISM330IS_Event_Status_t KEYWORD1
14+
15+
#######################################
16+
# Methods and Functions (KEYWORD2)
17+
#######################################
18+
19+
ReadID KEYWORD2
20+
Read_Reg KEYWORD2
21+
Write_Reg KEYWORD2
22+
Set_Interrupt_Latch KEYWORD2
23+
Enable_X KEYWORD2
24+
Disable_X KEYWORD2
25+
Get_X_Sensitivity KEYWORD2
26+
Get_X_OutputDataRate KEYWORD2
27+
Set_X_OutputDataRate KEYWORD2
28+
Get_X_FullScale KEYWORD2
29+
Set_X_FullScale KEYWORD2
30+
Get_X_AxesRaw KEYWORD2
31+
Get_X_Axes KEYWORD2
32+
Enable_G KEYWORD2
33+
Disable_G KEYWORD2
34+
Get_G_Sensitivity KEYWORD2
35+
Get_G_OutputDataRate KEYWORD2
36+
Set_G_OutputDataRate KEYWORD2
37+
Get_G_FullScale KEYWORD2
38+
Set_G_FullScale KEYWORD2
39+
Get_G_AxesRaw KEYWORD2
40+
Get_G_Axes KEYWORD2
41+
Get_X_Event_Status KEYWORD2
42+
Set_X_SelfTest KEYWORD2
43+
Get_X_DRDY_Status KEYWORD2
44+
Get_X_Init_Status KEYWORD2
45+
Set_X_INT1_DRDY KEYWORD2
46+
Set_G_SelfTest KEYWORD2
47+
Get_G_DRDY_Status KEYWORD2
48+
Get_G_Init_Status KEYWORD2
49+
Set_G_INT1_DRDY KEYWORD2
50+
Set_DRDY_Mode KEYWORD2
51+
Set_Mem_Bank KEYWORD2
52+
53+
#######################################
54+
# Constants (LITERAL1)
55+
#######################################
56+
57+
ISM330IS_OK LITERAL1
58+
ISM330IS_ERROR LITERAL1
59+
ISM330IS_ACC_SENSITIVITY_FS_2G LITERAL1
60+
ISM330IS_ACC_SENSITIVITY_FS_4G LITERAL1
61+
ISM330IS_ACC_SENSITIVITY_FS_8G LITERAL1
62+
ISM330IS_ACC_SENSITIVITY_FS_16G LITERAL1
63+
ISM330IS_GYRO_SENSITIVITY_FS_125DPS LITERAL1
64+
ISM330IS_GYRO_SENSITIVITY_FS_250DPS LITERAL1
65+
ISM330IS_GYRO_SENSITIVITY_FS_500DPS LITERAL1
66+
ISM330IS_GYRO_SENSITIVITY_FS_1000DPS LITERAL1
67+
ISM330IS_GYRO_SENSITIVITY_FS_2000DPS LITERAL1
68+
69+

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=STM32duino ISM330IS
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 ISM330IS for STM32 boards.
7+
category=Sensors
8+
url=https://github.com/stm32duino/ISM330IS
9+
architectures=*

0 commit comments

Comments
 (0)