23 #include <wiringPiSPI.h>
45 int spiInit(uint8_t mode, uint32_t khzspeed) {
54 printf(
"Invalid device response\n");
81 wiringPiSPIDataRW(
SPI_CHAN, &value, 1);
95 const unsigned short ID_VAL_ = 0x5345;
96 unsigned short rxData[] = {0x00, 0x00};
98 while (retry_count > 0) {
118 if ((rxData[0] << 8 | rxData[1]) == ID_VAL_) {