parent
4200e69a33
commit
65c2dbfbf5
@ -1,6 +1,21 @@
|
|||||||
#define SPI_BAUDRATE 1000000
|
#define SPI_BAUDRATE 1000000
|
||||||
#define SPI_MASTER 1
|
#define SPI_MASTER 1
|
||||||
#define SPI_READBUF_LEN 32
|
#define SPI_READBUF_LEN 32
|
||||||
|
#define SPI_SS_PORT D
|
||||||
|
#define SPI_SS_PIN 7
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// copied/adapted from usbdrv.h
|
||||||
|
#define SPI_CONCAT(a, b) a ## b
|
||||||
|
|
||||||
|
#define SPI_OUTPORT(name) SPI_CONCAT(PORT, name)
|
||||||
|
#define SPI_INPORT(name) SPI_CONCAT(PIN, name)
|
||||||
|
#define SPI_DDRPORT(name) SPI_CONCAT(DDR, name)
|
||||||
|
|
||||||
|
#define SPI_SSOUT SPI_OUTPORT(SPI_SS_PORT)
|
||||||
|
#define SPI_SSIN SPI_INPORT(SPI_SS_PORT)
|
||||||
|
#define SPI_SSDDR SPI_DDRPORT(SPI_SS_PORT)
|
||||||
|
|
||||||
uint8_t spi_write(uint8_t *data, uint8_t len);
|
uint8_t spi_write(uint8_t *data, uint8_t len);
|
||||||
void spi_init();
|
void spi_init();
|
||||||
|
|||||||
Loading…
Reference in new issue