uint8_t SPI_Byte( uint8_t ThisByte )
{
// while( (LPC_SSP0->SR & 0x01) !=0x01 ); //TFE
while( (LPC_SSP0->SR & 0x10) !=0 ); // BSY
LPC_SSP0->DR = ThisByte;
while( (LPC_SSP0->SR & 0x04) != 0x04); //RNE
// while( (LPC_SSP0->SR & 0x10) !=0 ); //BSY
return( LPC_SSP0->DR );
} |