/* Configures the alternate function of a GPIO pin.  */
void GPIOPinConfigure(unsigned long ulPinConfig)
/* Configures the alternate function of a GPIO pin.  */
void GPIOPinConfigure(unsigned long ulPinConfig)
{
    unsigned long ulBase, ulShift;
    xASSERT(((ulPinConfig >> 12) & 0xf) <= 3 );
    ulBase = g_pulIPRSTRegs[(ulPinConfig >> 12) & 0xf];
    ulShift = (ulPinConfig >> 8) & 0xf;
    xHWREG(ulBase) &= ~(1 << ulShift);
    xHWREG(ulBase) |= (1 << ulShift);
    ulShift = (ulPinConfig >> 24) & 0xf;
    if((ulPinConfig >> 16) & 0x1)
    {
        xHWREG(GCR_ALTMFP) |= (1 << ulShift);
    }
    else
    {
        xHWREG(GCR_ALTMFP) &= ~(1 << ulShift);
    }
}