led_ws2812b.h File Reference

library to drive a WS2812B LED chain (API) More...

Go to the source code of this file.

## Macros

#define | LED_WS2812B_LEDS 48
| number of LEDs on the WS2812B strip

## Functions

void | led_ws2812b_setup (void)
| setup WS2812B LED driver
void | led_ws2812b_set_rgb (uint16_t led, uint8_t red, uint8_t green, uint8_t blue)
| set color of a single LED More...
bool | led_ws2812b_transmit (void)
| transmit color values to WS2812B LEDs More...

## Detailed Description

library to drive a WS2812B LED chain (API)

Author
  King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info

Date
  2016-2017

Note
  peripherals used: SPI SPI peripheral used to control the WS2812B LEDs, timer timer peripheral used to generate SPI clock, DMA (for SPI MISO)

Definition in file led_ws2812b.h.

## Function Documentation

## led_ws2812b_set_rgb()

void led_ws2812b_set_rgb | ( | uint16_t | led,
|  | uint8_t | red,
|  | uint8_t | green,
|  | uint8_t | blue
| ) |  |

set color of a single LED

Parameters

  [in] | led | the LED number to set the color
  [in] | red | the red color value to set on the LED
  [in] | green | the green color value to set on the LED
  [in] | blue | the blue color value to set on the LED

Note
  transmission needs to be done separately

Definition at line 65 of file led_ws2812b.c.

## led_ws2812b_transmit()

bool led_ws2812b_transmit | ( | void |  | ) |

transmit color values to WS2812B LEDs

Returns
  true if transmission started, false if another transmission is already ongoing

Definition at line 91 of file led_ws2812b.c.