Lines Matching refs:reg2
36 reg2 = bytearray(2) variable
59 print(2 == i2c.readfrom_mem_into(addr, 116, reg2)) # read the "who am I?" register again
60 print(0x68 == reg2[1])
61 print(reg2 == b"\x00\x68")
85 print(2 == i2c.readfrom_mem_into(addr, 107, reg2))
86 print(0x40 == reg2[0])
87 print(0x00 == reg2[1])
89 reg2[0] = 0
91 reg2[1] |= 0x03
92 print(2 == i2c.writeto_mem(addr, 107, reg2))
95 print(reg2 == reg2_r)
113 i2c.readfrom_mem_into(addr, 107, reg2)
114 print(0x40 == reg2[0])
115 print(0x00 == reg2[1])
117 reg2[0] = 107 # register address
118 reg2[1] = 0
119 print(2 == i2c.writeto(addr, reg2, stop=True)) # write the register address and the data