Lines Matching full:inst
226 #define CHAIN_LENGTH(idx, inst) \ argument
227 COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, chain_lengths), \
228 (DT_INST_PROP_BY_IDX(inst, chain_lengths, idx)), \
229 (DT_INST_PROP_BY_PHANDLE_IDX(inst, led_strips, idx, chain_length)))
231 #define STRIP_BUFFER_INITIALIZER(idx, inst) \ argument
233 .dev = DEVICE_DT_GET(DT_INST_PROP_BY_IDX(inst, led_strips, idx)), \
234 .chain_length = CHAIN_LENGTH(idx, inst), \
235 .pixels = pixels##inst##_##idx, \
238 #define DECLARE_PIXELS(idx, inst) \ argument
239 static struct led_rgb pixels##inst##_##idx[CHAIN_LENGTH(idx, inst)];
241 #define AMOUNT_OF_LEDS(inst) LISTIFY(DT_INST_PROP_LEN(inst, led_strips), CHAIN_LENGTH, (+), inst) argument
243 #define VALIDATE_CHAIN_LENGTH(idx, inst) \ argument
245 CHAIN_LENGTH(idx, inst) % \
246 (DT_INST_PROP(inst, width) / DT_INST_PROP(inst, horizontal_modules) * \
247 (DT_INST_PROP(inst, height) / DT_INST_PROP(inst, vertical_modules))) == \
250 #define LED_STRIP_MATRIX_DEFINE(inst) \ argument
251 LISTIFY(DT_INST_PROP_LEN(inst, led_strips), DECLARE_PIXELS, (;), inst); \
252 static const struct led_strip_buffer strip_buffer##inst[] = { \
253 LISTIFY(DT_INST_PROP_LEN(inst, led_strips), STRIP_BUFFER_INITIALIZER, (,), inst), \
255 static const struct led_strip_matrix_config dd_config_##inst = { \
256 .num_of_strips = DT_INST_PROP_LEN(inst, led_strips), \
257 .strips = strip_buffer##inst, \
258 .width = DT_INST_PROP(inst, width), \
259 .height = DT_INST_PROP(inst, height), \
261 DT_INST_PROP(inst, width) / DT_INST_PROP(inst, horizontal_modules), \
263 DT_INST_PROP(inst, height) / DT_INST_PROP(inst, vertical_modules), \
264 .circulative = DT_INST_PROP(inst, circulative), \
265 .start_from_right = DT_INST_PROP(inst, start_from_right), \
266 .modules_circulative = DT_INST_PROP(inst, modules_circulative), \
267 .modules_start_from_right = DT_INST_PROP(inst, modules_start_from_right), \
268 .pixel_format = DT_INST_PROP(inst, pixel_format), \
271 BUILD_ASSERT((DT_INST_PROP(inst, pixel_format) == PIXEL_FORMAT_RGB_888) || \
272 (DT_INST_PROP(inst, pixel_format) == PIXEL_FORMAT_ARGB_8888)); \
273 BUILD_ASSERT((DT_INST_PROP(inst, width) * DT_INST_PROP(inst, height)) == \
274 AMOUNT_OF_LEDS(inst)); \
275 BUILD_ASSERT((DT_INST_PROP(inst, width) % DT_INST_PROP(inst, horizontal_modules)) == 0); \
276 BUILD_ASSERT((DT_INST_PROP(inst, height) % DT_INST_PROP(inst, vertical_modules)) == 0); \
277 LISTIFY(DT_INST_PROP_LEN(inst, led_strips), VALIDATE_CHAIN_LENGTH, (;), inst); \
279 DEVICE_DT_INST_DEFINE(inst, led_strip_matrix_init, NULL, NULL, &dd_config_##inst, \