Prep AXP2101

This commit is contained in:
Theo Arends 2024-02-17 16:08:04 +01:00
parent 236eb77af1
commit d774643b9c
1 changed files with 10 additions and 0 deletions

View File

@ -84,6 +84,16 @@ class I2C_Driver
var buf = self.wire.read_bytes(self.addr, reg, 2)
return (buf[0] << 5) + buf[1]
end
# read 14 bits
def read14(reg)
var buf = self.wire.read_bytes(self.addr, reg, 2)
return (buf[0] << 6) + buf[1]
end
# read 16 bits
def read16(reg)
var buf = self.wire.read_bytes(self.addr, reg, 2)
return (buf[0] << 8) + buf[1]
end
# read 24 bits
def read24(reg)
var buf = self.wire.read_bytes(self.addr, reg, 3)