尝试在Linux Debian上运行的ARM处理器上执行SPI通信。 无法编译下面的代码(错误:在'。'令牌之前预期的primary-expression) g ++ comm.cpp -o comm 我不知道如何编译这段代码是否有我遗漏的东西?谢谢。
struct spi_ioc_transfer tr = {
.tx_buf = (unsigned long)tx,
.rx_buf = (unsigned long)rx,
.len = ARRAY_SIZE(tx),
.delay_usecs = delay,
.speed_hz = speed,
.bits_per_word = bits
};