/* Sets the FIFO level at which DMA requests or interrupts are generated. */
void SPIFIFOLevelSet(unsigned long ulBase, unsigned long ulTxLevel, unsigned long ulRxLevel)
/* Sets the FIFO level at which DMA requests or interrupts are generated. */
void SPIFIFOLevelSet(unsigned long ulBase, unsigned long ulTxLevel, unsigned long ulRxLevel)
{
  unsigned long ulRegVal;
  ulRegVal = HWREG(ulBase + MCSPI_O_XFERLEVEL);
  ulRegVal = ((ulRegVal & 0xFFFF0000) | (((ulRxLevel-1) << 8) | (ulTxLevel-1)));
  HWREG(ulBase + MCSPI_O_XFERLEVEL) = ulRegVal;
}