Skip to content

Commit

Permalink
Bring the driver up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
ice9js committed Aug 13, 2024
1 parent 01a93c7 commit 6c979fe
Show file tree
Hide file tree
Showing 12 changed files with 431 additions and 160 deletions.
4 changes: 0 additions & 4 deletions app/drivers/led_strip/CMakeLists.txt

This file was deleted.

10 changes: 0 additions & 10 deletions app/drivers/led_strip/Kconfig

This file was deleted.

6 changes: 0 additions & 6 deletions app/drivers/led_strip/is31fl3743a/CMakeLists.txt

This file was deleted.

20 changes: 0 additions & 20 deletions app/drivers/led_strip/is31fl3743a/Kconfig

This file was deleted.

303 changes: 291 additions & 12 deletions app/dts/bindings/led_strip/issi,is31fl3743a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,21 @@ properties:
SW setting used to control the matrix size by turning off SWx pins
as described in the datasheet.
cs-order:
type: uint8-array
required: false
default: [0x02, 0x01, 0x00, 0x05, 0x04, 0x03, 0x08, 0x07, 0x06, 0x0B, 0x0A, 0x09, 0x0E, 0x0D, 0x0C, 0x11, 0x10, 0x0F]
map:
type: array
required: true
description: |
Stores the configuration of CS* pins.
Each 3 consecutive numbers must be R, G and B pins for a single LED.
Matches the reference design from the datasheet by default.
Configure how RGB pixels are mapped to individual pixel registers.
riset:
r-ext:
type: int
required: true
description: Riset resistor value in kiloohms.
description: Rext resistor value in kiloohms.

led-max-current:
type: int
required: true
description: Maximum allowed LED current in mAh. The maximum allowed by the chip is 34.
description: Maximum current for each LED in mA. The chip supports up to 34mA.

sync:
type: int
Expand All @@ -56,10 +53,292 @@ properties:
required: false
default: 0x00
description: |
Controls the SYNC function. Set to 0x11 to set the device as main or 0x10 for secondary.
Controls the SYNC function. Set to 0x11 to set the device as main or 0x10 for secondary. 0x00 for 'off'.
sdb-gpios:
type: phandle-array
required: true
required: false
description: |
GPIO pin for hardware shutdown functionality.
chain-length:
type: int
required: true
description: |
How many RGB LEDs are driven by the IC.
rgb-scaling:
type: array
required: true
description: |
Current scaling factor for R, G and B channels in the 0-255 range.
This setting will adjust the brightness of the respective color pixels relative to each other
by scaling the amount of current flowing through them. 255 equals lex-max-current.
gamma:
type: array
required: false
description: |
Gamma correction lookup values.
The gamma values make the LED brightness seem more linear to human eyes.
Default values match the recommendation from the IC datasheet but note that this may
or may not apply for your particular LEDs.
default:
[
0,
0,
0,
0,
1,
1,
1,
1,
2,
2,
2,
2,
3,
3,
3,
3,
4,
4,
4,
4,
5,
5,
5,
5,
6,
6,
6,
6,
7,
7,
7,
7,
8,
8,
8,
8,
10,
10,
10,
10,
12,
12,
12,
12,
14,
14,
14,
14,
16,
16,
16,
16,
18,
18,
18,
18,
20,
20,
20,
20,
22,
22,
22,
22,
24,
24,
24,
24,
26,
26,
26,
26,
29,
29,
29,
29,
32,
32,
32,
32,
35,
35,
35,
35,
38,
38,
38,
38,
41,
41,
41,
41,
44,
44,
44,
44,
47,
47,
47,
47,
50,
50,
50,
50,
53,
53,
53,
53,
57,
57,
57,
57,
61,
61,
61,
61,
65,
65,
65,
65,
69,
69,
69,
69,
73,
73,
73,
73,
77,
77,
77,
77,
81,
81,
81,
81,
85,
85,
85,
85,
89,
89,
89,
89,
94,
94,
94,
94,
99,
99,
99,
99,
104,
104,
104,
104,
109,
109,
109,
109,
114,
114,
114,
114,
119,
119,
119,
119,
124,
124,
124,
124,
129,
129,
129,
129,
134,
134,
134,
134,
140,
140,
140,
140,
146,
146,
146,
146,
152,
152,
152,
152,
158,
158,
158,
158,
164,
164,
164,
164,
170,
170,
170,
170,
176,
176,
176,
176,
182,
182,
182,
182,
188,
188,
188,
188,
195,
195,
195,
195,
202,
202,
202,
202,
209,
209,
209,
209,
216,
216,
216,
216,
223,
223,
223,
223,
230,
230,
230,
230,
237,
237,
237,
237,
244,
244,
244,
244,
251,
251,
251,
251,
255,
255,
255,
255,
]
10 changes: 10 additions & 0 deletions app/include/dt-bindings/zmk/is31fl3743_transform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2024 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#define RGB(com, r, g, b) (com + r)(com + g)(com + b)

#define SW(n) ((n - 1) * 18)
#define CS(n) (n - 1)
1 change: 1 addition & 0 deletions app/module/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ add_subdirectory_ifdef(CONFIG_GPIO gpio)
add_subdirectory_ifdef(CONFIG_KSCAN kscan)
add_subdirectory_ifdef(CONFIG_SENSOR sensor)
add_subdirectory_ifdef(CONFIG_DISPLAY display)
add_subdirectory_ifdef(CONFIG_LED_STRIP led_strip)
6 changes: 6 additions & 0 deletions app/module/drivers/led_strip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

zephyr_library_amend()

zephyr_library_sources_ifdef(CONFIG_IS31FL3743A is31fl3743a.c)
Loading

0 comments on commit 6c979fe

Please sign in to comment.