Lib BurstSPI give access to fastWrite function and clearRX function, this lib is now compatible with Nucleo L152RE board
Fork of BurstSPI by
BurstSPI_LPC1768.cpp
- Committer:
- Alamalione
- Date:
- 2014-06-25
- Revision:
- 5:c9c9ef0a40b9
- Parent:
- 3:7d9b64d67b22
File content as of revision 5:c9c9ef0a40b9:
#ifdef TARGET_LPC1768 #include "BurstSPI.h" void BurstSPI::fastWrite(int data) { //Wait until FIFO has space while(((_spi.spi->SR) & 0x02) == 0); //transmit data _spi.spi->DR = data; } void BurstSPI::clearRX( void ) { //Do it while either data in RX buffer, or while it is busy while(((_spi.spi->SR) & ((1<<4) + (1<<2))) != 0) { //Wait until data in RX buffer while(((_spi.spi->SR) & (1<<2)) == 0); int dummy = _spi.spi->DR; } } #endif