Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
BurstSPI_STM32F4.cpp
00001 #if defined(TARGET_STM32F4) 00002 #include "BurstSPI.h" 00003 00004 void BurstSPI::fastWrite(int data) { 00005 00006 SPI_TypeDef *spi = (SPI_TypeDef *)(_spi.spi); 00007 // Check if data is transmitted 00008 while ((spi->SR & SPI_SR_TXE) == 0); 00009 spi->DR = data; 00010 } 00011 00012 void BurstSPI::clearRX( void ) { 00013 //Check if the RX buffer is busy 00014 SPI_TypeDef *spi = (SPI_TypeDef *)(_spi.spi); 00015 //While busy, keep checking 00016 while (spi->SR & SPI_SR_BSY){ 00017 // Check RX buffer readable 00018 while ((spi->SR & SPI_SR_RXNE) == 0); 00019 int dummy = spi->DR; 00020 } 00021 } 00022 #endif 00023
Generated on Mon Jul 25 2022 16:59:04 by
1.7.2