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 
19 #ifndef WS281X_PARAMS_H
20 #define WS281X_PARAMS_H
21 
22 #include "board.h"
23 #include "ws281x.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #ifndef WS281X_PARAM_PIN
34 #define WS281X_PARAM_PIN (GPIO_PIN(0,0))
35 #endif
36 #ifndef WS281X_PARAM_NUMOF
37 #define WS281X_PARAM_NUMOF (8U)
38 #endif
39 #ifndef WS281X_PARAM_BUF
40 
44 #define WS281X_PARAM_BUF (ws281x_buf)
45 #endif
46 
47 #ifndef WS281X_PARAMS
48 
51 #define WS281X_PARAMS { \
52  .pin = WS281X_PARAM_PIN, \
53  .numof = WS281X_PARAM_NUMOF, \
54  .buf = WS281X_PARAM_BUF, \
55  }
56 #endif
57 
63 {
65 };
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif /* WS281X_PARAMS_H */
72 
ws281x_buf
uint8_t ws281x_buf[WS281X_PARAM_NUMOF *WS281X_BYTES_PER_DEVICE]
Data buffer holding the LED states.
WS281X_PARAMS
#define WS281X_PARAMS
WS281x initialization parameters.
Definition: ws281x_params.h:51
ws281x_params
static const ws281x_params_t ws281x_params[]
Initialization parameters for WS281x devices.
Definition: ws281x_params.h:62
ws281x_params_t
Struct to hold initialization parameters for a WS281x RGB LED.
Definition: ws281x.h:109
WS281X_BYTES_PER_DEVICE
#define WS281X_BYTES_PER_DEVICE
The number of bytes to allocate in the data buffer per LED.
Definition: ws281x.h:104
WS281X_PARAM_NUMOF
#define WS281X_PARAM_NUMOF
Number of LEDs chained.
Definition: ws281x_params.h:37
ws281x.h
WS2812/SK6812 RGB LED Driver.