/* Configures the alternate function of a GPIO pin.  */
void GPIOPinConfigure(const unsigned long ulPinConfig)
/* Configures the alternate function of a GPIO pin.  */
void GPIOPinConfigure(const unsigned long ulPinConfig)
{
	unsigned long ulRegValue;
	if(ulPinConfig & 0x00000100)
	{
		ulRegValue = xHWREG(GCR_GPBALT);
		ulRegValue &= ~(0x03 << ((ulPinConfig >> 8) & 0x0f));
		ulRegValue |= ((0x03 & ulPinConfig) << ((ulPinConfig >> 8) & 0x0f));
		xHWREG(GCR_GPBALT) = ulRegValue;
	}
	else
	{
		ulRegValue = xHWREG(GCR_GPAALT);
		ulRegValue &= ~(0x03 << ((ulPinConfig >> 8) & 0x0f));
		ulRegValue |= ((0x03 & ulPinConfig) << ((ulPinConfig >> 8) & 0x0f));
		xHWREG(GCR_GPAALT) = ulRegValue;
	}
}