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.
Diff: BurstSPI_M480.cpp
- Revision:
- 15:4ec06ff45f56
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/BurstSPI_M480.cpp Thu Feb 06 06:55:22 2020 +0000
@@ -0,0 +1,24 @@
+#ifdef TARGET_M480
+#include "BurstSPI.h"
+
+void BurstSPI::fastWrite(int data) {
+ //Wait until FIFO has space
+// SPI_T *spi_base = (SPI_T *) NU_MODBASE(_peripheral->spi.spi.spi);
+#if 1
+ write(data);
+#else
+ spi_master_write(&(_peripheral->spi), data);
+#endif
+ }
+
+void BurstSPI::clearRX( void ) {
+ //We put in a delay here, this function shouldn't be called very often, so not a huge problem
+ //Without delay you will rise the CS line before it is finished (been there, done that)
+ //We use time required to transmit 20 bits (8 bits being transmitted, 8 bits in FIFO, 4 bits safety margin
+
+ float bytetime = 20.0/_hz;
+ wait(bytetime);
+ //Wait until status is flagged that we can read, read:
+// SPI_T *spi_base = (SPI_T *) NU_MODBASE(_peripheral->spi.spi.spi);
+}
+#endif