-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
Add support for PAW3204 Optical Sensor #17669
Conversation
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! Do we have any prove that the driver works? As I don't have the sensor myself this would be good.
Unfortunately, no. The code is taken from a fork. And unfortunately, I don't have actual hardware to test on. |
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.
More thorough review of the code. I'm beginning to think that we should get somebody with a PAW3204 to verify that this driver works an intended. (Maybe the original author?) Pinged Gompa on Discord.
Yeah, ideally, we should. That said, @GEIGEIGEIST (?) was designing a PCB around this sensor, which is what kicked this off for me. |
Gompa is away from their computer for a week, but will report back afterwards. |
I'm back at my computer/my keyboard on Monday and will report back then. |
I tested on a blackpill and can confirm that it works. |
I tested it on my PCB, running on a RP2040 Pro Micro and it works too. Thank you! |
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.
One last round of review comments (hope you don't feel nitpicked) and then this is good to go from my side.
drivers/sensors/paw3204.h
Outdated
void paw3204_init(void); | ||
report_paw3204_t paw3204_read(void); | ||
uint8_t paw3204_serial_read(void); | ||
void paw3204_serial_write(uint8_t reg_addr); | ||
uint8_t paw3204_read_reg(uint8_t reg_addr); | ||
void paw3204_write_reg(uint8_t reg_addr, uint8_t data); | ||
int8_t convert_twoscomp(uint8_t data); |
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.
Only paw3204_init
, paw3204_read
, paw3204_set_cpi
and paw3204_get_cpi
are needed in the pointing device drivers code aka. need to be pulbic, these should get doxygen comments (like the pwm33xx_common.h stuff). The other functions don't need to be exposed on the public api and can be defined as static
in paw3204.c
.
Co-authored-by: gompa <gompa@h-bomb.nl>
Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
Nope, not at all. Helps me get into better practice :) And applied. |
Good to hear! Feel free to merge. |
Co-authored-by: gompa <gompa@h-bomb.nl> Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
Description
Adds support for the PAW3204 low powered optical sensor.
This is basic support, as the device supports multiple power modes and more, but aren't actually implemented here.
Uses bitbanged communication
Types of Changes
Checklist