-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Apds9960 polling without interrupt pin #88624
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
base: main
Are you sure you want to change the base?
Conversation
Hello @batkay, and thank you very much for your first pull request to the Zephyr project! |
74a7b29
to
a5bec04
Compare
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.
Thanks for your contribution and for the detailed testing proof. I've left some comments I've caught at a glance. Let me know your thoughts!
53baef1
to
9a9a41f
Compare
f6edff8
to
a76fd92
Compare
Also, it seems some changes got lost in the way. Please revisit the commits and their contents. As it is right now, it seems only the driver changes are present in the PR. |
9541f81
to
b045a97
Compare
@ubieda Just as a response to the previous comment, some of the changes are in the same commits. For example, making the interrupt optional and creating config options to enable/ disable its functionality were in the same commit since it didn't make sense (in my opinion) to break those up. |
6f1f063
to
d30ab1e
Compare
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.
The changes seem to meet the initial review.
I'm a bit concerned that apds9960_sample_fetch()
is turning cumbersome with a bunch of ifdef directives, but I acknowledge it was like that to begin with.
Let's wait for other reviewers to chime in. Thanks for your contribution!
Made interrupt pin on apds9960 optional Signed-off-by: Thomas Lang <[email protected]>
d30ab1e
to
2c36d02
Compare
sensor_fetch for apds9960 will now block until a valid sample is ready Signed-off-by: Thomas Lang <[email protected]>
Timeout occurs if status register does not register an interrupt Signed-off-by: Thomas Lang <[email protected]>
2c36d02
to
ea6e076
Compare
Description
This change allows for I2C communication with APDS9960 sensor without using the interrupt pin. If a sample is not available, it will block for the default amount of time between samples (2.78ms) before trying again. This allows it to work with boards like the Adafruit APDS9960 breakout with a QWIIC connector.
Specific Changes:
By default, interrupt pin is enabled when the int-gpios property is provided so older projects are not effected.
Testing
Build the sample APDS9960 sensor code with CONFIG_APDS9960_INTERRUPT_PIN set to n and CONFIG_APDS9960_TRIGGER_GLOBAL_THREAD set to n, or alternatively delete the property int-gpios from the devicetree overlay.
Logic analyzer shows i2c checking status, and waiting if a sample is not ready

RTT viewer shows the proximity and ambient light data being printed (same as before behavior)
