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

Make SPI Mode configurable for AW20216 and change default mode to 3 #17263

Merged
merged 1 commit into from
May 31, 2022

Conversation

trwnh
Copy link

@trwnh trwnh commented May 31, 2022

Description

Counterpart to #17262 but for develop branch instead of master branch

This PR makes the SPI Mode configurable for the AW20216. In master branch, the bug was fixed by simply changing the mode from a hardcoded mode 0 to a hardcoded mode 3. Here in develop branch, we instead define a new variable AW_SPI_MODE which defaults to 3 but can more easily be changed/defined in config.h to be any value in 0, 1, 2, 3 without needing to touch the driver code at all.

Relevant Discord discussion: https://discord.com/channels/440868230475677696/473506116718952450/981056233152839690

Drashna — Yesterday at 11:47 PM
For making it configurable, look at the divider stuff.  Same idea.

triggerofsol — Today at 12:01 AM
Should I make the "configuration" PR against develop instead of master, then?

tzarc — Today at 12:01 AM
yeah that'd be great
basically identical to AW_SPI_DIVISOR yeah?

triggerofsol — Today at 12:02 AM
that is how i see it, yes

tzarc — Today at 12:02 AM
cool, just make sure you update docs/feature_rgb_matrix.md as well, it has the configurable options listed

triggerofsol — Today at 12:02 AM
#define AW_SPI_MODE 3

tzarc — Today at 12:02 AM
(for that driver)
perfect

triggerofsol — Today at 12:03 AM
yeah i was gonna say i saw the docs too

tzarc — Today at 12:03 AM
👍
good stuff

triggerofsol — Today at 12:09 AM
| `AW_SPI_MODE` | (Optional) Mode for SPI communication (0-3, defines polarity and phase of the clock) | 3 |

tzarc — Today at 12:10 AM
sounds good
ship it!

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

@tzarc tzarc requested a review from a team May 31, 2022 05:24
@tzarc tzarc merged commit 9e2fe4e into qmk:develop May 31, 2022
@trwnh trwnh deleted the spi-mode-configurable branch May 31, 2022 05:37
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