/* Sets the interrupt type and Enables interrupts for the specified pin(s). 
where the different values describe the interrupt detection mechanism (edge or level) and the particular triggering event (falling, rising, or both edges for edge detect, low or high for level detect). */
void GPIOPinIntEnable(unsigned long ulPort, unsigned long ulPins, unsigned long ulIntType)
/* Sets the interrupt type and Enables interrupts for the specified pin(s). 
where the different values describe the interrupt detection mechanism (edge or level) and the particular triggering event (falling, rising, or both edges for edge detect, low or high for level detect). */
void GPIOPinIntEnable(unsigned long ulPort, unsigned long ulPins, unsigned long ulIntType)
{
    unsigned long ulBit;
    unsigned long ulPortBase;
    ulPortBase = GPIOToPortGet(ulPort);
    xASSERT(GPIOBaseValid(ulPort));
    xASSERT((ulIntType == GPIO_FALLING_EDGE) ||
            (ulIntType == GPIO_RISING_EDGE) || 
            (ulIntType == GPIO_BOTH_EDGES) || 
	    (ulIntType == GPIO_LEVEL_LOW) ||
	    (ulIntType == GPIO_LEVEL_HIGH));
    for(ulBit = 0; ulBit < 32; ulBit++)
    {
        if(((ulPins >> ulBit) & 1) != 0)
        { 
	    xHWREG(ulPortBase + PORT_PCR + ulBit * 4) &= ~PORT_PCR_IRQC_M;
            xHWREG(ulPortBase + PORT_PCR + ulBit * 4) |= ulIntType;
        }
    }
}