Fork of Smoothie to port to mbed non-LPC targets.
Fork of Smoothie by
Diff: libs/spi.h
- Revision:
- 2:1df0b61d3b5a
diff -r ab59fc9af055 -r 1df0b61d3b5a libs/spi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libs/spi.h Fri Feb 28 18:52:52 2014 -0800 @@ -0,0 +1,34 @@ +#ifndef _SPI_H +#define _SPI_H + +#include <stdint.h> + +#include "spi_hal.h" + +class SPI { +public: + SPI(PinName mosi, PinName miso, PinName sclk); + ~SPI(); + + void frequency(uint32_t); + uint8_t write(uint8_t); + +// int writeblock(uint8_t *, int); + + bool can_DMA(); + int setup_DMA_rx(DMA_REG *); + int setup_DMA_tx(DMA_REG *); + + void irq(void); + + static SPI* isr_dispatch[N_SPI_INTERRUPT_ROUTINES]; + +protected: + uint32_t delay; + Pin_t miso; + Pin_t mosi; + Pin_t sclk; + SPI_REG *sspr; +}; + +#endif /* _SPI_H */