Loading...
Searching...
No Matches

Default configuration for WS2812/SK6812 RGB LEDs. More...

Detailed Description

Default configuration for WS2812/SK6812 RGB LEDs.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file ws281x_params.h.

#include "board.h"
#include "saul_reg.h"
#include "ws281x.h"
+ Include dependency graph for ws281x_params.h:

Go to the source code of this file.

Macros

#define WS281X_TIMER_DEV   TIMER_DEV(2)
 Timer used for WS281x (by the timer_gpio_ll implementation)
 
#define WS281X_TIMER_MAX_VALUE   TIMER_2_MAX_VALUE
 Maximum value of the timer used for WS281x (by the timer_gpio_ll implementation)
 
#define WS281X_TIMER_FREQ   16000000
 Frequency for the timer used for WS281x (by the timer_gpio_ll implementation)
 
#define WS281X_SAUL_INFO   { .name = "WS281X RGB LED" }
 SAUL info.
 

Variables

static const ws281x_params_t ws281x_params []
 Initialization parameters for WS281x devices.
 
static const saul_reg_info_t ws281x_saul_info []
 Additional meta information to keep in the SAUL registry.
 

Default configuration parameters for WS281x RGB LEDs

#define WS281X_PARAM_PIN   (GPIO_PIN(0, 0))
 GPIO pin connected to the data pin of the first LED.
 
#define WS281X_PARAM_NUMOF   (8U)
 Number of LEDs chained.
 
#define WS281X_PARAM_BUF   (ws281x_buf)
 Data buffer holding LED states.
 
#define WS281X_PARAMS
 WS281x initialization parameters.
 
uint8_t ws281x_buf [WS281X_PARAM_NUMOF *WS281X_BYTES_PER_DEVICE]
 Data buffer holding the LED states.
 

Macro Definition Documentation

◆ WS281X_PARAM_BUF

#define WS281X_PARAM_BUF   (ws281x_buf)

Data buffer holding LED states.

Definition at line 46 of file ws281x_params.h.

◆ WS281X_PARAM_NUMOF

#define WS281X_PARAM_NUMOF   (8U)

Number of LEDs chained.

Definition at line 39 of file ws281x_params.h.

◆ WS281X_PARAM_PIN

#define WS281X_PARAM_PIN   (GPIO_PIN(0, 0))

GPIO pin connected to the data pin of the first LED.

Definition at line 36 of file ws281x_params.h.

◆ WS281X_PARAMS

#define WS281X_PARAMS
Value:
{ \
.pin = WS281X_PARAM_PIN, \
.numof = WS281X_PARAM_NUMOF, \
.buf = WS281X_PARAM_BUF, \
}
#define WS281X_PARAM_BUF
Data buffer holding LED states.
#define WS281X_PARAM_PIN
GPIO pin connected to the data pin of the first LED.
#define WS281X_PARAM_NUMOF
Number of LEDs chained.

WS281x initialization parameters.

Definition at line 53 of file ws281x_params.h.

◆ WS281X_SAUL_INFO

#define WS281X_SAUL_INFO   { .name = "WS281X RGB LED" }

SAUL info.

Definition at line 114 of file ws281x_params.h.

◆ WS281X_TIMER_DEV

#define WS281X_TIMER_DEV   TIMER_DEV(2)

Timer used for WS281x (by the timer_gpio_ll implementation)

A single timer is configured for any number of WS281x strands, so this does not need to be part of params.

It is required that the timer has at least 2 channels. (Future versions may require a 3rd channel).

It is required that the timer's MAX_VALUE is 2^n-1, which is a trivial but not explicitly stated case.

This timer is configured at WS281x initialization time, and kept stopped outside of transmissions.

The default value of 2 is chosen because the only platform on which the module is usable is nRF5x, where TIMER_DEV(1) is in use by the radio module. It is strongly advised to explicitly set this timer to a known free timer, as the default may change without notice.

Definition at line 89 of file ws281x_params.h.

◆ WS281X_TIMER_FREQ

#define WS281X_TIMER_FREQ   16000000

Frequency for the timer used for WS281x (by the timer_gpio_ll implementation)

This should be set to a frequency that is a close multiple of 3MHz, depending on the precise low and high times. A value of 16MHz works well.

Definition at line 107 of file ws281x_params.h.

◆ WS281X_TIMER_MAX_VALUE

#define WS281X_TIMER_MAX_VALUE   TIMER_2_MAX_VALUE

Maximum value of the timer used for WS281x (by the timer_gpio_ll implementation)

This macro needs to be defined to the TIMER_x_MAX_VALUE corresponding to the TIMER_DEV(x) in WS281X_TIMER_DEV.

Definition at line 98 of file ws281x_params.h.

Variable Documentation

◆ ws281x_params

const ws281x_params_t ws281x_params[]
static
Initial value:
=
{
}
#define WS281X_PARAMS
WS281x initialization parameters.

Initialization parameters for WS281x devices.

Definition at line 64 of file ws281x_params.h.

◆ ws281x_saul_info

const saul_reg_info_t ws281x_saul_info[]
static
Initial value:
=
{
}
#define WS281X_SAUL_INFO
SAUL info.

Additional meta information to keep in the SAUL registry.

Definition at line 120 of file ws281x_params.h.