/* 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) <= 5 );
    ulBase = g_pulIPRSTRegs[(ulPinConfig >> 12) & 0xf];
    ulShift = (ulPinConfig >> 8) & 0xf;
    if(ulPinConfig & 0x1)
    {
        xHWREG(ulBase) |= (0x1 << ulShift);
    }
    else
    {
        xHWREG(ulBase) &= ~(0x1 << ulShift);
    }
    if(ulPinConfig & 0x10)
    {
        xHWREG(ulBase) |= (0x1 << (ulShift + 8));
    }
    else
    {
        xHWREG(ulBase) &= ~(0x1 << (ulShift + 8));
    }
}