def set_mode(self, mode):
if mode < <NUM_LIT:0> or mode > <NUM_LIT:3>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if mode == <NUM_LIT:0>:<EOL><INDENT>self.write_clock_ve = <NUM_LIT:1><EOL>self.read_clock_ve = <NUM_LIT:0><EOL>clock_base = GPIO.LOW<EOL><DEDENT>elif mode == <NUM_LIT:1>:<EOL><INDENT>self.write_clock_ve = <NUM_LIT:0><EOL>self.read_clock_ve = <NUM_LIT:1><EOL>clock_base = GPIO.LOW<EOL><DEDENT>elif mode == <NUM_LIT:2>:<EOL><INDENT>self.write_clock_ve = <NUM_LIT:1><EOL>self.read_clock_ve = <NUM_LIT:0><EOL>clock_base = GPIO.HIGH<EOL><DEDENT>elif mode == <NUM_LIT:3>:<EOL><INDENT>self.write_clock_ve = <NUM_LIT:0><EOL>self.read_clock_ve = <NUM_LIT:1><EOL>clock_base = GPIO.HIGH<EOL><DEDENT>self._ft232h.setup_pins(<EOL>{<NUM_LIT:0>: GPIO.OUT, <NUM_LIT:1>: GPIO.OUT, <NUM_LIT:2>: GPIO.IN}, {<NUM_LIT:0>: clock_base})<EOL>
Set SPI mode which controls clock polarity and phase.  Should be a
        numeric value 0, 1, 2, or 3.  See wikipedia page for details on meaning:
        http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus