Skip to content

update reset #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and 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 1 commit into from
Dec 5, 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
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