Just a fork with fix for newer mbed versions
BurstSPI_LPC_1549.cpp@15:5809125b8dac, 2021-04-18 (annotated)
- Committer:
- reneg973
- Date:
- Sun Apr 18 21:31:53 2021 +0000
- Revision:
- 15:5809125b8dac
- Parent:
- 12:c99022511536
fixed LPC_1768 compiler issue and transfer problems; ; Performance:; loop SPI.write() => 138.1 ms for updating a display; loop BurstSPI.fastWrite() => 22.4 ms;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Backstrom | 11:36ac5fd058dd | 1 | #if defined(TARGET_LPC1549) |
Backstrom | 11:36ac5fd058dd | 2 | #include "BurstSPI.h" |
Backstrom | 11:36ac5fd058dd | 3 | |
Backstrom | 11:36ac5fd058dd | 4 | void BurstSPI::fastWrite(int data) { |
Backstrom | 11:36ac5fd058dd | 5 | while (!(_spi.spi->STAT & (1 << 1))); |
Backstrom | 11:36ac5fd058dd | 6 | |
Backstrom | 11:36ac5fd058dd | 7 | _spi.spi->TXDAT = (data & 0xffff); |
Backstrom | 12:c99022511536 | 8 | // end of transfer and receive ignore flag |
Backstrom | 11:36ac5fd058dd | 9 | _spi.spi->TXCTL |= ((1 << 20) | (1 << 22)); |
Backstrom | 11:36ac5fd058dd | 10 | } |
Backstrom | 11:36ac5fd058dd | 11 | |
Backstrom | 11:36ac5fd058dd | 12 | void BurstSPI::clearRX( void ) { |
Backstrom | 12:c99022511536 | 13 | //We already set receive ignore flag, so this function is never run. |
Backstrom | 11:36ac5fd058dd | 14 | } |
Backstrom | 11:36ac5fd058dd | 15 | |
Backstrom | 11:36ac5fd058dd | 16 | #endif |