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_LPC1768.cpp@3:7d9b64d67b22, 2013-07-04 (annotated)
- Committer:
- Sissors
- Date:
- Thu Jul 04 19:03:58 2013 +0000
- Revision:
- 3:7d9b64d67b22
- Parent:
- BurstSPI.cpp@0:600eecd89a78
Refactored code, added version 1 of KL25Z support
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Sissors | 3:7d9b64d67b22 | 1 | #ifdef TARGET_LPC1768 |
| Sissors | 0:600eecd89a78 | 2 | #include "BurstSPI.h" |
| Sissors | 0:600eecd89a78 | 3 | |
| Sissors | 0:600eecd89a78 | 4 | void BurstSPI::fastWrite(int data) { |
| Sissors | 0:600eecd89a78 | 5 | //Wait until FIFO has space |
| Sissors | 0:600eecd89a78 | 6 | while(((_spi.spi->SR) & 0x02) == 0); |
| Sissors | 0:600eecd89a78 | 7 | |
| Sissors | 0:600eecd89a78 | 8 | //transmit data |
| Sissors | 0:600eecd89a78 | 9 | _spi.spi->DR = data; |
| Sissors | 0:600eecd89a78 | 10 | } |
| Sissors | 0:600eecd89a78 | 11 | |
| Sissors | 0:600eecd89a78 | 12 | void BurstSPI::clearRX( void ) { |
| Sissors | 0:600eecd89a78 | 13 | //Do it while either data in RX buffer, or while it is busy |
| Sissors | 0:600eecd89a78 | 14 | while(((_spi.spi->SR) & ((1<<4) + (1<<2))) != 0) { |
| Sissors | 0:600eecd89a78 | 15 | //Wait until data in RX buffer |
| Sissors | 0:600eecd89a78 | 16 | while(((_spi.spi->SR) & (1<<2)) == 0); |
| Sissors | 0:600eecd89a78 | 17 | int dummy = _spi.spi->DR; |
| Sissors | 0:600eecd89a78 | 18 | } |
| Sissors | 3:7d9b64d67b22 | 19 | } |
| Sissors | 3:7d9b64d67b22 | 20 | #endif |
