bf16-communication.h 919 B

1234567891011121314151617181920212223
  1. #ifndef BF16_COMMUNICATION_H
  2. #define BF16_COMMUNICATION_H
  3. #include <stdint.h>
  4. #include "bf16-spidevice.h"
  5. #include "bf16-uartdevice.h"
  6. int8_t open_spi_device(spi_channel_id_t channel_id);
  7. int8_t open_uart_device(uart_channel_id_t channel_id);
  8. int8_t open_ctrl_device(void);
  9. int8_t close_spi_device(spi_channel_id_t channel_id);
  10. int8_t close_uart_device(uart_channel_id_t channel_id);
  11. int8_t close_ctrl_device(void);
  12. int8_t device_spi_transfer(spi_channel_id_t channel_id, uint8_t* data, int size);
  13. int8_t device_spi_txrx(spi_channel_id_t channel_id, uint8_t* tx, uint8_t* rx, int size);
  14. int8_t device_uart_transfer(uart_channel_id_t channel_id, char* cmd);
  15. int16_t device_uart_txrx(uart_channel_id_t channel_id, char* cmd, char* data);
  16. int8_t device_ctrl_transfer(uint8_t channel_id, int state, int fn);
  17. int8_t device_ctrl_txrx(uint8_t channel_id, int state, int fn, char* data);
  18. #endif /* BF16_COMMUNICATION_H */