def getadc(self, irqCtl): """ Analog to Digital Converter IRQ. :param irqCtl: The ADC IRQ type. One of the `pysimavr.swig.utils.AVR_IOCTL_ADC_*` constants. :return: An :class:`~pysimavr.swig.simavr.avr_irq_t` instance. """ return avr_io_getirq(self._avrbackend, utils.AVR_IOCTL_ADC_GETIRQ, irqCtl)
def gettimer(self, timer_num, ctl): """ Timer IRQ. For PWM, scheduling etc. :param timer_num: Which timer/counter to use. For example `0` indicates `Timer/Counter0`. :param ctl: The Timer IRQ type. One of the `pysimavr.swig.utils.AVR_TIMER_*` or `pysimavr.swig.utils.TIMER_IRQ_OUT_*` constants. :return: An :class:`~pysimavr.swig.simavr.avr_irq_t` instance. """ return avr_io_getirq(self._avrbackend, utils.AVR_IOCTL_TIMER_GETIRQ(str(timer_num)), ctl)
def getuart(self, uart_num, ctl): """ UART IRQ. :param uart_num: Which UART interface to use. :param ctl: The SPI IRQ type. One of the `pysimavr.swig.utils.UART_IRQ_*` constants. :return: An :class:`~pysimavr.swig.simavr.avr_irq_t` instance. """ return avr_io_getirq(self._avrbackend, utils.AVR_IOCTL_UART_GETIRQ(str(uart_num)), ctl)
def getspi(self, spi_num, ctl): """ SPI IRQ. :param spi_num: Which SPI interface to use. For devices with multiple SPIs. :param ctl: The SPI IRQ type. One of the `pysimavr.swig.utils.SPI_IRQ_*` constants. :return: An :class:`~pysimavr.swig.simavr.avr_irq_t` instance. """ return avr_io_getirq(self._avrbackend, utils.AVR_IOCTL_SPI_GETIRQ(spi_num), ctl)
def getioport(self, portPin): """ Digital IO IRQ. :param portPin: `(port, pin)` tuple. The port is a single uppercase character like `"A"`. The pin is one of the `pysimavr.swig.utils.IOPORT_IRQ_*` constants. For example `("A", IOPORT_IRQ_PIN_ALL)` tuple represents all the 8 bits of the port. Note the `IOPORT_IRQ_PINx' constants are intentionally declared with values `0..7` in simavr. So it is possible to use plain integers to address a specific pin of a port too. For example `("A", 6)` indicates *A6* port. :return: An :class:`~pysimavr.swig.simavr.avr_irq_t` instance. """ return avr_io_getirq(self._avrbackend, utils.AVR_IOCTL_IOPORT_GETIRQ(portPin[0]), int(portPin[1]))
def _getirq(self, port, pin): return avr_io_getirq(self.backend, AVR_IOCTL_IOPORT_GETIRQ(port), pin)