From f6dd3270dde377110d09fbf26bad0d6c0dd5c08c Mon Sep 17 00:00:00 2001 From: Liz Date: Mon, 28 Oct 2024 11:56:04 -0400 Subject: [PATCH 1/2] a few more proximity bits --- adafruit_vcnl4200.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/adafruit_vcnl4200.py b/adafruit_vcnl4200.py index f47d7b1..a3f5a46 100644 --- a/adafruit_vcnl4200.py +++ b/adafruit_vcnl4200.py @@ -150,16 +150,20 @@ class Adafruit_VCNL4200: als_persistance = RWBits(2, _ALS_CONF, 2) # ALS persistence bits als_low_threshold = UnaryStruct(_ALS_THDL, " None: self.i2c_device = I2CDevice(i2c, addr) @@ -181,8 +185,10 @@ def __init__(self, i2c: I2C, addr: int = _I2C_ADDRESS) -> None: self.als_low_threshold = 0 self.als_high_threshold = 0xFFFF self.set_interrupt(enabled=False, white_channel=False) + self.prox_duty = PS_DUTY["1_160"] self.prox_shutdown = False self.prox_integration_time = PS_IT["1T"] + self.prox_persistence = PS_PERS["1"] except Exception as error: raise RuntimeError(f"Failed to initialize: {error}") from error @@ -195,3 +201,11 @@ def set_interrupt(self, enabled, white_channel): return True except OSError: return False + + def trigger_prox(self): + """Triggers a single proximity measurement manually in active force mode.""" + try: + self._prox_trigger = True + return True + except OSError: + return False From f461b99c5d1c91014fec09d5624e6e96ae4d7844 Mon Sep 17 00:00:00 2001 From: Liz Date: Mon, 28 Oct 2024 12:04:37 -0400 Subject: [PATCH 2/2] docs error --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 3801704..08dbfc7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,7 +25,7 @@ # Uncomment the below if you use native CircuitPython modules such as # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. -# autodoc_mock_imports = ["digitalio", "busio"] +autodoc_mock_imports = ["busio", "adafruit_register", "adafruit_bus_device"] autodoc_preserve_defaults = True