Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int transferData(int fd, SPI_conf* sc, uint8_t *tx, uint8_t *rx, size_t size)
- {
- int ret;
- int loop;
- struct spi_ioc_transfer tr = {
- .tx_buf = (unsigned long)tx,
- .rx_buf = (unsigned long)rx,
- .len = size,
- .delay_usecs = sc->delay,
- .speed_hz = sc->speed,
- .bits_per_word = sc->bits,
- };
- ret = write(fd, SPI_IOC_MESSAGE(1), sizeof(uint8_t));
- if (ret < 1)
- pabort("\nCan't send SPI message");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement