Keychron Q3 I2C & CKLED2001 transfer speedup #18780
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Issues Fixed or Closed by This PR
Checklist