-
-
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
Arm ps2 mouse interrupt #6490
Arm ps2 mouse interrupt #6490
Conversation
0966d98
to
294f017
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.
You shouldn't need to add defines for the delay.
In fact, all of them should be changed to wait_**
, as this is hardware agnostic, and should be defined for us.
good find! 34175dc fixes that |
tmk_core/protocol/ps2_io_chibios.c
Outdated
|
||
void clock_lo(void) | ||
{ | ||
palSetLineMode(PS2_LINE_CLOCK, PAL_MODE_OUTPUT_OPENDRAIN); |
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.
Does EXT require use of PAL_MODE_ALTERNATE
on non GPIOv1 boards (for example f303 which is GPIOv2)?
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.
good question - dunno :-)
here on GPIOv1/stm32f1 the pins are in no special/alternate mode - probably applies to other stms as well...
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.
My understanding is very few boards run GPIOv1, and the majority of QMK supported boards are GPIOv2. I would personally like to see this answered before merging, given the current state of the repo. That way it can either be documented, or protected with compile time errors.
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.
ok, from what i can tell - grepping through the sources and docs - the EXT driver only uses the pins as they are configured for example with PAL_MODE_OUTPUT_? - no special/alternate mode anywhere. and the EXT driver is available on other STM32F? as well. so i see no problems there
but do note, that the EXT driver is considered legacy - newer chibios versions use per line/pad events that can have a callback function assigned (palEnableLineEvent and palSetLineCallback) - see the comments in my code
yes this adds a minor hurdle when QMK decides to move to a newer chibios version - but i did my best to document that :-)
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
ChibiOS has been updated since, so this PR may need some TLC before it's ready to merge.
082af25
to
5e50864
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.
Some suggestions for the docs, otherwise looks good.
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.
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.
…ined PS2_LINE_CLOCK
using the chibios equivalent to AVRs cli: chSys[Unl|L]ock
@twadleigh 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.
Seems fine, but no hardware to test with... would be great to get some feedback from users.
Retargeted this to |
550bb6a
to
9d827f9
Compare
1d4c0cd
to
65c27a3
Compare
a1b96ba
to
3430907
Compare
* ps2_mouse on ARM: an interrupt-version of the ps2-mouse code ported to ARM/chibios * ps2_mouse on ARM: link EXT callback-channel selection to the user defined PS2_LINE_CLOCK * ps2_mouse on ARM: replace DELAY_X defines with hardware-agnostic wait_X * ps2_mouse on ARM: replace chibios-specific defines for the pins/lines with defines from quantum/config_common.h and drop the '_LINE' component from teh define name * ps2_mouse on ARM: expose the software-intterupt port as a user editable define * Update docs/feature_ps2_mouse.md Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> * Update feature_ps2_mouse.md * use a define to deduce the PS_DATA_PORT instead * reduce all-zero extcfg to oneliner * ps2_mouse: use generic wait instead of avr-delay * Update docs/feature_ps2_mouse.md * ps2_mouse: changes for new chibios version (17.6.0 -> 19.1.0) replacing the legacy externa-interrupt driver with pal-callbacks * ps2_mouse: use PLATFORM_KEY Co-Authored-By: Joel Challis <git@zvecr.com> * ps2_mouse: clang-format corrections * ps2_mouse: add systemlocks using the chibios equivalent to AVRs cli: chSys[Unl|L]ock Co-authored-by: Johannes <you@example.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Joel Challis <git@zvecr.com>
* ps2_mouse on ARM: an interrupt-version of the ps2-mouse code ported to ARM/chibios * ps2_mouse on ARM: link EXT callback-channel selection to the user defined PS2_LINE_CLOCK * ps2_mouse on ARM: replace DELAY_X defines with hardware-agnostic wait_X * ps2_mouse on ARM: replace chibios-specific defines for the pins/lines with defines from quantum/config_common.h and drop the '_LINE' component from teh define name * ps2_mouse on ARM: expose the software-intterupt port as a user editable define * Update docs/feature_ps2_mouse.md Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> * Update feature_ps2_mouse.md * use a define to deduce the PS_DATA_PORT instead * reduce all-zero extcfg to oneliner * ps2_mouse: use generic wait instead of avr-delay * Update docs/feature_ps2_mouse.md * ps2_mouse: changes for new chibios version (17.6.0 -> 19.1.0) replacing the legacy externa-interrupt driver with pal-callbacks * ps2_mouse: use PLATFORM_KEY Co-Authored-By: Joel Challis <git@zvecr.com> * ps2_mouse: clang-format corrections * ps2_mouse: add systemlocks using the chibios equivalent to AVRs cli: chSys[Unl|L]ock Co-authored-by: Johannes <you@example.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Joel Challis <git@zvecr.com>
Description
these patches add an PS2 mouse driver for ChibiOS based boards; The AVR ps2-interrupt-code is reused as much as possible, and parts that are platform specific are either split off or switched with defines.
Tested&Verified on a STM32F103 board with an Cherry-ML-4400 PS2-trackball :-)
Types of Changes