add efm32_gpioirqclear
This commit is contained in:
parent
ed8531a53b
commit
ea596e45d3
@ -328,6 +328,20 @@ void efm32_gpioirqdisable(int irq);
|
||||
# define efm32_gpioirqdisable(irq)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: efm32_gpioirqclear
|
||||
*
|
||||
* Description:
|
||||
* clear the interrupt for specified PIO IRQ
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EFM32_GPIO_IRQ
|
||||
void efm32_gpioirqclear(int irq);
|
||||
#else
|
||||
# define efm32_gpioirqclear(irq)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Function: efm32_dumpgpio
|
||||
*
|
||||
|
@ -314,4 +314,32 @@ void efm32_gpioirqdisable(int irq)
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* Name: efm32_gpioirqclear
|
||||
*
|
||||
* Description:
|
||||
* Disable the interrupt for specified PIO IRQ
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void efm32_gpioirqclear(int irq)
|
||||
{
|
||||
|
||||
irqstate_t flags;
|
||||
uint32_t regval;
|
||||
uint32_t bit;
|
||||
|
||||
if (irq >= EFM32_IRQ_EXTI0 && irq <= EFM32_IRQ_EXTI15)
|
||||
{
|
||||
/* Enable the interrupt associated with the pin */
|
||||
|
||||
bit = ((uint32_t)1 << (irq - EFM32_IRQ_EXTI0));
|
||||
flags = irqsave();
|
||||
regval = getreg32(EFM32_GPIO_IFC);
|
||||
regval |= bit;
|
||||
putreg32(regval, EFM32_GPIO_IFC);
|
||||
irqrestore(flags);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_EFM32_GPIO_IRQ */
|
||||
|
Loading…
Reference in New Issue
Block a user