14 #include <propeller.h> 34 int ws_start(
ws2812_t *state,
int usreset,
int ns0h,
int ns0l,
int ns1h,
int ns1l,
int type)
36 extern uint32_t binary_ws2812_driver_dat_start[];
40 ustix = CLKFREQ / 1000000;
42 hdr->resettix = ustix * usreset;
43 hdr->bit0hi = ustix * ns0h / 1000;
44 hdr->bit0lo = ustix * ns0l / 1000;
45 hdr->bit1hi = ustix * ns1h / 1000;
46 hdr->bit1lo = ustix * ns1l / 1000;
47 hdr->swaprg = (type == TYPE_GRB);
50 state->cog = cognew(hdr, &state->command);
55 void ws2812_set(
ws2812_t *state,
int pin, uint32_t *colors,
int count)
60 | ((uint32_t)colors << 16);
61 while (state->command)