Skip to content
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
13 changes: 9 additions & 4 deletions adafruit_ad569x.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

"""

import time
from micropython import const
from adafruit_bus_device.i2c_device import I2CDevice

Expand Down Expand Up @@ -190,8 +191,12 @@ def reset(self):
"""
Soft-reset the AD569x chip.
"""
reset_command = 0x8000
buffer = bytearray([_WRITE_CONTROL, 0x80, 0x00])
try:
self._send_command(_WRITE_CONTROL, reset_command)
except Exception as error:
raise Exception(f"Error during reset: {error}") from error
with self.i2c_device as i2c:
i2c.write(buffer, end=False)
except OSError:
pass
# print(f"Reset may have triggered a NAK, continuing..")
# stabilize after reset
time.sleep(0.01)
Loading