dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_ws2811.c File Reference

A driver for ws2811 rgb led controller. this is a port of the CleanFlight/BetaFlight implementation, and in turn ported from LibrePilot. More...

#include "pios.h"
#include "pios_ws2811.h"
#include "pios_dma.h"

Go to the source code of this file.

Data Structures

struct  ws2811_dev_s
 

Macros

#define WS2811_BITS_PER_LED   24
 
#define WS2811_DELAY_BUFFER_LENGTH   42
 
#define WS2811_TIMER_HZ   24000000
 
#define WS2811_TIMER_PERIOD   29
 
#define BIT_COMPARE_1   17
 
#define BIT_COMPARE_0   9
 
#define PIOS_WS2811_MAGIC   0x00281100
 

Functions

int PIOS_WS2811_init (ws2811_dev_t *dev_out, const struct pios_ws2811_cfg *cfg, int max_leds)
 Allocate and initialise WS2811 device. More...
 
void PIOS_WS2811_set (ws2811_dev_t dev, int idx, uint8_t r, uint8_t g, uint8_t b)
 Set a given LED to a color value. More...
 
void PIOS_WS2811_trigger_update (ws2811_dev_t dev)
 Trigger an update of the LED strand. More...
 
void PIOS_WS2811_set_all (ws2811_dev_t dev, uint8_t r, uint8_t g, uint8_t b)
 Sets all LEDs to a color value. More...
 
int PIOS_WS2811_get_num_leds (ws2811_dev_t dev)
 Find out how many LEDs are configured on an interface. More...
 

Detailed Description

A driver for ws2811 rgb led controller. this is a port of the CleanFlight/BetaFlight implementation, and in turn ported from LibrePilot.

Author
Cleanflight/Betaflight
The LibrePilot Project, http://www.librepilot.org Copyright (C) 2017.
dRonin, http://dRonin.org/, Copyright (C) 2017
See Also
The GNU Public License (GPL) Version 3

Definition in file pios_ws2811.c.