-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Boards: Shields: Add Adafruit LIS3DH accelerometer shield #94296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2025 Jonas Berg | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_ADAFRUIT_LIS3DH | ||
def_bool $(shields_list_contains,adafruit_lis3dh) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2025 Jonas Berg | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
/ { | ||
aliases { | ||
accel0 = &adafruit_lis3dh; | ||
}; | ||
}; | ||
|
||
&zephyr_i2c { | ||
status = "okay"; | ||
|
||
adafruit_lis3dh: lis3dh@18 { | ||
compatible = "st,lis3dh", "st,lis2dh"; | ||
reg = <0x18>; | ||
}; | ||
}; |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.. _adafruit_lis3dh: | ||
|
||
Adafruit LIS3DH Shield | ||
###################### | ||
|
||
Overview | ||
******** | ||
|
||
The `Adafruit LIS3DH Triple-Axis Accelerometer Sensor Shield`_ features | ||
a `ST LIS3DH 3-axis accelerometer`_ and two STEMMA QT connectors. | ||
|
||
.. figure:: adafruit_lis3dh.webp | ||
:align: center | ||
:alt: Adafruit LIS3DH Shield | ||
|
||
Adafruit LIS3DH Shield (Credit: Adafruit) | ||
|
||
|
||
Requirements | ||
************ | ||
|
||
This shield can be used with boards which provide an I2C connector, for | ||
example STEMMA QT or Qwiic connectors. | ||
The target board must define a ``zephyr_i2c`` node label. | ||
See :ref:`shields` for more details. | ||
|
||
|
||
Pin Assignments | ||
=============== | ||
|
||
+--------------+------------------------------------------------------+ | ||
| Shield Pin | Function | | ||
+==============+======================================================+ | ||
| SDA | LIS3DH I2C SDA | | ||
+--------------+------------------------------------------------------+ | ||
| SCL | LIS3DH I2C SCL | | ||
+--------------+------------------------------------------------------+ | ||
| INT | LIS3DH Interrupt out | | ||
+--------------+------------------------------------------------------+ | ||
| SDO | LIS3DH I2C address selection. Pull down by default. | | ||
+--------------+------------------------------------------------------+ | ||
| CS | LIS3DH Force I2C mode by setting it to high level. | | ||
+--------------+------------------------------------------------------+ | ||
| I2 | LIS3DH Second interrupt out | | ||
+--------------+------------------------------------------------------+ | ||
| A1-A3 | LIS3DH Analog-to-digital converter inputs. Not used. | | ||
+--------------+------------------------------------------------------+ | ||
|
||
In order to use interrupts you need to connect a separate wire from the | ||
shield to a GPIO pin on your microcontroller board. See | ||
:dtcompatible:`st,lis3dh` for documentation on how to adjust the | ||
devicetree file. | ||
|
||
|
||
Programming | ||
*********** | ||
|
||
Set ``--shield adafruit_lis3dh`` when you invoke ``west build``. For example | ||
when running the :zephyr:code-sample:`accel_polling` sample: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/sensor/accel_polling | ||
:board: adafruit_qt_py_rp2040 | ||
:shield: adafruit_lis3dh | ||
:goals: build | ||
|
||
.. _Adafruit LIS3DH Triple-Axis Accelerometer Sensor Shield: | ||
https://learn.adafruit.com/adafruit-lis3dh-triple-axis-accelerometer-breakout | ||
|
||
.. _ST LIS3DH 3-axis accelerometer: | ||
https://www.st.com/en/mems-and-sensors/lis3dh.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright (c) 2025, Jonas Berg | ||
|
||
shield: | ||
name: adafruit_lis3dh | ||
full_name: Adafruit LIS3DH Triple-Axis Accelerometer Sensor Shield | ||
vendor: adafruit | ||
supported_features: | ||
- sensor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.