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