def __init__(self, clk=None, cs=None, miso=None, mosi=None, spi=None, gpio=None):
        """Initialize MAX31855 device with software SPI on the specified CLK,
        CS, and DO pins.  Alternatively can specify hardware SPI by sending an
        Adafruit_GPIO.SPI.SpiDev device in the spi parameter.
        """
        self._spi = None
        # Handle hardware SPI
        if spi is not None:
            self._spi = spi
        elif clk is not None and cs is not None and miso is not None and mosi is not None:
            # Default to platform GPIO if not provided.
            if gpio is None:
                gpio = GPIO.get_platform_gpio()
            self._spi = SPI.BitBang(gpio, clk, mosi, miso, cs)
        else:
            raise ValueError('Must specify either spi for for hardware SPI or clk, cs, miso, and mosi for software SPI!')
        self._spi.set_clock_hz(1000000)
        self._spi.set_mode(0)
        self._spi.set_bit_order(SPI.MSBFIRST)
def __init__ ( self , clk = None , cs = None , miso = None , mosi = None , spi = None , gpio = None ) : self . _spi = None if spi is not None : self . _spi = spi elif clk is not None and cs is not None and miso is not None and mosi is not None : if gpio is None : gpio = GPIO . get_platform_gpio ( ) self . _spi = SPI . BitBang ( gpio , clk , mosi , miso , cs ) else : raise ValueError ( 'Must specify either spi for for hardware SPI or clk, cs, miso, and mosi for software SPI!' ) self . _spi . set_clock_hz ( 1000000 ) self . _spi . set_mode ( 0 ) self . _spi . set_bit_order ( SPI . MSBFIRST )
Initialize MAX31855 device with software SPI on the specified CLK,
        CS, and DO pins.  Alternatively can specify hardware SPI by sending an
        Adafruit_GPIO.SPI.SpiDev device in the spi parameter.