Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ch32v003fun
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Horn
ch32v003fun
Commits
e43de7e5
Commit
e43de7e5
authored
1 year ago
by
cnlohr
Browse files
Options
Downloads
Patches
Plain Diff
Add notes about the ws2812B
parent
ee0f5081
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extralibs/ws2812b_dma_spi_led_driver.h
+9
-3
9 additions, 3 deletions
extralibs/ws2812b_dma_spi_led_driver.h
with
9 additions
and
3 deletions
extralibs/ws2812b_dma_spi_led_driver.h
+
9
−
3
View file @
e43de7e5
...
...
@@ -11,13 +11,13 @@
#define WS2812DMA_IMPLEMENTATION
You will need to implement the following two functions, as callbacks from the ISR.
uint32_t
Callback
WS2812BLED( int ledno );
uint32_t WS2812BLED
Callback
( int ledno );
You willalso need to call
Init
WS2812DMA();
WS2812
B
DMA
Init
();
Then, whenyou want to update the LEDs, call:
WS2812BStart( int num_leds );
WS2812B
DMA
Start( int num_leds );
*/
#ifndef _WS2812_LED_DRIVER_H
...
...
@@ -35,7 +35,9 @@ uint32_t WS2812BLEDCallback( int ledno );
#ifdef WS2812DMA_IMPLEMENTATION
// Must be divisble by 4.
#ifndef DMALEDS
#define DMALEDS 16
#endif
// Note first n LEDs of DMA Buffer are 0's as a "break"
// Need one extra LED at end to leave line high.
...
...
@@ -139,6 +141,10 @@ void DMA1_Channel3_IRQHandler( void )
// Clear all possible flags.
DMA1
->
INTFCR
=
DMA1_IT_GL3
;
// Strange note: These are backwards. DMA1_IT_HT3 should be HALF and
// DMA1_IT_TC3 should be COMPLETE. But for some reason, doing this causes
// LED jitter. I am henseforth flipping the order.
if
(
intfr
&
DMA1_IT_HT3
)
{
// Halfwaay (Fill in first part)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment