def __init__(self, gpio, sclk, mosi=None, miso=None, ss=None):
self._gpio = gpio<EOL>self._sclk = sclk<EOL>self._mosi = mosi<EOL>self._miso = miso<EOL>self._ss = ss<EOL>gpio.setup(sclk, GPIO.OUT)<EOL>if mosi is not None:<EOL><INDENT>gpio.setup(mosi, GPIO.OUT)<EOL><DEDENT>if miso is not None:<EOL><INDENT>gpio.setup(miso, GPIO.IN)<EOL><DEDENT>if ss is not None:<EOL><INDENT>gpio.setup(ss, GPIO.OUT)<EOL>gpio.set_high(ss)<EOL><DEDENT>self.set_mode(<NUM_LIT:0>)<EOL>self.set_bit_order(MSBFIRST)<EOL>
Initialize bit bang (or software) based SPI.  Must provide a BaseGPIO
        class, the SPI clock, and optionally MOSI, MISO, and SS (slave select)
        pin numbers. If MOSI is set to None then writes will be disabled and fail
        with an error, likewise for MISO reads will be disabled.  If SS is set to
        None then SS will not be asserted high/low by the library when
        transfering data.