hubmartin / WS2812B_STM32F3

WS2812 DMA library with low RAM needs. Up to 16 paralel outputs and thousands of LEDs on each of them
MIT License
60 stars 15 forks source link

Not an issue Actually :-) #4

Closed jacobrejin closed 4 years ago

jacobrejin commented 6 years ago

This is what I am trying to achieve. im using Your DMA implementation and trying to use it as Ws2811Octo library(mostly the Live Video streaming, The SD card Video loading and using multiple controller part) there is a lot of work to be done!!!!

jacobrejin commented 6 years ago

uint8_t frameBuffer[360]; uint8_t frameBuffer2[320];

void visInit() { // Set output channel/pin, GPIO_PIN_0 = 0, for GPIO_PIN_5 = 5 - this has to correspond to WS2812B_PINS ws2812b.item[0].channel = 0; // Your RGB framebuffer ws2812b.item[0].frameBufferPointer = frameBuffer; // RAW size of framebuffer ws2812b.item[0].frameBufferSize = sizeof(frameBuffer);

// If you need more parallel LED strips, increase the WS2812_BUFFER_COUNT value
ws2812b.item[1].channel = 3;
ws2812b.item[1].frameBufferPointer = frameBuffer2;
ws2812b.item[1].frameBufferSize = sizeof(frameBuffer2);

ws2812b_init();

}

what is used to determine the size of framebuffer2? ws2812b.item[0].channel = 0; what is this?

hubmartin commented 6 years ago

uint8_t frameBuffer2[320]; I have not used this code for years. 320 bytes seems weird because it is not dividible by three (RGB per pixel). Not sure if it works because of luck, or because I forgot why I choosed that number. uint8_t frameBuffer[360]; 360 bytes / 3 = 120 LEDs seems fine

If you still have issues, send me your project. I don't have F103 but the code can show something, or I reflash some of Discovery kits ST-link MCUs.

hubmartin commented 6 years ago

ws2812b.item[0].channel = 0; what is this?

this relates to

define WS2812B_PORT GPIOC

define WS2812B_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3)

and defines that first WS2812B driver channel is mapped to GPIOC and port0 - PC0

jacobrejin commented 6 years ago

Ok I'll sent u the project.

U have defined only these ws2812b.item[0].channel=0; ws2812b.item[0].channel=3;

ie. Only PC0 and PC3 what about 1,2 pins of port C

jacobrejin commented 6 years ago

What if I have to se use some random ports. ie 2,5,6. Had one silly doubt. Does the ports defined in parallel produce different or same signals

jacobrejin commented 6 years ago

And there were some commented section in ws2812b.c Should I un-comment it?

jacobrejin commented 6 years ago

void DMA1_Channel2_IRQHandler(void) void DMA1_Channel5_IRQHandler(void)

This section is commented out . I should un-comment it right?