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.
Fork of BurstSPI by
BurstSPI_KL25Z.cpp
00001 #ifdef TARGET_KL25Z 00002 #include "BurstSPI.h" 00003 00004 void BurstSPI::fastWrite(int data) { 00005 //Wait until FIFO has space 00006 while(((_spi.spi->S) & SPI_S_SPTEF_MASK) == 0); 00007 //transmit data 00008 _spi.spi->D = data; 00009 } 00010 00011 void BurstSPI::clearRX( void ) { 00012 //We put in a delay here, this function shouldn't be called very often, so not a huge problem 00013 //Without delay you will rise the CS line before it is finished (been there, done that) 00014 //We use time required to transmit 20 bits (8 bits being transmitted, 8 bits in FIFO, 4 bits safety margin 00015 00016 float bytetime = 20.0/_hz; 00017 wait(bytetime); 00018 00019 //Wait until status is flagged that we can read, read: 00020 while (_spi.spi->S & SPI_S_SPRF_MASK == 0); 00021 int dummy = _spi.spi->D; 00022 00023 } 00024 #endif
Generated on Thu Jul 14 2022 05:47:27 by
1.7.2
