Added support for STM32F103RB
Revision 11:36ac5fd058dd, committed 2015-04-03
- Comitter:
- Backstrom
- Date:
- Fri Apr 03 06:02:58 2015 +0000
- Parent:
- 10:6ed1d9f1ef37
- Child:
- 12:c99022511536
- Commit message:
- Add LPC1549 target support.
Changed in this revision
BurstSPI_LPC_1549.cpp | Show annotated file Show diff for this revision Revisions of this file |
BurstSPI_Unsupported.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BurstSPI_LPC_1549.cpp Fri Apr 03 06:02:58 2015 +0000 @@ -0,0 +1,21 @@ +#if defined(TARGET_LPC1549) +#include "BurstSPI.h" + +void BurstSPI::fastWrite(int data) { + while (!(_spi.spi->STAT & (1 << 1))); + + _spi.spi->TXDAT = (data & 0xffff); + // end of transfer + _spi.spi->TXCTL |= ((1 << 20) | (1 << 22)); +} + +void BurstSPI::clearRX( void ) { + //Do it while either data in RX buffer, or while it is busy + while((_spi.spi->STAT & ((1 << 2) + (1 << 0))) != 0) { + //Wait until data in RX buffer + while((_spi.spi->STAT & (1 << 2)) == 0); + int dummy = _spi.spi->RXDAT & 0xffff; + } +} + +#endif \ No newline at end of file
--- a/BurstSPI_Unsupported.cpp Tue Oct 07 10:55:42 2014 +0000 +++ b/BurstSPI_Unsupported.cpp Fri Apr 03 06:02:58 2015 +0000 @@ -1,5 +1,5 @@ #if !(defined(TARGET_KL25Z) || defined(TARGET_KL46Z)) -#if !(defined(TARGET_LPC1768) || defined(TARGET_LPC1114) || defined(TARGET_LPC11U24) || defined(TARGET_LPC13XX)) +#if !(defined(TARGET_LPC1768) || defined(TARGET_LPC1114) || defined(TARGET_LPC11U24) || defined(TARGET_LPC13XX) || defined(TARGET_LPC1549)) #if !(defined(TARGET_NUCLEO_L152RE)) #warning BurstSPI target not supported, reverting to regular SPI