From cbc941282074856fc6179761b70a0c9879b0b64d Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 11 Oct 2011 21:56:36 +0200 Subject: update firmware to @319 --- firmware/spi.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'firmware/spi.h') diff --git a/firmware/spi.h b/firmware/spi.h index d7cfbf1..8a8a1fe 100644 --- a/firmware/spi.h +++ b/firmware/spi.h @@ -41,24 +41,25 @@ #define MISO PB3 #define SCK PB1 -void spi_parser(char *buf); - -int spi_init(void); -int spi_deinit(void); +enum { SPI_SPEED_125kHz, SPI_SPEED_250kHz, SPI_SPEED_500kHz, SPI_SPEED_1MHz, + SPI_SPEED_2MHz, SPI_SPEED_4MHz, SPI_SPEED_8MHz }; -int spi_set_speed(int speed); -int spi_send(char * buf, int length); -unsigned char spi_receive( char * buf, int length); -int spi_send_and_receive(char * txbuf, char * rxbuf, int length); +void spi_parser(char *buf); +void spi_init_usb(uint8_t dord, uint8_t mode, uint8_t speed); +int spi_init(uint8_t dord, uint8_t mode, uint8_t speed); -void spi_init_usb(void); void spi_deinit_usb(void); +int spi_deinit(void); + +void spi_send_usb(uint8_t length, char * buf); +int spi_send(int length, char * buf); -void spi_set_speed_usb(int speed); -void spi_send_usb(char * buf, int length); void spi_receive_usb(int length); +unsigned char spi_receive(int length, char * buf); + void spi_send_and_receive_usb(char * txbuf, int length); +int spi_send_and_receive(char * txbuf, char * rxbuf, int length); #endif /* SPI_H */ -- cgit v1.2.1