Skip to content

Add ability to poweroff ADNS5050 sensor #24223

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 2 commits into from
Aug 26, 2024
Merged

Conversation

ColinKinloch
Copy link
Contributor

@ColinKinloch ColinKinloch commented Jul 31, 2024

This adds the ability to poweroff the ADNS5050 sensor and set this to happen on suspend_power_down_user for the ploopy nano.

As the LED on the trackball points up it can be a little annoying when the computer is suspended/off.

I'm on the fence as to whether this should be the default for the ploopy as it would stop the trackball from being used to wake the computer.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@zvecr zvecr changed the base branch from master to develop July 31, 2024 23:30
@ColinKinloch ColinKinloch marked this pull request as ready for review July 31, 2024 23:46
@waffle87 waffle87 requested a review from a team August 1, 2024 01:28
}

void suspend_wakeup_init_user(void) {
adns5050_init();
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to reinit on wake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so:
From page 16 of https://media.digikey.com/pdf/Data%20Sheets/Avago%20PDFs/ADNS-5050.pdf

There are 2 ways to exit power down, either assert low NRESET pin or by writing 0x5a to Register 0x3a. A full reset will thus be executed.

Copy link
Member

Choose a reason for hiding this comment

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

You missed the most important part of that paragraph:

Any register settings must then be reloaded.

So yeah, it sounds like a re-init would be appropriate in this case.

I would say pull out the register init into a separate function, but this sensor doesn't run i2c/spi/uart init, so should be fine, as is, I think.

@tzarc tzarc added the develop-fast-track Intended to be merged early in the next develop cycle. label Aug 13, 2024
@waffle87 waffle87 merged commit cc3bc2a into qmk:develop Aug 26, 2024
4 checks passed
waffle87 pushed a commit to waffle87/qmk_firmware that referenced this pull request Sep 6, 2024
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
waffle87 pushed a commit to waffle87/qmk_firmware that referenced this pull request Sep 6, 2024
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
itsme-zeix pushed a commit to itsme-zeix/qmk_firmware that referenced this pull request Oct 2, 2024
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
ilham-agustiawan pushed a commit to ilham-agustiawan/qmk_firmware that referenced this pull request Nov 30, 2024
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
smallketchup82 pushed a commit to smallketchup82/qmk_firmware that referenced this pull request Dec 1, 2024
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
jlaptavi pushed a commit to jlaptavi/qmk_firmware that referenced this pull request Dec 3, 2024
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
DmNosachev pushed a commit to DmNosachev/qmk_firmware that referenced this pull request Dec 7, 2024
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
SyrupSplashin pushed a commit to SyrupSplashin/qmk_firmware that referenced this pull request Dec 10, 2024
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
LeonMusCoden pushed a commit to LeonMusCoden/qmk_firmware that referenced this pull request Jan 5, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
MichaelScofield45 pushed a commit to MichaelScofield45/qmk_firmware that referenced this pull request Jan 8, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
pashashocky pushed a commit to pashashocky/qmk that referenced this pull request Jan 17, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
Rumadon pushed a commit to Rumadon/qmk_firmware that referenced this pull request Jan 31, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
MaximumP pushed a commit to MaximumP/qmk_firmware that referenced this pull request Feb 1, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
alinelena pushed a commit to alinelena/qmk_firmware that referenced this pull request Feb 3, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
artlugovoy pushed a commit to artlugovoy/qmk_firmware that referenced this pull request Feb 16, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
srphcr pushed a commit to srphcr/qmk_firmware that referenced this pull request Mar 24, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
oskar-wigstrom pushed a commit to oskar-wigstrom/qmk_firmware that referenced this pull request Apr 23, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
minyu7374 pushed a commit to minyu7374/qmk_firmware that referenced this pull request Apr 25, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
MasayukiFukada pushed a commit to MasayukiFukada/qmk_firmware that referenced this pull request May 1, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
w31mann pushed a commit to w31mann/qmk_firmware that referenced this pull request Aug 3, 2025
* Add ability to poweroff ADNS5050 sensor

* ploopyco/trackball_nano: Poweroff ADNS5050 on suspend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core develop-fast-track Intended to be merged early in the next develop cycle. keymap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants