Subversion Repositories Code-Repo

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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