Example #1
0
    def __init__(self, mode=None, frequency=ONE_MHZ, endianess=MSB):
        """
		If mode is specified, then attempt to connect to any known FTDI chip.
		If mode is not specified, this simply returns the class instance.
		Endianess defaults to MSB.
		"""
        self.context = None
        if mode is not None:
            self.context = _mpsse.MPSSE(mode, frequency, endianess)
            if self.context.open == 0:
                raise Exception, self.ErrorString()
Example #2
0
	def __init__(self, mode=None, frequency=ONE_HUNDRED_KHZ, endianess=MSB):
		"""
		Class constructor.

		@mode      - The MPSSE mode to use, one of: SPI0, SPI1, SPI2, SPI3, I2C, GPIO, BITBANG, None.
                             If None, no attempt will be made to connect to the FTDI chip. Use this if you want to call the Open method manually.
		@frequency - The frequency to use for the specified serial protocol, in hertz (default: 100KHz).
		@endianess - The endianess of data transfers, one of: MSB, LSB (default: MSB).

		Returns None.
		"""
		self.context = None
		if mode is not None:
			self.context = _mpsse.MPSSE(mode, frequency, endianess)
			if self.context.open == 0:
				raise Exception, self.ErrorString()