环境CC2640 blestack5, IAR
char wb[2];
wb[0] = 0x0B;
wb[1] = addr;
char rb[2];
masterTransaction.count = 2;
masterTransaction.txBuf = wb;
masterTransaction.arg = NULL;
masterTransaction.rxBuf = rb;
bool r = SPI_transfer(s_spiHandle, &masterTransaction);
示波器看到发了2个字节数据出去,然后就没有clk了,收不到应答。
问题:SPI_transfer是怎么知道应该收多少数据?
Viki Shi:
SPI的使用请参考这边:dev.ti.com/…/_s_p_i_8h.html
YiKai Chen:
masterTransaction.count = 2不就代表你只要发2个字节clk出去?