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_NUCLEO_L152RE.cpp
00001 /* BurstSPI_NUCLEO_L152RE.cpp */ 00002 #ifdef TARGET_NUCLEO_L152RE 00003 #include "BurstSPI.h" 00004 00005 void BurstSPI::fastWrite(int data) { 00006 00007 SPI_TypeDef *spi = (SPI_TypeDef *)(_spi.spi); 00008 // Check if data is transmitted 00009 while (!((SPI_I2S_GetFlagStatus(spi, SPI_I2S_FLAG_TXE) != RESET) ? 1 : 0)); 00010 SPI_I2S_SendData(spi, (uint16_t)data); 00011 } 00012 00013 void BurstSPI::clearRX( void ) { 00014 int status; 00015 //Check if the RX buffer is busy 00016 SPI_TypeDef *spi = (SPI_TypeDef *)(_spi.spi); 00017 status = ((SPI_I2S_GetFlagStatus(spi, SPI_I2S_FLAG_BSY) != RESET) ? 1 : 0); 00018 if (status){ 00019 // Check RX buffer readable 00020 while (!((SPI_I2S_GetFlagStatus(spi, SPI_I2S_FLAG_RXNE) != RESET) ? 1 : 0)); 00021 int dummy = (int)SPI_I2S_ReceiveData(spi); 00022 } 00023 } 00024 #endif 00025
Generated on Mon Jul 25 2022 16:59:04 by
1.7.2