Skip to content

Commit 2c559ec

Browse files
committed
Update available I2C addresses list
Add all other valid I2C addresses to available addresses list because I2C address for qwiic button is software configurable
1 parent eebaf78 commit 2c559ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

qwiic_button.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@
6363
# Some devices have multiple available addresses - this is a list of these addresses.
6464
# NOTE: The first address in this list is considered the default I2C address for the
6565
# device.
66-
_AVAILABLE_I2C_ADDRESS = [0x6F]
66+
_QWIIC_BUTTON_DEFAULT_ADDRESS = 0x6F
67+
_FULL_ADDRESS_LIST = list(range(0x08, 0x77+1)) # Full address list (excluding reserved addresses)
68+
_FULL_ADDRESS_LIST.remove(_QWIIC_BUTTON_DEFAULT_ADDRESS >> 1) # Remove default address from list
69+
_AVAILABLE_I2C_ADDRESS = [_QWIIC_BUTTON_DEFAULT_ADDRESS] # Initialize with default address
70+
_AVAILABLE_I2C_ADDRESS.extend(_FULL_ADDRESS_LIST) # Add full range of I2C addresses
6771

6872
# Define the class that encapsulates the device being created. All information associated
6973
# with this device is encapsulated by this class. The device class should be the only value

0 commit comments

Comments
 (0)