Ejemplo n.º 1
0
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
{
  /* Attach and enable, or detach and disable */

  ivdbg("IRQ:%d enable:%d\n", SAM3U_TCS_IRQ, enable);
  if (enable)
    {
      sam3u_gpioirqenable(SAM3U_TCS_IRQ);
    }
  else
    {
      sam3u_gpioirqdisable(SAM3U_TCS_IRQ);
    }
}
Ejemplo n.º 2
0
void up_disable_irq(int irq)
{
  uint32_t regaddr;
  uint32_t regval;
  uint32_t bit;

  if (sam3u_irqinfo(irq, &regaddr, &bit) == 0)
    {
      /* Clear the appropriate bit in the register to enable the interrupt */

      regval  = getreg32(regaddr);
      regval &= ~bit;
      putreg32(regval, regaddr);
    }
#ifdef CONFIG_GPIO_IRQ
  else
    {
      /* Maybe it is a (derived) GPIO IRQ */

      sam3u_gpioirqdisable(irq);
    }
#endif
  sam3u_dumpnvic("disable", irq);
}