/* Sets the direction and mode of the specified pin. 
where  */
void GPIODirModeSet(unsigned long ulPort, unsigned long ulBit, unsigned long ulPinIO)
/* Sets the direction and mode of the specified pin. 
where  */
void GPIODirModeSet(unsigned long ulPort, unsigned long ulBit, unsigned long ulPinIO)
{
    xASSERT(GPIOBaseValid(ulPort));
    xASSERT((ulPinIO == GPIO_DIR_MODE_IN) || (ulPinIO == GPIO_DIR_MODE_OUT) ||
           (ulPinIO == GPIO_DIR_MODE_HW) || (ulPinIO == GPIO_DIR_MODE_OD));
    xHWREG(ulPort + GPIO_PMD) = (xHWREG(ulPort + GPIO_PMD) &                   \
                               (~(3 << (ulBit * 2))));
    xHWREG(ulPort + GPIO_PMD) = (xHWREG(ulPort + GPIO_PMD) |                   \
                               ((ulPinIO & GPIO_PMD_PMD0_M) << (ulBit * 2)));
}