Lines Matching refs:idx
36 #define SPI_OPER(idx) (SPI_OP_MODE_MASTER | SPI_TRANSFER_MSB | \ argument
177 #define WS2812_SPI_NUM_PIXELS(idx) \ argument
178 (DT_INST_PROP(idx, chain_length))
179 #define WS2812_SPI_HAS_WHITE(idx) \ argument
180 (DT_INST_PROP(idx, has_white_channel) == 1)
181 #define WS2812_SPI_ONE_FRAME(idx) \ argument
182 (DT_INST_PROP(idx, spi_one_frame))
183 #define WS2812_SPI_ZERO_FRAME(idx) \ argument
184 (DT_INST_PROP(idx, spi_zero_frame))
185 #define WS2812_SPI_BUFSZ(idx) \ argument
186 (WS2812_NUM_COLORS(idx) * 8 * WS2812_SPI_NUM_PIXELS(idx))
192 #define WS2812_COLOR_MAPPING(idx) \ argument
193 static const uint8_t ws2812_spi_##idx##_color_mapping[] = \
194 DT_INST_PROP(idx, color_mapping)
196 #define WS2812_NUM_COLORS(idx) (DT_INST_PROP_LEN(idx, color_mapping)) argument
199 #define WS2812_RESET_DELAY(idx) DT_INST_PROP(idx, reset_delay) argument
201 #define WS2812_SPI_DEVICE(idx) \ argument
203 static uint8_t ws2812_spi_##idx##_px_buf[WS2812_SPI_BUFSZ(idx)]; \
205 WS2812_COLOR_MAPPING(idx); \
207 static const struct ws2812_spi_cfg ws2812_spi_##idx##_cfg = { \
208 .bus = SPI_DT_SPEC_INST_GET(idx, SPI_OPER(idx), 0), \
209 .px_buf = ws2812_spi_##idx##_px_buf, \
210 .one_frame = WS2812_SPI_ONE_FRAME(idx), \
211 .zero_frame = WS2812_SPI_ZERO_FRAME(idx), \
212 .num_colors = WS2812_NUM_COLORS(idx), \
213 .color_mapping = ws2812_spi_##idx##_color_mapping, \
214 .length = DT_INST_PROP(idx, chain_length), \
215 .reset_delay = WS2812_RESET_DELAY(idx), \
218 DEVICE_DT_INST_DEFINE(idx, \
222 &ws2812_spi_##idx##_cfg, \