Skip to content

Commit 82262a0

Browse files
committed
Update doc strings to be more (hopefully) clear and informative.
1 parent 1b48187 commit 82262a0

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

adafruit_tsl2591.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,11 @@ def clear_interrupt(self, operation: int) -> None:
218218

219219
def enable_interrupt(self, interrupts: int) -> None:
220220
"""Enable interrupts on device. ENABLE_NPIEN will turn on No Persist interrupts, these
221-
bypass the persist filter and assert immediately. ENABLE_AIEN will assert after their
222-
threshold values have exceeded the persist filter cycle constraints. The device powers
223-
on with thresholds at 0, meaning enabling interrupts may cause an immediate assertion.
221+
bypass the persist filter and assert immediately when values are detected above the high
222+
threshold or below the low threshold. Similarly, ENABLE_AIEN will assert at the respective
223+
ALS thresholds, but only after the values persist longer than the persist filter cycle
224+
duration. The device powers on with thresholds at 0, meaning enabling interrupts may
225+
cause an immediate assertion.
224226
Can be a value of:
225227
- ``ENABLE_NPIEN``
226228
- ``ENABLE_AIEN``
@@ -293,8 +295,8 @@ def integration_time(self, val: int) -> None:
293295

294296
@property
295297
def threshold_low(self) -> int:
296-
"""Get and set the ALS interrupt low threshold bytes. If the detected value exceeds
297-
threshold for the number of persist cycles an interrupt will be triggered.
298+
"""Get and set the ALS interrupt low threshold bytes. If the detected value is below
299+
the low threshold for the number of persist filter cycles an interrupt will be triggered.
298300
Can be 16-bit value."""
299301
th_low = self._read_u16LE(_TSL2591_AILTL)
300302
return th_low
@@ -308,8 +310,8 @@ def threshold_low(self, value: int) -> None:
308310

309311
@property
310312
def threshold_high(self) -> int:
311-
"""Get and set the ALS interrupt high threshold bytes. If the detected value exceeds
312-
threshold for the number of persist cycles an interrupt will be triggered.
313+
"""Get and set the ALS interrupt high threshold bytes. If the detected value is above
314+
the high threshold for the number of persist filter cycles an interrupt will be triggered.
313315
Can be 16-bit value."""
314316
th_high = self._read_u16LE(_TSL2591_AIHTL)
315317
return th_high
@@ -324,7 +326,8 @@ def threshold_high(self, value: int) -> None:
324326
@property
325327
def nopersist_threshold_low(self) -> int:
326328
"""Get and set the No Persist ALS low threshold bytes. An interrupt will be triggered
327-
immediately once threshold is exceeded. Can be 16-bit value."""
329+
immediately once the detected value is below the low threshold. Can be 16-bit value.
330+
"""
328331
np_th_low = self._read_u16LE(_TSL2591_NPAILTL)
329332
return np_th_low
330333

@@ -338,7 +341,8 @@ def nopersist_threshold_low(self, value: int) -> None:
338341
@property
339342
def nopersist_threshold_high(self) -> int:
340343
"""Get and set the No Persist ALS high threshold bytes. An interrupt will be triggered
341-
immediately once theshold is exceeded. Can be 16-bit value."""
344+
immediately once the detected value is above the high threshold. Can be 16-bit value.
345+
"""
342346
np_th_high = self._read_u16LE(_TSL2591_NPAIHTL)
343347
return np_th_high
344348

@@ -351,7 +355,7 @@ def nopersist_threshold_high(self, value: int) -> None:
351355

352356
@property
353357
def persist(self) -> int:
354-
"""Get and set the interrupt persistence filter - the number of consecutive out-of-range
358+
"""Get and set the interrupt persist filter - the number of consecutive out-of-range
355359
ALS cycles necessary to generate an interrupt."""
356360
persist = self._read_u8(_TSL2591_PERSIST_FILTER)
357361
return persist & 0x0F

0 commit comments

Comments
 (0)