ARM/Microchip/SAM4L/src/iopincfg_sam4l.c
void IOPinDisableInterrupt(int IntNo)
{
	if (IntNo < 0 || IntNo >= IOPIN_MAX_INT)
	{
		return;
	}

	int portno = (s_GpIOSenseEvt[IntNo].PortPinNo >> 8) & 0xFF;

	GpioPort *reg = (GpioPort *)((uint32_t)&SAM4L_GPIO->GPIO_PORT[portno]);

	uint32_t pinmask = 1 << (s_GpIOSenseEvt[IntNo].PortPinNo & 0xFF);

	reg->GPIO_IERC = pinmask;
	NVIC_DisableIRQ(GPIO_0_IRQn + IntNo);
	NVIC_ClearPendingIRQ(GPIO_0_IRQn + IntNo);

    s_GpIOSenseEvt[IntNo].PortPinNo = -1;
    s_GpIOSenseEvt[IntNo].Sense = IOPINSENSE_DISABLE;
    s_GpIOSenseEvt[IntNo].SensEvtCB = NULL;
	s_GpIOSenseEvt[IntNo].pCtx = NULL;
}
/**
 * @brief	Disable I/O pin sense interrupt
 *
 * @param	IntNo : Interrupt number to disable
 */
@brief       Disable I/O pin sense interrupt
@param       IntNo : Interrupt number to disable
@brief Disable I / O pin sense interrupt @param IntNo : Interrupt number to disable
void IOPinDisableInterrupt(int IntNo)
{
	if (IntNo < 0 || IntNo >= IOPIN_MAX_INT)
	{
		return;
	}
	int portno = (s_GpIOSenseEvt[IntNo].PortPinNo >> 8) & 0xFF;
	GpioPort *reg = (GpioPort *)((uint32_t)&SAM4L_GPIO->GPIO_PORT[portno]);
	uint32_t pinmask = 1 << (s_GpIOSenseEvt[IntNo].PortPinNo & 0xFF);
	reg->GPIO_IERC = pinmask;
	NVIC_DisableIRQ(GPIO_0_IRQn + IntNo);
	NVIC_ClearPendingIRQ(GPIO_0_IRQn + IntNo);
    s_GpIOSenseEvt[IntNo].PortPinNo = -1;
    s_GpIOSenseEvt[IntNo].Sense = IOPINSENSE_DISABLE;
    s_GpIOSenseEvt[IntNo].SensEvtCB = NULL;
	s_GpIOSenseEvt[IntNo].pCtx = NULL;
}
void IOPinDisableInterrupt ( int IntNo ) { if ( IntNo < 0 || IntNo >= IOPIN_MAX_INT ) { return ; } int portno = ( s_GpIOSenseEvt [ IntNo ] . PortPinNo >> 8 ) & 0xFF ; GpioPort * reg = ( GpioPort * ) ( ( uint32_t ) & SAM4L_GPIO -> GPIO_PORT [ portno ] ) ; uint32_t pinmask = 1 << ( s_GpIOSenseEvt [ IntNo ] . PortPinNo & 0xFF ) ; reg -> GPIO_IERC = pinmask ; NVIC_DisableIRQ ( GPIO_0_IRQn + IntNo ) ; NVIC_ClearPendingIRQ ( GPIO_0_IRQn + IntNo ) ; s_GpIOSenseEvt [ IntNo ] . PortPinNo = -1 ; s_GpIOSenseEvt [ IntNo ] . Sense = IOPINSENSE_DISABLE ; s_GpIOSenseEvt [ IntNo ] . SensEvtCB = NULL ; s_GpIOSenseEvt [ IntNo ] . pCtx = NULL ; }
@brief       Disable I/O pin sense interrupt
 @param       IntNo : Interrupt number to disable
@brief Disable I / O pin sense interrupt @param IntNo : Interrupt number to disable