Commit 792c2b0
committed
Add
The AW9523 supports 256-step linear constant-current dimming when LED driving.
As noted in the datasheet introduction, the maximum current can be configured:
https://cdn-shop.adafruit.com/product-files/4886/AW9523+English+Datasheet.pdf
> The default maximum current (IMAX) is 37mA, and IMAX can be changed in GCR
> register.
In Table 10 ("GCR, Global control register (11H)"), the datasheet explains that
4 possible current ranges can be selected - maintaining the 256-step
granularity over a shorter current range:
> D[1:0] is used to configure the max drive current of LED. AW9523B set max
> current IMAX to 37mA(typical) default, and through register ISEL[1:0] can
> set to IMAX×1/4,IMAX×2/4, IMAX×3/4,IMAX, so the 256 step dimming range changes.
This change updates the `adafruit_aw9523.AW9523` class to have a
`constant_current_range` selector field that can be used to set the register
value. The 4 options are provided as constants (`AW9523_4_4_RANGE`,
`AW9523_3_4_RANGE`, etc).
An example of using this code would be:
```
aw = adafruit_aw9523.AW9523(i2c)
aw.constant_current_range = adafruit_aw9523.AW9523_3_4_RANGE
```constant_current_range selector for LED driving1 parent fa1e1dd commit 792c2b0
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
70 | 80 | | |
71 | 81 | | |
72 | 82 | | |
| |||
0 commit comments