Subversion Repositories Code-Repo

Rev

Rev 226 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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