Jesus Christ / Mbed 2 deprecated ws2811_Izebel

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ws2811BitBang.h Source File

ws2811BitBang.h

00001 //this is a very silly, platform-specific way of getting the timing right for the WS2811 chips. Obviously there are more thoughtful ways to solve this problem, but this was expedient
00002 
00003 #ifndef WS2811BITBANG
00004 #define WS2811BITBANG 1
00005 #include "mbed.h"
00006 #define WAIT0H() asm volatile{nop;}
00007 #define WAIT0L() asm volatile{nop;\
00008         nop;\
00009         nop;\
00010         nop;\
00011         nop;\
00012         nop;\
00013         nop;\
00014         nop;\
00015         nop;\
00016         nop;\
00017         nop;\
00018         nop;\
00019         nop;\
00020         nop;\
00021         nop;\
00022         nop;\
00023         nop;\
00024         nop;\
00025         nop;\
00026         nop;\
00027         nop;\
00028         nop;\
00029         nop;\
00030         nop;\
00031         nop;\
00032         nop;\
00033         nop;\
00034         nop;\
00035         nop;\
00036         nop;\
00037         nop;\
00038         nop;\
00039     }
00040     
00041 #define WAIT1L() WAIT0L()
00042 #define WAIT1H() asm volatile{\
00043         nop;\
00044         nop;\
00045         nop;\
00046         nop;\
00047         nop;\
00048         nop;\
00049         nop;\
00050         nop;\
00051         nop;\
00052         nop;\
00053         nop;\
00054         nop;\
00055         nop;\
00056         nop;\
00057         nop;\
00058         nop;\
00059         nop;\
00060         nop;\
00061         nop;\
00062         nop;\
00063         nop;\
00064     }
00065     
00066 void sendBuffer(uint8_t* rgbBuf,size_t len,DigitalOut& ws2812Data);
00067 
00068 #endif