Fast SPI write, added LPC812 Target

Dependents:   wsDrive

Fork of BurstSPI by Erik -

BurstSPI_LPC_1549.cpp

Committer:
JojoS
Date:
2016-10-09
Revision:
14:83e3b8ba3f43
Parent:
12:c99022511536

File content as of revision 14:83e3b8ba3f43:

#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 and receive ignore flag
#ifndef NO_EOT_AFTER_WRITE
    // set EOT and receive ignore flag
    _spi.spi->TXCTL |= ((1 << 20) | (1 << 22));
#else
    // set receive ignore flag
    _spi.spi->TXCTL |= (1 << 22);
#endif
}

void BurstSPI::clearRX( void ) {
    //We already set receive ignore flag, so this function is never run.
}

#endif