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

Keychron Q3 I2C & CKLED2001 transfer speedup #18780

Merged
merged 2 commits into from
Oct 21, 2022
Merged

Keychron Q3 I2C & CKLED2001 transfer speedup #18780

merged 2 commits into from
Oct 21, 2022

Conversation

cTn-dev
Copy link
Contributor

@cTn-dev cTn-dev commented Oct 19, 2022

Description

This PR focuses on indirectly increasing the keyboard matrix scan frequency which is held back by sending the latest pwm buffers over to the 2 CKLED2001 LED drivers.

Prior to this PR the keeb is doing ~640 matrix scans/sec with RGB enabled.
The increase in I2C speed to 1000 KHz (from the default of 400 KHz) gets this up to ~1100 matrix scans/sec with RGB enabled.
The increased g_twi_transfer_buffer gets the amount of transmissions from 12 per driver (24 total) to 3 per driver (6 total), getting it to ~1150 matrix scans/sec with RGB enabled.

The 1000 KHz is within the spec of the STM32L432 and technically can be pushed even further (but CUBE-MX won't let me generate those :( ) .
I should note that the "official doc" for CKLED2001 only advertises 400 KHz support (from my past experience most I2C slave devices can be ran well over the spec without adverse effects, which is also the case here).

I have tested the above changes on Keychron Q3 ANSI (no knob) over the past couple of days & haven't noticed any issues.

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

@drashna drashna requested a review from a team October 20, 2022 07:41
@drashna drashna merged commit 2c3859f into qmk:master Oct 21, 2022
quinnyo pushed a commit to quinnyo/qmk_firmware that referenced this pull request Oct 21, 2022
@cTn-dev
Copy link
Contributor Author

cTn-dev commented Oct 21, 2022

Thanks guys 🥇

@cTn-dev cTn-dev deleted the q3_i2c_speedup branch October 21, 2022 16:00
tacahiroy pushed a commit to tacahiroy/qmk_firmware that referenced this pull request Oct 23, 2022
aivalja pushed a commit to aivalja/qmk_firmware that referenced this pull request Nov 7, 2022
ramonimbao pushed a commit to ramonimbao/qmk_firmware that referenced this pull request Nov 28, 2022
nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
ChrisChrisLoLo pushed a commit to ChrisChrisLoLo/qmk_firmware that referenced this pull request Sep 2, 2023
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