Loading...
Searching...
No Matches
ws281x_params.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Marian Buschsieweke
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
9#pragma once
10
20
21#include <limits.h>
22
23#include "board.h"
24#include "saul_reg.h"
25
26#include "ws281x.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
36#ifndef WS281X_PARAM_PIN
37#define WS281X_PARAM_PIN (GPIO_PIN(0, 0))
38#endif
39#ifndef WS281X_PARAM_NUMOF
40#define WS281X_PARAM_NUMOF (8U)
41#endif
42#ifndef WS281X_PARAM_BUF
47#define WS281X_PARAM_BUF (ws281x_buf)
48#endif
49
50#ifndef WS281X_PARAMS
54#define WS281X_PARAMS { \
55 .pin = WS281X_PARAM_PIN, \
56 .numof = WS281X_PARAM_NUMOF, \
57 .buf = WS281X_PARAM_BUF, \
58 }
59#endif
61
66{
68};
69
89#if !defined(WS281X_TIMER_DEV) || defined(DOXYGEN)
90#define WS281X_TIMER_DEV TIMER_DEV(2)
91#endif
92
97#ifndef WS281X_TIMER_MAX_VALUE
98#define WS281X_TIMER_MAX_VALUE UINT_MAX
99#endif
100
106#ifndef WS281X_TIMER_FREQ
107#define WS281X_TIMER_FREQ 16000000
108#endif
109
113#ifndef WS281X_SAUL_INFO
114#define WS281X_SAUL_INFO { .name = "WS281X RGB LED" }
115#endif
116
121{
123};
124
125#ifdef __cplusplus
126}
127#endif
128
#define WS281X_PARAM_NUMOF
Number of LEDs chained.
Definition board.h:74
#define WS281X_BYTES_PER_DEVICE
The number of bytes to allocate in the data buffer per LED.
Definition ws281x.h:104
SAUL registry interface definition.
Additional data to collect for each entry.
Definition saul_reg.h:48
Struct to hold initialization parameters for a WS281x RGB LED.
Definition ws281x.h:119
WS2812/SK6812 RGB LED Driver.
#define WS281X_SAUL_INFO
SAUL info.
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.
uint8_t ws281x_buf[WS281X_PARAM_NUMOF *WS281X_BYTES_PER_DEVICE]
Data buffer holding the LED states.
#define WS281X_PARAMS
WS281x initialization parameters.