/* Set the direction and mode of the specified pin(s). This function will set the specified pin(s) on the selected GPIO port as either an input or output under software control, or it will set the pin to be under hardware control.  */
void xGPIODirModeSet(unsigned long ulPort, unsigned long ulPins, unsigned long ulPinIO)
/* Set the direction and mode of the specified pin(s). This function will set the specified pin(s) on the selected GPIO port as either an input or output under software control, or it will set the pin to be under hardware control.  */
void xGPIODirModeSet(unsigned long ulPort, unsigned long ulPins, unsigned long ulPinIO)
{
    unsigned long i = 0;
    for(i = 0; i < 32; i++)
    {
        if(ulPins & (0x01 << i))
        {
            if(0 != ulPinIO)
            {
                GPIOPinModeCfg(ulPort, 0x01<<i, ulPinIO);
            }
        }
    }
}