Subversion Repositories Code-Repo

Rev

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

#ifndef SPI1_H
#define SPI1_H

#define SPI1_BUFFER_SIZE 300

#define SPI_WRITE_ONLY

typedef struct {
    char buffer_out[SPI1_BUFFER_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(unsigned char *array, unsigned int count, void (*tx_callback)(void));

#endif  /* SPI1_H */