/* Reads the current state of the specified pin.  */
uint32_t GPIOGetPinValue(uint32_t portNum, uint32_t bitPosi)
/* Reads the current state of the specified pin.  */
uint32_t GPIOGetPinValue(uint32_t portNum, uint32_t bitPosi)
{
  uint32_t regVal = 0;
  if( bitPosi < 0x20 )
  {
    if ( LPC_GPIO->PIN[portNum] & (0x1<<bitPosi) )
    {
      regVal = 1;
    }
  }
  else if( bitPosi == 0xFF )
  {
    regVal = LPC_GPIO->PIN[portNum];
  }
  return ( regVal );
}