+ def I2Csetup(self):
+ """Move the FET into the I2C application."""
+ self.writecmd(0x02,0x10,0,self.data); #SPI/SETUP
+ def I2Cstart(self):
+ """Start an I2C transaction."""
+ self.writecmd(0x02,0x20,0,self.data); #SPI/SETUP
+ def I2Cstop(self):
+ """Stop an I2C transaction."""
+ self.writecmd(0x02,0x21,0,self.data); #SPI/SETUP
+ def I2Cread(self,len=1):
+ """Read len bytes by I2C."""
+ self.writecmd(0x02,0x00,1,[len]); #SPI/SETUP
+ return self.data;
+ def I2Cwrite(self,bytes):
+ """Write bytes by I2C."""
+ self.writecmd(0x02,0x01,len(bytes),bytes); #SPI/SETUP
+ return ord(self.data[0]);