Пример #1
0
 def test_baudrate(self):
     """Check simple GPIO write and read sequence."""
     # load custom CBUS config, with:
     # CBUS0: GPIO (gpio)
     # CBUS1: GPIO (gpio)
     # CBUS0: DRIVE1 (forced to high level)
     # CBUS0: TXLED  (eq. to highz for tests)
     with open('pyftdi/tests/resources/ft230x_io.yaml', 'rb') as yfp:
         self.loader.load(yfp)
     gpio = GpioController()
     # access to the virtual GPIO port
     out_pins = 0xAA
     gpio.configure('ftdi://:230x/1', direction=out_pins)
     vftdi = self.loader.get_virtual_ftdi(1, 1)
     vftdi.get_port(1)
     baudrate = 1000000
     gpio.set_frequency(baudrate)
     gpio.close()