/* Receives a block of data from the SSP0 port.  */
void sspReceive(uint8_t portNum, uint8_t *buf, uint32_t length)
/* Receives a block of data from the SSP0 port.  */
void sspReceive(uint8_t portNum, uint8_t *buf, uint32_t length)
{
  uint32_t i;
  if (portNum == 0)
  {
    for ( i = 0; i < length; i++ )
    {
      SSP_SSP0DR = 0xFF;
      while ( (SSP_SSP0SR & (SSP_SSP0SR_BSY_BUSY|SSP_SSP0SR_RNE_NOTEMPTY)) != SSP_SSP0SR_RNE_NOTEMPTY );
      *buf = SSP_SSP0DR;
      buf++;
    }
  }
  return; 
}