-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Update AW20216S driver and configuration for GMMK/Pro keyboard #13173
Conversation
#ifdef RGB_MATRIX_ENABLE | ||
|
||
const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { | ||
/* Refer to AW20216S manual for these locations |
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.
Could you elaborate where to find documentation for that chip?
The official awinic website does not list the AW20216S.
Some rationale on why this should be the preferred implementation compared to the already existing driver would be good, too. |
Well it looks like it's taking advantage of register autoincrement in In my own use, the existing implementation doesn't have any noticeable lag, and high speed footage indicates that a full matrix update on the GMMK Pro takes 0.015ish seconds. |
This implementation includes correct (and crucial) delays, one in particular. (US_POR_DELAY) Also in my opinion the code is more legible, but that's my personal preference. I like some things in both implementations. Another advantage of this implementation (presumably because of mcuconf.h) is that the compiled firmware is much smaller. (around 7k smaller) |
Not related to the driver implementation, but FWIW the merged keyboard had some reactive effects that did not work quite right for some keys (specifically the Down Arrow). The driver code looked so similar that instead of trying to debug the LED config (which may be trivial) I simply replaced the submitted pro.c with the one in this PR and all the matrix effects seem to be working for all keys now. Thanks everyone for writing and reviewing the GMMK Pro QMK firmware. |
Ah ok, I hadn't tested the reactive effects much, which effect were you using, and was it just the down key? |
I think it was one of the SPLASH effects (turned on with "#define RGB_MATRIX_KEYPRESSES" in config.h). IIRC pressing the down arrow made it seem like the splash happened near the ESC key. I'm not sure about any other keys because I tested out this PR's version shortly after and stuck with it. Not sure I would ever leverage it, but this pro.c marked modifier flags in the LED config so that is something to consider in the merged version, too. |
Is there anything I can do to finish the merge? |
There are conflicts with the existing driver. |
The driver AW20216s is new, which existing driver do you mean? |
A community member already implemented a driver for the LED driver. You've both modified the same files, generating conflicts, which GitHub helpfully lists below. You'll need to rectify those conflicts before anything can progress. |
The led driver implemented was a placeholder based on the IS31FL3731. |
The changes on the driver PR are on files aw20216s.c|h. This driver uses the SPI protocol. |
That may be, but because both PRs touched the same files, there are merge conflicts in this one, since the other was merged. You'd need to resolve the merge conflicts, either by using the web interface and the "Resolve Conflicts" button below, or by rebasing the branch and fixing the merge conflicts there. Short of doing one of these, the PR won't get reviewed and won't be merged. |
IIRC, this is an issue with how the animations are implemented, and not specific to the GMMK Pro |
Nah, this was me screwing up the LED-switch mapping, fixed in #13189 (original mapping was generated by a bunch of python spaghetti). Unless this is referring to the splash animation moving from one side of the matrix to the other, which would be a QMK problem, but I don't think I noticed that in my testing. |
I can confirm the animation issue I described only affected the merged keyboard-specific config, but I mentioned it here because this PR also touched the same keyboard. I have not personally tested the merged bug fix for the keyboard-specific config, but it did look like it would fix the issue. |
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.
Also, please revert the changes to the lib folders. You may need to rebase to fix those.
Done. |
Let's go through each of these points one by one Point 1Where initialization is done is arbitrary, and extending to support more chips would be done in a similar way. In any case, it would be trivial to just parameterize the functions in the current implementation. Point 2Again, see #13430, the implementation here is presumably slower by calling To add, the old implementation writing 3 bytes per LED value was already more than fast enough, there was no perceivable lag even using the heavier animation effects. Point 3Your interpretation of the timing diagram appears to be incorrect, so let's go through it bit by bit. POR happens, as the name implies, after Power On/Reset. In our case, this happens when the board is plugged into power, and VDD goes high. After *presumably this happens on other platforms as well, @drashna might be able to confirm Point 4By default, all GPIO should be a high impedance input, including CS lines that have yet to be asserted. Even if this pullup assumption does not hold true, because we are only doing writes on the SPI bus, there is no concern for contention on the MISO line, it would be perfectly fine to intentionally have all AW20216 CS lines be low during initialization (although implementing this probably wouldn't be worth the effort). Point 5Using a delay of 100us is just as arbitrary as assuming a delay of 0us. If you look at the datasheet for the IS31FL3743, you will see that the minimum delay is on the order of nanoseconds. It is highly unlikely that this driver will ever be used for any board other than the GMMK Pro, I think it is fine to just not have any delays until we find out pairing this chip with a faster MCU breaks something. Point 6SWSEL is not configured because it offers no perceivable benefit. There's also little argument for using fewer SW lines from a speed standpoint since the existing code writes the entire PWM buffer every time. Looking at the leaked spreadsheet, it looks like the hardware designers had similar thoughts, given how |
#define SPI_SS_DRIVER_1_PIN B13 | ||
#define ENABLE_DRIVER_1_PIN C13 | ||
#define SPI_SS_DRIVER_2_PIN B14 | ||
#define ENABLE_DRIVER_2_PIN C13 |
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.
Please revert. would prefer to keep the ISSI like config here.
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.
Not sure what you mean. Could you please address me to the ISSI driver to see the style?
Any idea on how to progress this? |
|
I apologize for having tracked the wrong PR here. Was trying to understand where RGB support was. Didnt realize it had been handled elsewhere. |
Dumb questions from someone new to QMK: the only thing I need here is switching to devlop branch then I should be able to make a firmware with RGB support? Any plan on when to roll it out to master branch? |
Yea you can just compile off develop. https://beta.docs.qmk.fm/developing-qmk/breaking-changes/breaking_changes |
Thanks! I will give it a try. |
Hey folks! Any updates on this? |
At this point, you can use the @glorious-qmk can you explain why this implementation should be taken in preference to the existing one in the repository already? |
Is the |
I've used the As for why this isn't merged:
|
Based on my own experience, it is pretty stable as long as your code is correct. I have been using the |
I indeed don't care, but if @glorious-qmk could state their position on this it would be very beneficial to have "official" approval that this won't void their warrenty or similar. @ForsakenRei Thanks for the info, will give it a try later! |
But is that the only difference here? I guess people asked @glorious-qmk a number of times what's different and why should this be merged but they haven't presented a reason for it, like "it works better because of X" or "it is closer to what the specsheet says" or whatever. Anyway, I think we should merge some of the changes here (possibly as another PR) such as the default keymap and some other things. The default keymap here reflects the stock keymap and stock function layer. Are all the RGB effects also implemented in the existing driver? |
I just tried compiling the develop branch, I found that all RGB effects to be functional. I haven't tried cloning the glorious's fork, but I don't have any issue with the currently merged implementation in the develop branch. It is now my daily driver and I can remap the rotary encoder. I also managed to make it work with VIA, but VIA doesn't support rotary encoder yet. |
Does online QMK configurator build firmware from the develop branch? If not, how often master is merged with develop? |
As per the current breaking changes timeline, we're on-track for a merge on August 28. We're in the process of setting up infrastructure to provide a mirror of configurator that targets develop, but that's in the pipeline and nowhere near ready for deployment. |
Going to close this due to no movement on the previous statement, While we would accept improvements to the existing implementation, the follow has to be done as part of any future PR;
|
Description
Types of Changes
Issues Fixed or Closed by This PR
Checklist