Ultra fast and direct SPI library for some STM32 micros.

Dependents:   DirectSPI-test wave_player_super_lite

DirectSPI.h

Committer:
mimi3
Date:
2017-02-23
Revision:
2:1faa28f1a5bb
Parent:
1:576dbeb04958
Child:
3:63cc20b0895b

File content as of revision 2:1faa28f1a5bb:

#include "mbed.h"
#include "PeripheralPins.h"
#define TODO    0

class DirectSPI : public SPI
{
public:
    DirectSPI(PinName mosi, PinName miso, PinName sclk);
    uint16_t directWrite8(uint16_t data);
    uint16_t directWrite16(uint16_t data);
    uint16_t directWrite(uint16_t data);
protected:
    SPI_TypeDef *spi;
#if TODO
    uint16_t (DirectSPI::*spiSend)(uint16_t data);
    uint16_t spiSend8(uint16_t data){return 0;};
    uint16_t spiSend16(uint16_t data){return 0;};
#endif
};