def setSelect(self, level): """select bit""" if level: self.ctrlReg = self.ctrlReg & ~0x08 else: self.ctrlReg = self.ctrlReg | 0x08 _pyparallel.outp(self.ctrlRegAdr, self.ctrlReg)
def setInitOut(self, level): """initialize bit""" if level: self.ctrlReg = self.ctrlReg | 0x04 else: self.ctrlReg = self.ctrlReg & ~0x04 _pyparallel.outp(self.ctrlRegAdr, self.ctrlReg)
def setDataStrobe(self, level): """data strobe bit""" if level: self.ctrlReg = self.ctrlReg & ~0x01 else: self.ctrlReg = self.ctrlReg | 0x01 _pyparallel.outp(self.ctrlRegAdr, self.ctrlReg)
def setAutoFeed(self, level): """auto feed bit""" if level: self.ctrlReg = self.ctrlReg & ~0x02 else: self.ctrlReg = self.ctrlReg | 0x02 _pyparallel.outp(self.ctrlRegAdr, self.ctrlReg)
def setData(self, value): _pyparallel.outp(self.dataRegAdr, value)