You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#define SPI_BAUDRATE 1000000
|
|
|
|
|
#define SPI_MASTER 1
|
|
|
|
|
#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);
|
|
|
|
|
void spi_init();
|