Subversion Repositories Code-Repo

Rev

Rev 231 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
226 Kevin 1
#ifndef SPI4_H
2
#define	SPI4_H
3
 
4
#define SPI4_BUFFER_OUT_SIZE    10
5
#define SPI4_BUFFER_IN_SIZE     10
6
 
7
typedef struct {
231 Kevin 8
    uint8_t buffer_out[SPI4_BUFFER_OUT_SIZE];
9
    uint32_t buffer_out_ind;
10
    uint32_t buffer_out_len;
11
    uint8_t write_blank;
226 Kevin 12
 
231 Kevin 13
    uint8_t buffer_in[SPI4_BUFFER_IN_SIZE];
14
    uint32_t buffer_in_ind;
15
    uint32_t buffer_in_len;
226 Kevin 16
 
17
    void (*tx_callback)(void);
231 Kevin 18
    void (*rx_callback)(uint8_t, uint8_t *);
226 Kevin 19
} SPI4_DATA;
20
 
21
void SPI4_Init(SPI4_DATA *data);
231 Kevin 22
uint8_t SPI4_Read(uint32_t length, void (*rx_callback)(uint8_t, uint8_t *));
23
uint8_t SPI4_Write(uint8_t *array, uint32_t length, void (*tx_callback)(void));
226 Kevin 24
 
25
#endif	/* SPI4_H */
26