Skip to content
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

Invert pointing device motion pin for cirque touchpads #18404

Merged
merged 1 commit into from
Sep 24, 2022

Conversation

preisi
Copy link
Contributor

@preisi preisi commented Sep 18, 2022

Description

Cirque touchpads 'data ready'-pin implements active-high logic in contrast to most other pointing devices which use an active-low logic. Therefore, this commit implements both a configurable inversion of the motion pin logic and sets the the default for the cirque touchpad driver accordingly.

Types of Changes

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

Issues Fixed or Closed by This PR

This issue came up yesterday in the #help-firmware discord channel and was pointed out by @daskygit after Kuromitsu#5783 tried to use the motion pin.

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).

@github-actions github-actions bot added cli qmk cli command core dependencies documentation keyboard keymap python translation via Adds via keymap and/or updates keyboard for via support labels Sep 18, 2022
@preisi preisi changed the base branch from master to develop September 18, 2022 14:03
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks.

Copy link
Member

@zvecr zvecr left a comment

Choose a reason for hiding this comment

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

Not a fan of the chosen name as it doesnt really align with any of the existing options.

Suggestions would be to align to the existing _ACTIVE_LOW (or at a push _ON_STATE?).

@github-actions github-actions bot removed dependencies cli qmk cli command keymap python via Adds via keymap and/or updates keyboard for via support keyboard translation labels Sep 18, 2022
@preisi
Copy link
Contributor Author

preisi commented Sep 19, 2022

Not a fan of the chosen name as it doesnt really align with any of the existing options.

I aligned the name with the other defines in quantum/pointing_device which are named POINTING_DEVICE_INVERT_{X,Y,_X_RIGHT,_Y_RIGHT}. But granted, I'm not the biggest fan of the naming myself as it is not very explicit about the default behavior of the motion pin.

Suggestions would be to align to the existing _ACTIVE_LOW (or at a push _ON_STATE?).

To my understanding (and after grepping over parts of QMK), the _ACTIVE_LOW/_ACTIVE_HIGH seems to be mostly a ChibiOS convention. I hope the new choice _ON_STATE is better. Thank you for your feedback :)

@daskygit
Copy link
Member

My issue with _ON_STATE is it doesn't line up with terminology (active low/high) that will be used by datasheets.

@preisi
Copy link
Contributor Author

preisi commented Sep 20, 2022

My issue with _ON_STATE is it doesn't line up with terminology (active low/high) that will be used by datasheets.

Mh, that is obviously true. So you're suggesting to rename the current _ON_STATE to _ACTIVE_LOW and assign it the according boolean value? Or is there any better way your envisioning? Creating 2 defines "_ACTIVE_LOW" and "_ACTIVE_HIGH" and assign them to a third define as some sort of "enum" seems overkill to me. Or do you have something else in mind? (Otherwise I'd just rename the existing define to "_ACTIVE_LOW".

@daskygit
Copy link
Member

Nah, you'd only need to define _ACTIVE_LOW for it to switch behaviour with the undefined/default being active high which wouldn't need to be specified. I guess something like how HAPTIC_ENABLE_PIN_ACTIVE_LOW is handled.

…uchpads

Cirque touchpads 'data ready'-pin implements active-high logic in
contrast to most other pointing devices which use an active-low logic.
Therefore, this commit implements both a configurable inversion of the
motion pin logic and sets the the default for the cirque touchpad driver
accordingly.
@preisi
Copy link
Contributor Author

preisi commented Sep 21, 2022

Nah, you'd only need to define _ACTIVE_LOW for it to switch behaviour with the undefined/default being active high which wouldn't need to be specified. I guess something like how HAPTIC_ENABLE_PIN_ACTIVE_LOW is handled.

Alright, this should now be more to your liking :) I'm not completely happy with the result as _ACTIVE_LOW is basically be the default for all pointing devices except for the cirque touchpad, but it is how it is :) Then again, generally defining it and then specifically undefining it for the cirque touchpad would be possible, too (if that were to be preferred).

@daskygit daskygit requested a review from KarlK90 September 21, 2022 11:12
@drashna drashna merged commit 94d5fe6 into qmk:develop Sep 24, 2022
ramonimbao pushed a commit to ramonimbao/qmk_firmware that referenced this pull request Nov 28, 2022
Needed by the Cirque Trackpad for motion detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants