This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:Code Composer Studio
PIN_Handle PincsHandle;
PIN_STATE spiPinsState;
PIN_Config * spiPins;
/*PIN_Config spiPin[]=
{ PIN_ID()
CC1352R1_LAUNCHXL_SPI0_MOSI | PIN_GPIO_OUTP_EN | PIN_GPIO_HIGH | PIN_PushPull、
CC1352R1_LAUNCHXL_SPI0_CLK | PIN_GPIO_OUTP_EN | PIN_GPIO_HIGH | PIN_PushPull、
CC1352R1_LAUNCHXL_SPI0_MISO | PIN_GPIO_OUTP_EN | PIN_GPIO_HIGH | PIN_PushPull、
//CC1352R1_LAUNCHXL_SPI0_CSn | PIN_GPIO_OUTP_EN | PIN_GPIO_HIGH | PIN_PushPull、
PIN_TERMINATE
};*/
csPinHandle = PIN_OPEN (&spiPinsState、spiPins);
if (csPinHandle == NULL){
while (1);// PIN_open()失败
}
PIN_ID csnPin1 = PIN_ID (CC1352R1_LAUNCHXL_SPI0_CSn);
SPI_CONTROL (SPI、SPICC26X2DMA_CMD_SET_CSn_PIN、&csnPin1);
//PIN_setOutputValue (csPinHandle、IOID_11、1);
//transmitBuffer[0]= 0x60;
spiTransaction.count = MSGSIZE;
spiTransaction.txBuf = transmitBuffer;
receivTransaction.rxBuf = spieBuffer;
transferOK = SPI_transfer (SPI、&spiTransaction);
如果(!transferOK){
// SPI 中出现错误或传输已在进行中。
while (1);
}
//PIN_setOutputValue (csPinHandle、IOID_11、0);
transmitBuffer[0]= 0x50;
transmitBuffer[1]=0x00;
spiTransaction.txBuf = transmitBuffer;
usleep (100000);
receivTransaction.rxBuf = spieBuffer;
transferOK = SPI_transfer (SPI、&spiTransaction);
//PIN_setOutputValue (csPinHandle、IOID_11、1);
SPI_transferCancel (SPI);
返回(空);
也许引脚不可分配 ..ti 示例代码注释说。
问题是什么?