8000 Remove interrupt support (no interrupt on chip or breakout) by anecdata · Pull Request #31 · adafruit/Adafruit_CircuitPython_VEML7700 · GitHub
[go: up one dir, main page]

Skip to content

Remove interrupt support (no interrupt on chip or breakout) #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue an 8000 d contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions adafruit_veml7700.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

from micropython import const
import adafruit_bus_device.i2c_device as i2cdevice
from adafruit_register.i2c_struct import UnaryStruct, ROUnaryStruct
from adafruit_register.i2c_struct import ROUnaryStruct
from adafruit_register.i2c_bits import RWBits
from adafruit_register.i2c_bit import RWBit, ROBit
from adafruit_register.i2c_bit import RWBit

try:
import typing # pylint: disable=unused-import
Expand Down Expand Up @@ -128,11 +128,9 @@ class VEML7700:
time.sleep(0.1)
"""

# ALS_CONF_0 - ALS gain, integration time, interrupt and shutdown.
# ALS_CONF_0 - ALS gain, integration time, shutdown.
light_shutdown = RWBit(0x00, 0, register_width=2)
"""Ambient light sensor shutdown. When ``True``, ambient light sensor is disabled."""
light_interrupt = RWBit(0x00, 1, register_width=2)
"""Enable interrupt. ``True`` to enable, ``False`` to disable."""
light_gain = RWBits(2, 0x00, 11, register_width=2)
"""Ambient light gain setting. Gain settings are 2, 1, 1/4 and 1/8. Settings options are:
ALS_GAIN_2, ALS_GAIN_1, ALS_GAIN_1_4, ALS_GAIN_1_8.
Expand Down Expand Up @@ -179,18 +177,6 @@ class VEML7700:

"""

# ALS_WH - ALS high threshold window setting
light_high_threshold = UnaryStruct(0x01, "<H")
"""Ambient light sensor interrupt high threshold setting."""
# ALS_WL - ALS low threshold window setting
light_low_threshold = UnaryStruct(0x02, "<H")
"""Ambient light sensor interrupt low threshold setting."""
# ALS_INT - ALS INT trigger event
light_interrupt_high = ROBit(0x06, 14, register_width=2)
"""Ambient light high threshold interrupt flag. Triggered when high threshold exceeded."""
light_interrupt_low = ROBit(0x06, 15, register_width=2)
"""Ambient light low threshold interrupt flag. Triggered when low threshold exceeded."""

def __init__(self, i2c_bus: I2C, address: int = 0x10) -> None:
self.i2c_device = i2cdevice.I2CDevice(i2c_bus, address)
for _ in range(3):
Expand Down
0