请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC1352R 我需要通过 SPI 72位命令发送。 在命令的中间、可能连续为10个零、因此、缓冲区(大小为8、但)会忽略该命令。 我在 spi.h 中看到了有关以下内容的警告:
* @warning The use of NULL as a sentinel txBuf or rxBuf value to determine * whether the SPI transaction includes a tx or rx component implies * that it is not possible to perform a transmit or receive transfer * directly from/to a buffer with a base address of 0x00000000. To support * this rare use-case, the application will have to manually copy the * contents of location 0x00000000 to/from a temporary buffer before/after * the tx/rx SPI transaction.
如果 消息中间出现10个零、我不知道我可以解决这个问题。
我的代码:
transaction1T2R.count = messageSize/spiParams1T2R.dataSize; asciiVal = BinaryToASCII(value1T2Rstr); transaction1T2R.txBuf = asciiVal; transaction1T2R.rxBuf = (void *)masterRxBuffer; /* Perform SPI transfer */ transferOK=SPI_transfer(masterSpi1T2R, &transaction1T2R);