Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
199 Kevin 1
#ifndef SPI1_H
2
#define	SPI1_H
3
 
4
#define SPI1_BUFFER_SIZE 300
5
 
212 Kevin 6
#define SPI_WRITE_ONLY
199 Kevin 7
 
8
typedef struct {
212 Kevin 9
    char buffer_out[SPI1_BUFFER_SIZE];
10
    int buffer_out_ind;
11
    int buffer_out_len;
12
 
13
    void (*tx_callback)(void);
14
    void (*rx_callback)(char);
199 Kevin 15
} SPI1_DATA;
16
 
212 Kevin 17
void SPI1_Init(SPI1_DATA *data, void (*rx_callback)(char));
199 Kevin 18
// Note: SPI1_Write() writes MSB -> LSB!
212 Kevin 19
int SPI1_Write(unsigned char *array, unsigned int count, void (*tx_callback)(void));
199 Kevin 20
 
21
#endif	/* SPI1_H */
22