mirror of https://github.com/ARMmbed/mbed-os.git
commit
b311c56b44
|
@ -32,7 +32,7 @@
|
|||
#define DEVICE_I2CSLAVE 0
|
||||
|
||||
#define DEVICE_SPI 1
|
||||
#define DEVICE_SPISLAVE 0
|
||||
#define DEVICE_SPISLAVE 1
|
||||
|
||||
#define DEVICE_CAN 0
|
||||
|
||||
|
|
|
@ -183,9 +183,9 @@ static inline int ssp_read(spi_t *obj) {
|
|||
}
|
||||
|
||||
static inline int ssp_busy(spi_t *obj) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
// checking RXOV(Receiver Overrun interrupt flag)
|
||||
return obj->spi->STAT & (1 << 2);
|
||||
}
|
||||
|
||||
int spi_master_write(spi_t *obj, int value) {
|
||||
ssp_write(obj, value);
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
#if defined(TARGET_KL25Z)
|
||||
SPISlave device(PTD2, PTD3, PTD1, PTD0); // mosi, miso, sclk, ssel
|
||||
|
||||
#elif defined(TARGET_LPC812)
|
||||
SPISlave device(P0_14, P0_15, P0_12, P0_13); // mosi, miso, sclk, ssel
|
||||
|
||||
#else
|
||||
SPISlave device(p5, p6, p7, p8); // mosi, miso, sclk, ssel
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue