/* Gets the direction and mode of a pin.  */
unsigned long xGPIODirModeGet(unsigned long ulPort, unsigned long ulPin)
/* Gets the direction and mode of a pin.  */
unsigned long xGPIODirModeGet(unsigned long ulPort, unsigned long ulPin)
{
    unsigned long ulBits;
    xASSERT(GPIOBaseValid(ulPort));
    for(ulBits=0; ulBits<32; ulBits++)
    {
        if(ulPin & (1 << ulBits))
        {
            break;
        }
    }
    return GPIODirModeGet(ulPort, ulBits);
}