-
-
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
PWM DMA based RGB Underglow for STM32 #7928
Conversation
Could this leverage something similar to https://github.com/hubmartin/WS2812B_STM32F103/blob/master/src/ws2812b.c to decrease the memory requirements? |
Working with L0xx as well. |
PWM DMA based RGB Underglow for STM32
Want to test it, but .... not up to doing so ATM |
3cf5f9f
to
79945b6
Compare
Co-Authored-By: Nick Brassel <[email protected]>
Confirmed working with this applied over current post-future master, using L0xx. |
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
#ifndef WS2812_PWM_TARGET_PERIOD | ||
//# define WS2812_PWM_TARGET_PERIOD 800000 // Original code is 800k...? | ||
# define WS2812_PWM_TARGET_PERIOD 80000 // TODO: work out why 10x less on f303/f4x1 |
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.
I have used the same codes for the noah keyboard(stm32f11ce based board), and it should use 800K, not sure why it was modified to 80000.
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.
doesnt work with 800K on anything that has been tested so far, which includes some f411 blackpill boards 🤷♂️
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.
Maybe the testing system was running with HSI clock(8mHz, not the HSE at 8x9 on f303 or 8x12 on f411)?
/* --- PRIVATE CONSTANTS ---------------------------------------------------- */ | ||
|
||
#define WS2812_PWM_FREQUENCY (STM32_SYSCLK / 2) /**< Clock frequency of PWM, must be valid with respect to system clock! */ |
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.
The timer's frequency depends on the specific APB1 or APB2's frequency, and which was decided by the APB divider defined on the mcuconf.h. If anyone tuned the value, the PWM frequency will be incorrect, so it better to make this MACRO overridable as the pwm driver and time channel selections.
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.
Feel free to add an incremental PR, but as this has been merged its too late to change it within this PR.
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* 'master' of https://github.com/qmk/qmk_firmware: (37 commits) Update Hungarian keymap and add sendstring LUT (qmk#8220) Remove "ugly hack in usb_main.c" comments (qmk#8296) Update encoder functions for Iris VIA keymap (qmk#8295) Reduce PROGMEM usage for sendstring LUT (qmk#8109) [Docs] Update ISP Flashing guide (qmk#8149) Rewrite the Bathroom Epiphanies Frosty Flake matrix and LED handling (qmk#8243) Add onekey keymap for testing reset to bootloader. (qmk#8288) Get the direction right on the S75 encoder (qmk#8287) Prune out pure software pwm && custom driver && remove wrapping BACKLIGHT_PIN (qmk#8041) Make a fix to savage65 and tmov2 for via (qmk#8286) format code according to conventions [skip ci] Short term fix for conflicting types for 'tfp_printf' (qmk#8157) Fix recent clang-format breaking quantum.c (qmk#8282) format code according to conventions [skip ci] Remove duplicate BRTG case (qmk#8277) Clean up includes for glcdfont headers (qmk#7745) Fix the Breaking Changes doc again [Docs] translated 'feature_tap_dance.md' to japanese. (qmk#8137) PWM DMA based RGB Underglow for STM32 (qmk#7928) Add VIA support to Prime_M. Clean up all files (qmk#8247) ...
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
Description
Based off https://github.com/joewa/WS2812-LED-Driver_ChibiOS, this PR aims to implement ws2812 PWM support within the new ws2812 framework.
Notes
WS2812_PWM_TARGET_PERIOD
optionTypes of Changes
Checklist