Add animation devicetree bindings
This commit is contained in:
parent
9d714c0b69
commit
c3beca12bd
3 changed files with 54 additions and 0 deletions
11
app/dts/bindings/zmk,animation-pixel.yaml
Normal file
11
app/dts/bindings/zmk,animation-pixel.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Copyright (c) 2020, The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
description: Pixel configuration
|
||||||
|
|
||||||
|
compatible: "zmk,animation-pixel"
|
||||||
|
|
||||||
|
pixel-cells:
|
||||||
|
- animation
|
||||||
|
- position_x
|
||||||
|
- position_y
|
28
app/dts/bindings/zmk,animation.yaml
Normal file
28
app/dts/bindings/zmk,animation.yaml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Copyright (c) 2020, The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
description: Global animation configuration
|
||||||
|
|
||||||
|
compatible: "zmk,animation"
|
||||||
|
|
||||||
|
properties:
|
||||||
|
drivers:
|
||||||
|
type: phandles
|
||||||
|
required: true
|
||||||
|
description: |
|
||||||
|
This array should contain all driver devices responsible for illuminating animated LEDs.
|
||||||
|
The devices must implement Zephyr's LED Strip Interface and expose a chain-lenght devicetree property.
|
||||||
|
|
||||||
|
animations:
|
||||||
|
type: phandles
|
||||||
|
required: true
|
||||||
|
description: |
|
||||||
|
Handles to all active animations.
|
||||||
|
|
||||||
|
pixels:
|
||||||
|
type: phandle-array
|
||||||
|
required: true
|
||||||
|
description: |
|
||||||
|
This field contains the pixel configuration for the entire board.
|
||||||
|
The order of this array determines in what order pixels are sent to the driver device API.
|
||||||
|
If multiple driving devices are used, their chain-length property determines the size of the buffer for each device.
|
15
app/include/dt-bindings/zmk/animation.h
Normal file
15
app/include/dt-bindings/zmk/animation.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020 The ZMK Contributors
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maps HSL color settings into a single uint32_t value
|
||||||
|
* that can be cast to zmk_color_hsl.
|
||||||
|
*/
|
||||||
|
#ifdef CONFIG_BIG_ENDIAN
|
||||||
|
#define HSL(h, s, l) ((h << 16) + (s << 8) + l)
|
||||||
|
#else
|
||||||
|
#define HSL(h, s, l) (h + (s << 16) + (l << 24))
|
||||||
|
#endif
|
Loading…
Add table
Reference in a new issue