def SetMode(self, mode, endianess): """ Sets the appropriate transmit and receive commands based on the requested mode and byte order. Called internally by __init__ and Open. """ if _mpsse.SetMode(self.context, mode, endianess) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK
def SetMode(self, mode, endianess): """ Sets the appropriate transmit and receive commands based on the requested mode and byte order. Called internally by __init__ and Open. @mode - The MPSSE mode to use, one of: SPI0, SPI1, SPI2, SPI3, I2C, GPIO, BITBANG. @endianess - The endianess of data transfers, one of: MSB, LSB. Returns MPSSE_OK on success. Raises an exception on failure. """ if _mpsse.SetMode(self.context, mode, endianess) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK