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

Document the RP2040-specific PS/2 implementation #22079

Merged
merged 4 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/feature_ps2_mouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,27 @@ In your keyboard config.h:
#endif
```

### RP2040 PIO Version :id=rp2040-pio-version

This uses the RP2040's hardware feature called PIO and is therefore only
available on boards that are based on the RP2040 MCU.

The pin for the data signal must be followed directly by the pin for the clock
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 today I actually got it right! Data first (GP0), followed by clock (GP1). Clock follows data. Data precedes clock. Is there a non-confusing way to put this?

The info.json is correct, it works (compilation and on actual hardware) and matches the requirement in this check. The error message given by that check seems to be the wrong way round, though:
# error PS/2 Clock pin must be followed by data pin!

within the GPIO pin numbering scheme. This is required due to the design of the
PIO state machine code.
sly547 marked this conversation as resolved.
Show resolved Hide resolved

Example info.json content:

```
sly547 marked this conversation as resolved.
Show resolved Hide resolved
"ps2": {
"clock_pin": "GP1",
"data_pin": "GP0",
"driver": "vendor",
"enabled": true,
"mouse_enabled": true
}
```

## Additional Settings :id=additional-settings

### PS/2 Mouse Features :id=ps2-mouse-features
Expand Down
2 changes: 1 addition & 1 deletion platforms/chibios/drivers/vendor/RP/RP2040/ps2_vendor.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#endif

#if PS2_DATA_PIN + 1 != PS2_CLOCK_PIN
# error PS/2 Clock pin must be followed by data pin!
# error PS/2 data pin must be followed by clock pin!
sly547 marked this conversation as resolved.
Show resolved Hide resolved
#endif

static inline void pio_serve_interrupt(void);
Expand Down