/* Waits until the word is transmitted on the specified port. */
void SPIDataPut(unsigned long ulBase, unsigned long ulData)
/* Waits until the word is transmitted on the specified port. */
void SPIDataPut(unsigned long ulBase, unsigned long ulData)
{
  while(!(HWREG(ulBase + MCSPI_O_CH0STAT)&MCSPI_CH0STAT_TXS))
  {
  }
  HWREG(ulBase + MCSPI_O_TX0) = ulData;
}