ret = write(fd, TxBuf1, 1);
if (ret < 0)
printf("spi:SPI Write error
");
ret = write(fd, TxBuf2, 1);
if (ret < 0)
printf("spi:SPI Write error
");
ret = write(fd, TxBuf3, 1);
if (ret < 0)
printf("spi:SPI Write error
");
出现错误是因为像下面一样一起写三个字节出现错误的
ret = write(fd, TxBuf, 3);
if (ret < 0)
printf("spi:SPI Read error
");