I would like to use my Vocore to control a WS2812B RGB LED strip. These consist of RGB LEDs which each have a built-in controller chip. Refer for example http://www.adafruit.com/datasheets/WS2812B.pdf.
As these RGB LED controllers work with only one data line (that means, without a clock line), they require a bit stream of uninterrupted timing. A logical 1 is transmitted as 800ns+-150ns HIGH, 450ns+-150ns LOW, a logical 0 is transmitted as 400ns+-150ns HIGH, 850ns+-150ns LOW. Each LED requires 24 bits (8 bits blue intensity, 8 bits green intensity, 8 bits red intensity), and my strip is 108 LEDs long. A pause of 50us LOW resets all LED controllers, so that new colors can be programmed from the beginning again.
I would hope that either the PCM or the I2S hardware of the RT5350, coupled with DMA, could do the job. I was planning to set the bit frequency to 2.4MHz (by setting DIVINT to 8 and DIVCOMP to 171), and then to serialize 110 for a logical 1 and 100 for a locical 0 onto either GPIO#9 (I2S_SDO) or GPIO#14 (PCM_DTX).
Now, I have a bit of experience with Linux (I have once written a simple kernel module some time ago), and SoC like the Teensy 3.0 (ARM Cortex M4) with which I did some DMA trials a while ago. However, I am struggling to get all the pieces of the puzzle together for the DMA under OpenWrt with Vocore:
- I need to adapt the VOCORE.dts in order to select "pcm i2s" mode of the uartf_func as of rt305x.c in OpenWrt. I must probably then also disable the LED functions of GPIO#10 (UARTF_RXD) and GPIO#11 (UARTF_DTR). But how?
- I then need to determine whether the DMA business should be done in userland, or whether a kernel device driver module is the better approach. Any suggestions here?
Anybody can give me some hints how to approach this project, or give me a hand to get this done?