void SSPSend16( uint16_t *buf, uint32_t Length )
{
uint32_t i;
uint16_t Dummy = Dummy;
for ( i = 0; i < Length; i++ )
{
/* Move on only if NOT busy and TX FIFO not full. */
while ( (LPC_SSP->SR & (SSPSR_TNF|SSPSR_BSY)) != SSPSR_TNF );
LPC_SSP->DR = *buf;
buf++;
#if !LOOPBACK_MODE
while ( (LPC_SSP->SR & (SSPSR_BSY|SSPSR_RNE)) != SSPSR_RNE );
/* Whenever a byte is written, MISO FIFO counter increments, Clear FIFO
on MISO. Otherwise, when SSP0Receive() is called, previous data byte
is left in the FIFO. */
Dummy = LPC_SSP->DR;
#else
/* Wait until the Busy bit is cleared. */
while ( LPC_SSP->SR & SSPSR_BSY );
#endif
}
return;
}