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
 
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 {
231 Kevin 10
    uint8_t buffer_out[SPI1_BUFFER_OUT_SIZE];
11
    uint32_t buffer_out_ind;
12
    uint32_t buffer_out_len;
212 Kevin 13
 
14
    void (*tx_callback)(void);
231 Kevin 15
    void (*rx_callback)(uint8_t);
199 Kevin 16
} SPI1_DATA;
17
 
231 Kevin 18
void SPI1_Init(SPI1_DATA *data, void (*rx_callback)(uint8_t));
199 Kevin 19
// Note: SPI1_Write() writes MSB -> LSB!
231 Kevin 20
uint8_t SPI1_Write(uint8_t *array, uint32_t length, void (*tx_callback)(void));
199 Kevin 21
 
22
#endif	/* SPI1_H */
23