uc1701: allow non blocking i2c writes
Some checks failed
Build test / build (push) Has been cancelled

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Timofey Titovets 2025-09-19 22:29:57 +02:00 committed by Kevin O'Connor
parent 3c01f71d9e
commit 8c7693c048
2 changed files with 4 additions and 1 deletions

View file

@ -212,6 +212,9 @@ class MCU_I2C:
"i2c_read oid=%c reg=%*s read_len=%u",
"i2c_read_response oid=%c response=%*s", oid=self.oid,
cq=self.cmd_queue)
def i2c_write_noack(self, data, minclock=0, reqclock=0):
self.i2c_write_cmd.send([self.oid, data],
minclock=minclock, reqclock=reqclock)
def i2c_write(self, data, minclock=0, reqclock=0):
if self.i2c_write_cmd is None:
self._to_write.append(data)

View file

@ -138,7 +138,7 @@ class I2C:
hdr = 0x00
cmds = bytearray(cmds)
cmds.insert(0, hdr)
self.i2c.i2c_write(cmds, reqclock=BACKGROUND_PRIORITY_CLOCK)
self.i2c.i2c_write_noack(cmds, reqclock=BACKGROUND_PRIORITY_CLOCK)
# Helper code for toggling a reset pin on startup
class ResetHelper: