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

[Core] Allow usage of ChibiOS's SIO driver for split keyboards #15907

Merged
merged 2 commits into from
Jun 17, 2022

Conversation

KarlK90
Copy link
Member

@KarlK90 KarlK90 commented Jan 16, 2022

This PR build upon #16647 while this one is not merged please ignore the commit Use a mutex for split shared memory synchronization in this PR.

Description

Allow usage of 21.11+ ChibiOS's SIO driver for split keyboards. The cool thing about the SERIAL and SIO driver is that both implement the BaseChannel interface that provides blocking reading and writing methods that resemble what we already use in the driver. Only some low level aspects like initialization have to be handled differently.

Supported Hardware (incomplete)

Every STM32 MCU family that supports USARTv2 or USARTv3 like:

  • STM32F0xx (Patches needed to enable SIO IRQ handler)
  • STM32F3xx (Patches needed to enable SIO IRQ handler)
  • STM32G0xx
  • STM32G4xx
  • RP2040

For test-driving these changes do the following:

  1. Add these configs to your keyboard:

config.h

#define SERIAL_USART_DRIVER SIOD3 // Or whatever your usart peripheral is

halconf.h

#define HAL_USE_SIO TRUE

mcuconf.h

#define STM32_IRQ_USART3_PRIORITY 12
#define STM32_SIO_USE_USART3 TRUE // Or what ever you usart peripheral is

Target use-case is the RP2040 which only implements this driver at this point.

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

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 the core label Jan 16, 2022
@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from f520d21 to 93b8c44 Compare January 20, 2022 16:00
@github-actions github-actions bot added cli qmk cli command documentation keyboard keymap python via Adds via keymap and/or updates keyboard for via support labels Jan 20, 2022
@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from 93b8c44 to 4264889 Compare January 27, 2022 14:36
@github-actions github-actions bot removed keymap via Adds via keymap and/or updates keyboard for via support documentation python cli qmk cli command keyboard labels Jan 27, 2022
@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from 4264889 to 9a35d33 Compare February 11, 2022 00:35
@drashna drashna requested a review from a team February 26, 2022 21:03
@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from 9a35d33 to b866354 Compare March 14, 2022 20:39
@github-actions github-actions bot added keyboard keymap via Adds via keymap and/or updates keyboard for via support labels Mar 14, 2022
@KarlK90 KarlK90 marked this pull request as ready for review March 14, 2022 20:41
@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from b866354 to e00275d Compare March 14, 2022 20:41
@github-actions github-actions bot removed keyboard via Adds via keymap and/or updates keyboard for via support keymap labels Mar 14, 2022
@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from e00275d to f5ea35b Compare March 15, 2022 16:44
@KarlK90
Copy link
Member Author

KarlK90 commented Mar 15, 2022

Updated the docs, this is now ready to be reviewed.

@github-actions github-actions bot added keyboard keymap python via Adds via keymap and/or updates keyboard for via support labels Jun 17, 2022
@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from 0ebcbbf to cd1da64 Compare June 17, 2022 17:58
@github-actions github-actions bot removed cli qmk cli command CI via Adds via keymap and/or updates keyboard for via support keyboard python keymap dependencies labels Jun 17, 2022
@KarlK90 KarlK90 requested a review from daskygit June 17, 2022 18:05
@KarlK90
Copy link
Member Author

KarlK90 commented Jun 17, 2022

@daskygit as you use G4s on a crkbd could you help verifying that the SIO driver works as expected in Half-duplex? 🙂

@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from cd1da64 to 80122f2 Compare June 17, 2022 19:50
@github-actions github-actions bot added keyboard keymap via Adds via keymap and/or updates keyboard for via support labels Jun 17, 2022
@KarlK90 KarlK90 force-pushed the feature/serial-sio-driver branch from 80122f2 to 2c04248 Compare June 17, 2022 19:56
@github-actions github-actions bot removed keymap keyboard via Adds via keymap and/or updates keyboard for via support labels Jun 17, 2022
Copy link
Member

@daskygit daskygit left a comment

Choose a reason for hiding this comment

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

After some troubleshooting on Discord with Karl it's working well.

@KarlK90 KarlK90 merged commit 6d67e9d into qmk:develop Jun 17, 2022
@KarlK90 KarlK90 deleted the feature/serial-sio-driver branch June 17, 2022 20:06
0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this pull request Jul 4, 2022
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.

3 participants