Project

General

Profile

Statistics
| Revision:

root / branches / encoders / code / projects / libdragonfly / spi.h @ 350

History | View | Annotate | Download (461 Bytes)

1
#define DOUBLE_SCK 1
2
#define SPR0_BIT 1
3
#define LSB 1
4
#define MSB 0
5
#define MASTER 1
6
#define SLAVE 0
7
#define SPI_SENDING 1
8
#define SPI_VOID 0
9

    
10
/* Pin Defines */
11
#define MOSI _BV(PB2)
12
#define MISO _BV(PB3)
13
#define SS _BV(PB0)
14
#define SCLK _BV(PB1)
15

    
16
#define size_t int
17
typedef void (*spi_fun_recv_t)(char);
18
typedef void (*spi_fun_send_t)(char);
19
int spi_init(char mode, spi_fun_send_t send_func, spi_fun_recv_t recv_func);
20
int spi_send(char *data, size_t bytes);
21