Skip to content

drivers/lis331dlh: add accelerometer driver#22399

Open
MastenaM wants to merge 6 commits into
RIOT-OS:masterfrom
MastenaM:lis331dlh-clean-pr
Open

drivers/lis331dlh: add accelerometer driver#22399
MastenaM wants to merge 6 commits into
RIOT-OS:masterfrom
MastenaM:lis331dlh-clean-pr

Conversation

@MastenaM

Copy link
Copy Markdown

Contribution description

This PR adds support for the ST LIS331DLH 3-axis accelerometer.

The contribution includes:

  • LIS331DLH driver implementation
  • SAUL integration for sensor access through the RIOT sensor abstraction layer
  • auto-initialization support
  • driver parameters definition
  • public API documentation and Doxygen comments
  • SPDX copyright information for newly added files

The driver provides initialization and raw XYZ acceleration data reading over I2C.

Testing procedure

The driver was tested by building the dedicated RIOT driver test application:

shell make -C tests/drivers/lis331dlh clean make -C tests/drivers/lis331dlh

Tested board:

text nucleo-f401re

The application builds successfully without warnings or errors and produces:

text driver_lis331dlh_test.elf

Additionally:

shell git diff --check

was used to verify that no whitespace issues are present.

Issues/PRs references

None.

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • ChatGPT for code review and documentation assistance, with user review

@github-actions

Copy link
Copy Markdown

Hey @MastenaM, thank you for your first contribution! We really appreciate it! If you haven't already, please take a look at our contributing guidelines before the review process starts. Also, due to how the GitHub review system works, please avoid force-pushing or squashing your commits unless asked to by a maintainer (or unless your commit is still in "draft commit" stage). Lastly, make sure to comply with our AI Policy when using AI. Your pull request will be reviewed as soon as possible.

@github-actions github-actions Bot added Area: tests Area: tests and testing framework Area: drivers Area: Device drivers Area: SAUL Area: Sensor/Actuator Uber Layer labels Jun 21, 2026
@maribu maribu changed the title drivers/lis331dlh: add SAUL support and auto-init drivers/lis331dlh: add accelerometer driver Jun 22, 2026

@maribu maribu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very impressed with the quality of the PR :) Thanks and welcome to the team of RIOT contributors!

Comment thread drivers/lis331dlh/include/lis331dlh_params.h
Comment thread drivers/lis331dlh/lis331dlh.c Outdated
MastenaM and others added 2 commits June 22, 2026 11:20
@crasbe

crasbe commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This looks quite similar to #22394 that was opened a couple of days ago, just some non-essential functionality stripped as well as comments. Large parts of the code is identical though.

Were you working together with @Nasa1423 or how is this related?

@Nasa1423

Copy link
Copy Markdown

with @Nasa1423 or how is this related?

No, we are not associated between each other. But I think we gonna resolve this problem. @MastenaM, contact me in telegram @Nasa1423.

@AnnsAnns AnnsAnns added AI: Co-Authored PR/Issue relies on AI. Documentation / Code was partly generated by AI. AI: Helped PR/Issue uses AI sparingly, e.g. code inline assistant, debugging with AI, etc. and removed AI: Co-Authored PR/Issue relies on AI. Documentation / Code was partly generated by AI. labels Jul 6, 2026
@crasbe crasbe added the State: waiting for author State: Action by the author of the PR is required label Jul 6, 2026
@crasbe

crasbe commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Any updates on this matter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Helped PR/Issue uses AI sparingly, e.g. code inline assistant, debugging with AI, etc. Area: drivers Area: Device drivers Area: SAUL Area: Sensor/Actuator Uber Layer Area: tests Area: tests and testing framework State: waiting for author State: Action by the author of the PR is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants