Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (524 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
#define SPI_MASTER_RECV 2
10

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

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