Subversion Repositories Code-Repo

Rev

Rev 212 | Blame | Last modification | View Log | RSS feed

#ifndef SPI1_H
#define SPI1_H

#define SPI1_BUFFER_OUT_SIZE    300
//#define SPI1_BUFFER_IN_SIZE     10

#define SPI_WRITE_ONLY

typedef struct {
    char buffer_out[SPI1_BUFFER_OUT_SIZE];
    int buffer_out_ind;
    int buffer_out_len;

    void (*tx_callback)(void);
    void (*rx_callback)(char);
} SPI1_DATA;

void SPI1_Init(SPI1_DATA *data, void (*rx_callback)(char));
// Note: SPI1_Write() writes MSB -> LSB!
int SPI1_Write(char *array, int length, void (*tx_callback)(void));

#endif  /* SPI1_H */