/ bf16-spidevice.h
bf16-spidevice.h
 1  #ifndef BF16_SPIDEVICE_H
 2  #define BF16_SPIDEVICE_H
 3  
 4  #include "bf16-device.h"
 5  
 6  #define SPI_BUFFER_SIZE  4096
 7  #define SPI_SPEED        20000000
 8  
 9  typedef enum {
10  	SPI_CHANNEL1 = 1,
11  	SPI_CHANNEL2
12  } spi_channel_id_t;
13  
14  extern char *spi0_device_name;
15  extern char *spi1_device_name;
16  
17  int8_t spi_init(device_t* attr, spi_channel_id_t channel_id,
18  		int8_t mode, uint32_t speed, uint16_t size);
19  void spi_transfer(device_t *attr);
20  void spi_release(device_t *attr);
21  
22  #endif /* BF16_SPIDEVICE_H */