Esempio n. 1
0
	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()
Esempio n. 2
0
 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()
Esempio n. 3
0
 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()
    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()
Esempio n. 7
0
class Test (unittest.TestCase):
	"""Unit test for Bitbang controller"""

	def setUp(self):
		self.dbg = False;
		self.vbs = False;
		if "S1_VERBOSE" in os.environ:
			if (os.environ["S1_VERBOSE"] == "True"):
				self.vbs = True

		if "S1_DEBUG" in os.environ:
			if (os.environ["S1_DEBUG"] == "True"):
				self.dbg = True

		os.environ["S1_BASE"] = sys.path[0] + "/s1-pycontrol"


		self.bbc = BitBangController(0x0403, 0x8530, 2)
		return

	def tearDown(self):
		del self.bbc

	def test_individual_direction(self):
		print ""
		print "reading inputs"
		#self.bbc.set_pins_to_output()
		prg = self.bbc.read_program_pin()
		srs = self.bbc.read_soft_reset_pin()

		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""

		print "setting reset pin only to output"
		self.bbc.set_soft_reset_to_output()

		print "setting program pin low (shouldn't go low), reset high"
		self.bbc.program_low()
		prg = self.bbc.read_program_pin()
		self.bbc.soft_reset_high()
		srs = self.bbc.read_soft_reset_pin()
		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""
		#self.assertEqual(prg, True)
		#self.assertEqual(srs, True)

		print "setting program pin high, reset low"
		self.bbc.program_high()
		prg = self.bbc.read_program_pin()
		self.bbc.soft_reset_low()
		srs = self.bbc.read_soft_reset_pin()
		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""
		self.assertEqual(prg, True)
		self.assertEqual(srs, False)

		print "setting program pin only to ouput"
		self.bbc.set_program_to_output()

		self.bbc.program_low()
		prg = self.bbc.read_program_pin()
		self.bbc.soft_reset_high()
		srs = self.bbc.read_soft_reset_pin()
		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""
		self.assertEqual(prg, False)
		self.assertEqual(srs, True)

		print "setting program pin high, reset low"
		self.bbc.program_high()
		prg = self.bbc.read_program_pin()
		self.bbc.soft_reset_low()
		srs = self.bbc.read_soft_reset_pin()
		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""
#		self.assertEqual(prg, True)
#		self.assertEqual(srs, True)





	def test_individual_pins(self):
		print ""
		print "reading input"
		prg = self.bbc.read_program_pin()
		srs = self.bbc.read_soft_reset_pin()

		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""


		print "setting pins to output"
		self.bbc.set_pins_to_output()

		print "setting program pin low, reset high"
		self.bbc.program_low()
		prg = self.bbc.read_program_pin()
		self.bbc.soft_reset_high()
		srs = self.bbc.read_soft_reset_pin()
		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""
		#self.assertEqual(prg, False)
		#self.assertEqual(srs, True)

		print "setting program pin high, reset low"
		self.bbc.program_high()
		prg = self.bbc.read_program_pin()
		self.bbc.soft_reset_low()
		srs = self.bbc.read_soft_reset_pin()
		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""
		#self.assertEqual(prg, True)
		#self.assertEqual(srs, False)

#		self.bbc.set_program_pin_to_input()
		print "Setting pins to input:"
		self.bbc.set_pins_to_input()
		prg = self.bbc.read_program_pin()
		srs = self.bbc.read_soft_reset_pin()

		print "Program Pin: " + str(prg)
		print "Reset Pin: " + str(srs)
		print "Program pins: " + hex(self.bbc.read_pins())
		print ""
Esempio n. 8
0
class Test(unittest.TestCase):
    """Unit test for Bitbang controller"""
    def setUp(self):
        self.dbg = False
        self.vbs = False
        if "S1_VERBOSE" in os.environ:
            if (os.environ["S1_VERBOSE"] == "True"):
                self.vbs = True

        if "S1_DEBUG" in os.environ:
            if (os.environ["S1_DEBUG"] == "True"):
                self.dbg = True

        os.environ["S1_BASE"] = sys.path[0] + "/s1-pycontrol"

        self.bbc = BitBangController(0x0403, 0x8530, 2)
        return

    def tearDown(self):
        del self.bbc

    def test_individual_direction(self):
        print ""
        print "reading inputs"
        #self.bbc.set_pins_to_output()
        prg = self.bbc.read_program_pin()
        srs = self.bbc.read_soft_reset_pin()

        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""

        print "setting reset pin only to output"
        self.bbc.set_soft_reset_to_output()

        print "setting program pin low (shouldn't go low), reset high"
        self.bbc.program_low()
        prg = self.bbc.read_program_pin()
        self.bbc.soft_reset_high()
        srs = self.bbc.read_soft_reset_pin()
        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""
        #self.assertEqual(prg, True)
        #self.assertEqual(srs, True)

        print "setting program pin high, reset low"
        self.bbc.program_high()
        prg = self.bbc.read_program_pin()
        self.bbc.soft_reset_low()
        srs = self.bbc.read_soft_reset_pin()
        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""
        self.assertEqual(prg, True)
        self.assertEqual(srs, False)

        print "setting program pin only to ouput"
        self.bbc.set_program_to_output()

        self.bbc.program_low()
        prg = self.bbc.read_program_pin()
        self.bbc.soft_reset_high()
        srs = self.bbc.read_soft_reset_pin()
        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""
        self.assertEqual(prg, False)
        self.assertEqual(srs, True)

        print "setting program pin high, reset low"
        self.bbc.program_high()
        prg = self.bbc.read_program_pin()
        self.bbc.soft_reset_low()
        srs = self.bbc.read_soft_reset_pin()
        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""
#		self.assertEqual(prg, True)
#		self.assertEqual(srs, True)

    def test_individual_pins(self):
        print ""
        print "reading input"
        prg = self.bbc.read_program_pin()
        srs = self.bbc.read_soft_reset_pin()

        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""

        print "setting pins to output"
        self.bbc.set_pins_to_output()

        print "setting program pin low, reset high"
        self.bbc.program_low()
        prg = self.bbc.read_program_pin()
        self.bbc.soft_reset_high()
        srs = self.bbc.read_soft_reset_pin()
        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""
        #self.assertEqual(prg, False)
        #self.assertEqual(srs, True)

        print "setting program pin high, reset low"
        self.bbc.program_high()
        prg = self.bbc.read_program_pin()
        self.bbc.soft_reset_low()
        srs = self.bbc.read_soft_reset_pin()
        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""
        #self.assertEqual(prg, True)
        #self.assertEqual(srs, False)

        #		self.bbc.set_program_pin_to_input()
        print "Setting pins to input:"
        self.bbc.set_pins_to_input()
        prg = self.bbc.read_program_pin()
        srs = self.bbc.read_soft_reset_pin()

        print "Program Pin: " + str(prg)
        print "Reset Pin: " + str(srs)
        print "Program pins: " + hex(self.bbc.read_pins())
        print ""