|
16 | 16 |
|
17 | 17 | **Hardware:**
|
18 | 18 |
|
19 |
| -* `Adafruit AS7341 Breakout <https://www.adafruit.com/product/4698>`_ |
| 19 | +* `Adafruit AS7341 Breakout |
| 20 | + <https://www.adafruit.com/product/4698>`_ (Product ID: 4698) |
20 | 21 |
|
21 | 22 | **Software and Dependencies:**
|
22 | 23 |
|
23 | 24 | * Adafruit CircuitPython firmware for the supported boards:
|
24 |
| - https://github.com/adafruit/circuitpython/releases |
| 25 | + https://circuitpython.org/downloads |
25 | 26 |
|
26 |
| - * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice |
27 |
| - * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register |
| 27 | +* Adafruit's Bus Device library: |
| 28 | + https://github.com/adafruit/Adafruit_CircuitPython_BusDevice |
28 | 29 |
|
29 |
| -""" |
| 30 | +* Adafruit's Register library: |
| 31 | + https://github.com/adafruit/Adafruit_CircuitPython_Register |
30 | 32 |
|
31 |
| -# imports |
| 33 | +""" |
32 | 34 |
|
33 | 35 | __version__ = "0.0.0-auto.0"
|
34 | 36 | __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_AS7341.git"
|
35 |
| -from collections import namedtuple |
| 37 | + |
36 | 38 | from time import sleep, monotonic
|
37 | 39 | from micropython import const
|
38 | 40 | import adafruit_bus_device.i2c_device as i2c_device
|
@@ -165,38 +167,58 @@ class Gain(CV):
|
165 | 167 | )
|
166 | 168 |
|
167 | 169 |
|
168 |
| -_SmuxIn = namedtuple( |
169 |
| - "_SmuxIn", |
170 |
| - [ |
171 |
| - "NC_F3L", |
172 |
| - "F1L_NC", |
173 |
| - "NC_NC0", |
174 |
| - "NC_F8L", |
175 |
| - "F6L_NC", |
176 |
| - "F2L_F4L", |
177 |
| - "NC_F5L", |
178 |
| - "F7L_NC", |
179 |
| - "NC_CL", |
180 |
| - "NC_F5R", |
181 |
| - "F7R_NC", |
182 |
| - "NC_NC1", |
183 |
| - "NC_F2R", |
184 |
| - "F4R_NC", |
185 |
| - "F8R_F6R", |
186 |
| - "NC_F3R", |
187 |
| - "F1R_EXT_GPIO", |
188 |
| - "EXT_INT_CR", |
189 |
| - "NC_DARK", |
190 |
| - "NIR_F", |
191 |
| - ], |
| 170 | +class SMUX_OUT(CV): |
| 171 | + """Options for ``smux_out``""" |
| 172 | + |
| 173 | + pass # pylint: disable=unnecessary-pass |
| 174 | + |
| 175 | + |
| 176 | +SMUX_OUT.add_values( |
| 177 | + ( |
| 178 | + ("DISABLED", 0, 0, None), |
| 179 | + ("ADC0", 1, 1, None), |
| 180 | + ("ADC1", 2, 2, None), |
| 181 | + ("ADC2", 3, 3, None), |
| 182 | + ("ADC3", 4, 4, None), |
| 183 | + ("ADC4", 5, 5, None), |
| 184 | + ("ADC5", 6, 6, None), |
| 185 | + ) |
192 | 186 | )
|
193 |
| -SMUX_IN = _SmuxIn(*list(range(20))) |
194 | 187 |
|
195 |
| -_SmuxOut = namedtuple("_SmuxOut", "DISABLED ADC0 ADC1 ADC2 ADC3 ADC4 ADC5") |
196 |
| -SMUX_OUT = _SmuxOut(*list(range(7))) |
| 188 | + |
| 189 | +class SMUX_IN(CV): |
| 190 | + """Options for ``smux_in``""" |
| 191 | + |
| 192 | + pass # pylint: disable=unnecessary-pass |
| 193 | + |
| 194 | + |
| 195 | +SMUX_IN.add_values( |
| 196 | + ( |
| 197 | + ("NC_F3L", 0, 0, None), |
| 198 | + ("F1L_NC", 1, 1, None), |
| 199 | + ("NC_NC0", 2, 2, None), |
| 200 | + ("NC_F8L", 3, 3, None), |
| 201 | + ("F6L_NC", 4, 4, None), |
| 202 | + ("F2L_F4L", 5, 5, None), |
| 203 | + ("NC_F5L", 6, 6, None), |
| 204 | + ("F7L_NC", 7, 7, None), |
| 205 | + ("NC_CL", 8, 8, None), |
| 206 | + ("NC_F5R", 9, 9, None), |
| 207 | + ("F7R_NC", 10, 10, None), |
| 208 | + ("NC_NC1", 11, 11, None), |
| 209 | + ("NC_F2R", 12, 12, None), |
| 210 | + ("F4R_NC", 13, 13, None), |
| 211 | + ("F8R_F6R", 14, 14, None), |
| 212 | + ("NC_F3R", 15, 15, None), |
| 213 | + ("F1R_EXT_GPIO", 16, 16, None), |
| 214 | + ("EXT_INT_CR", 17, 17, None), |
| 215 | + ("NC_DARK", 18, 18, None), |
| 216 | + ("NIR_F", 19, 19, None), |
| 217 | + ) |
| 218 | +) |
197 | 219 |
|
198 | 220 |
|
199 |
| -class AS7341: # pylint:disable=too-many-instance-attributes |
| 221 | +class AS7341: # pylint:disable=too-many-instance-attributes, no-member |
200 | 222 | """Library for the AS7341 Sensor
|
201 | 223 |
|
202 | 224 | :param ~busio.I2C i2c_bus: The I2C bus the device is connected to
|
|
0 commit comments