-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Drivers: comparator: silabs_acmp implementation #83980
Drivers: comparator: silabs_acmp implementation #83980
Conversation
Hello @silabs-chgalant, and thank you very much for your first pull request to the Zephyr project! |
0c45311
to
3ae5eec
Compare
3ae5eec
to
280e2c1
Compare
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* This file was generated by the script gen_acmp.py in the hal_silabs module. |
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.
I assume you are going to send a PR to hal_silabs to publish gen_acmp.py
? Ideally, this current PR should update the reference in west.yml
.
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.
Yes, I will open a PR in hal_silabs
for that script shortly, then update the reference in west.yml once that gets merged.
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.
I've opened the PR for hal_silabs
here zephyrproject-rtos/hal_silabs#80 (cc @asmellby)
db4001c
to
966b99e
Compare
I believe this PR is no more a draft. |
Looks good :) could you extend the test suite https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/comparator/gpio_loopback with the new comparator and test it out locally as well? and extend https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/build_all/comparator? That allows CI to build various configurations for various boards too :) |
Thank you for the review! I'm in the process of extending these tests, I will let you know when this work has been pushed. |
966b99e
to
be20548
Compare
b01d533
to
676ed91
Compare
2cdc1cf
676ed91
to
2cdc1cf
Compare
@Martinhoff-maker @jerome-pouiller @bjarki-andreasen, I pushed a fix for the copyright declarations. |
@@ -0,0 +1,12 @@ | |||
# Copyright (c) 2025 Silicon Labs Inc. |
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.
In fact, we tend to use "Silicon Laboratories Inc." 🙄
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.
Woops... okay I'll try again 😅
Defines bindings that are compatible with silabs acmp. `input-positive` and `input-negative` are required properties to be configured by an application. It is recommended to use the bindings generated in `include/zephyr/dt-bindings/comparator/silabs_acmp.h` and reference your part's design book when configuring values for these properties. Signed-off-by: Christian Galante <[email protected]>
Defines an acmp node for xg21, xg23, xg24, xg27 and xg29 parts, which are all compatible with the silabs,acmp binding. Signed-off-by: Christian Galante <[email protected]>
This implements the comparator driver for silabs acmp peripherals using the silabs,acmp compatible binding. Signed-off-by: Christian Galante <[email protected]>
The xg24_dk2601b, xg24_ek2703a, xg27_dk2602a, xg23_rb4210a, xg24_rb4187c and xg29_rb4412a board yaml files were updated to support the comparator driver. Documentation hardware support was updated for each of these boards as well to mention support for the ACMP hardware block and comparator driver. Signed-off-by: Christian Galante <[email protected]>
…ards Add board overlays to execute the comparator gpio_loopback testsuite on xg24_dk2601b and xg29_rb4412a. The testsuite was executed and was seen to pass on both boards locally with twister. Signed-off-by: Christian Galante <[email protected]>
…tions Add build test configurations for the silabs_acmp comparator. Enable this build testing on all series 2 silabs boards that currently support the comparator driver. Signed-off-by: Christian Galante <[email protected]>
2cdc1cf
to
c54a8db
Compare
@bjarki-andreasen looks like this should be ready to go in - just missing your review/approval. Thanks! |
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.
Nice work!
Hi @silabs-chgalant! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
This pull request does the following:
The
input-positive
andinput-negative
properties of the silabs,acmp compatible binding are part specific, therefore binding headers are generated per part (as per @asmellby's feedback). However, since most of the input values are common between parts, and there is no overlapping of input values, it was decided (as per @jerome-pouiller's feedback) that we compile the total set of possible ACMP inputs into a single bindings header for the silabs_acmp. It would therefore be up to the user to reference their part's design book when selecting theinput-positive
andinput-negative
values for their application.