bf16-spidevice.h 482 B

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