def __init__(self, intr_pin, intr_ack_gpio): """Create a new _MBInterruptEvent object Parameters ---------- intr_pin : str Name of the interrupt pin for the Microblaze. intr_ack_gpio : int Number of the GPIO pin used to clear the interrupt. """ self.interrupt = Interrupt(intr_pin) self.gpio = GPIO(GPIO.get_gpio_pin(intr_ack_gpio), "out")
def __init__(self, index): """Create a new Button object. Parameters ---------- index : int The index of the push-buttons, from 0 to 3. """ if Button._mmio is None: Button._mmio = MMIO(PL.ip_dict["SEG_btns_gpio_Reg"][0], 512) self.index = index self.interrupt = None try: self.interrupt = Interrupt('btns_gpio/ip2intc_irpt') # Enable interrupts Button._mmio.write(0x11C, 0x80000000) Button._mmio.write(0x128, 0x00000001) except ValueError: pass
def __init__(self, index): """Create a new Switch object. Parameters ---------- index : int The index of the onboard switches, from 0 to 3. """ if Switch._mmio is None: Switch._mmio = MMIO(PL.ip_dict["SEG_swsleds_gpio_Reg"][0], 512) self.index = index self.interrupt = None try: self.interrupt = Interrupt('swsleds_gpio/ip2intc_irpt') # Enable interrupts Switch._mmio.write(0x11C, 0x80000000) Switch._mmio.write(0x128, 0x00000001) except ValueError as err: print(err)
def __init__(self, index): """Create a new Button object. Parameters ---------- index : int The index of the push-buttons, from 0 to 1. """ if Button._mmio is None: base_addr = PL.ip_dict["axi_gpio_0_button"]["phys_addr"] Button._mmio = MMIO(base_addr, 512) self.index = index self.interrupt = None try: self.interrupt = Interrupt('axi_gpio_0_button/ip2intc_irpt') # Enable interrupts Button._mmio.write(0x11C, 0x80000000) Button._mmio.write(0x128, 0x00000001) except ValueError: pass