Revision 546
Modified spi.c/h. Sends 1 packet before failing. Funny light blinking
thing happens when sending, no idea where that came from. It looks like
the orbs are used as transmit lights but there's no code for that as far
as I know.
spi.h | ||
---|---|---|
8 | 8 |
#define MASTER 1 |
9 | 9 |
#define SLAVE 0 |
10 | 10 |
|
11 |
#define SPI_IDLE _BV(0)
|
|
12 |
#define SPI_SEND _BV(1)
|
|
13 |
#define SPI_RECV _BV(2)
|
|
14 |
#define SPI_BOTH _BV(3)
|
|
11 |
#define SPI_IDLE 0x00
|
|
12 |
#define SPI_SEND 0x01
|
|
13 |
#define SPI_RECV 0x02
|
|
14 |
#define SPI_BOTH 0x03
|
|
15 | 15 |
|
16 | 16 |
|
17 | 17 |
/* Pin Defines */ |
... | ... | |
20 | 20 |
#define SS _BV(PB0) |
21 | 21 |
#define SCLK _BV(PB1) |
22 | 22 |
|
23 |
#define size_t int |
|
23 |
//#define size_t int
|
|
24 | 24 |
typedef void (*spi_fun_recv_t)(char); |
25 | 25 |
typedef void (*spi_fun_send_t)(char); |
26 | 26 |
void spi_init(char mode, spi_fun_recv_t recv_func); |
27 |
int spi_send(char *data, size_t bytes);
|
|
27 |
int spi_send(char *data, int bytes);
|
|
28 | 28 |
void spi_master_recv_on(void); |
29 | 29 |
void spi_master_recv_off(void); |
30 | 30 |
void spi_read_one(void); |
31 |
void spi_read(int bytes); |
|
31 | 32 |
|
32 | 33 |
#endif |
Also available in: Unified diff