#ifndef LICKS_SPI_H #define LICKS_SPI_H #include #define SPI_IDLE 0x00 #define SPI_WAIT 0x01 #define SPI_BUSY 0x02 #define SPI_DONE 0x03 #define SPI_ERR 0x04 #define CMD_NOP 0x00 #define CMD_CONTINUE 0x01 #define CMD_FINISH 0x02 #define CMD_CLEAR 0x8A #define CMD_SET_SERVOS 0x10 #define CMD_SET_LED 0x11 #define CMD_SET_LASER 0x12 #define CMD_GET_SERVOS 0x20 extern void spi_open(uint8_t, uint32_t); extern void spi_update_servos(); extern void set_led(uint8_t); extern void set_laser(uint8_t); extern void spi_close(); struct spi_message { uint8_t cmd; uint8_t length; uint8_t checksum; uint8_t data[255]; }; struct spi_result { uint8_t status; uint8_t length; uint8_t checksum; uint8_t data[255]; }; #endif