def program(vendor, product, serial_number, status=None): """ Send a program signal to the Artemis Args: vendor (int): Vendor ID of the USB Device product (int): Product ID of the USB Device serial_number (int): Serial Number of the device status (Status Object): Status object, could be left blank if status is not needed Return: Nothing Raises: USBError """ bbc = BitBangController(vendor, product, 2) bbc.set_pins_to_input() if status: status.Debug("Set signals to output") bbc.set_pins_to_output() bbc.program_high() time.sleep(.5) if status: status.Debug("Program low for .2 seconds") bbc.program_low() time.sleep(.2) if status: status.Debug("Program high for") bbc.program_high() bbc.pins_on() if status: status.Debug("Set signals to inputs") bbc.set_pins_to_input()
def program(self): """ Send a program signal to the board, the FPGA will attempt to read the binary image file from the SPI prom. If successful the 'done' LED will illuminate Args: Nothing Returns: Nothing Raises: Nothing """ bbc = BitBangController(self.vendor, self.product, 2) if self.s: self.s.Important("Set signals to input") bbc.set_pins_to_input() bbc.set_pins_to_output() bbc.program_high() time.sleep(.5) bbc.program_low() time.sleep(.2) bbc.program_high() bbc.pins_on() bbc.set_pins_to_input()
def program(vendor, product, serial_number, status = None): """ Send a program signal to the Dionysus Args: vendor (int): Vendor ID of the USB Device product (int): Product ID of the USB Device serial_number (int): Serial Number of the device status (Status Object): Status object, could be left blank if status is not needed Return: Nothing Raises: USBError """ bbc = BitBangController(vendor, product, 2) bbc.set_pins_to_input() if status: status.Debug("Set signals to output") bbc.set_pins_to_output() bbc.program_high() time.sleep(.5) if status: status.Debug("Program low for .2 seconds") bbc.program_low() time.sleep(.2) if status: status.Debug("Program high for") bbc.program_high() bbc.pins_on() if status: status.Debug("Set signals to inputs") bbc.set_pins_to_input()
def is_programmed(self): vendor = self.d.data[0] product = self.d.data[1] bbc = BitBangController(vendor, product, 2) self.d.data = bbc.read_done_pin() bbc.pins_on() bbc.set_pins_to_input() self.hrq.put(ARTEMIS_RESP_OK)
def is_programmed(self): vendor = self.d.data[0] product = self.d.data[1] bbc = BitBangController(vendor, product, 2) self.d.data = bbc.read_done_pin() bbc.pins_on() bbc.set_pins_to_input() self.hrq.put(DIONYSUS_RESP_OK)
def reset_internal_state_machine(self): bbc = BitBangController(self.vendor, self.product, 2) bbc.set_soft_reset_to_output() bbc.soft_reset_high() time.sleep(.2) bbc.soft_reset_low() time.sleep(.2) bbc.soft_reset_high() bbc.pins_on() bbc.set_pins_to_input()
def program_FPGA(self): bbc = BitBangController(self.vendor, self.product, 2) bbc.set_pins_to_input() #I don't know if this works # bbc.set_program_to_output() bbc.set_pins_to_output() bbc.program_high() time.sleep(.5) bbc.program_low() time.sleep(.2) bbc.program_high() bbc.pins_on() bbc.set_pins_to_input()
def reset(self): vendor = self.d.data[0] product = self.d.data[1] bbc = BitBangController(vendor, product, 2) bbc.set_soft_reset_to_output() bbc.soft_reset_high() time.sleep(.2) bbc.soft_reset_low() time.sleep(.2) bbc.soft_reset_high() bbc.pins_on() bbc.set_pins_to_input() self.hrq.put(ARTEMIS_RESP_OK)
def reset(self): vendor = self.d.data[0] product = self.d.data[1] bbc = BitBangController(vendor, product, 2) bbc.set_soft_reset_to_output() bbc.soft_reset_high() time.sleep(.2) bbc.soft_reset_low() time.sleep(.2) bbc.soft_reset_high() bbc.pins_on() bbc.set_pins_to_input() self.hrq.put(DIONYSUS_RESP_OK)
def reset(self): """ Send a reset signal to the board, this is the same as pressing the 'reset' button Args: Nothing Returns: Nothing Raises: Nothing """ bbc = BitBangController(self.vendor, self.product, 2) bbc.set_soft_reset_to_output() bbc.soft_reset_high() time.sleep(.2) bbc.soft_reset_low() time.sleep(.2) bbc.soft_reset_high() bbc.pins_on() bbc.set_pins_to_input()