我需要实现的功能是C6000系列的DSP的SPI接口,发送数据,参照例程,仅仅注册一个任务task,代码如下:
void spi_test(UArg arg0, UArg arg1)
{
SPI_Params spiParams;
SPI_Handle handle;
SPI_Transaction transaction; /* SPI transaction */
bool retVal = false; /* return value */
/* Init SPI driver */
SPI_init();
/* Open the Board flash NOR device with the test SPI port
and use the default SPI configurations */
SPI_Params_init(&spiParams);
spiParams.frameFormat = SPI_POL0_PHA1;
handle = SPI_open(0, &spiParams);
/* Initiate transfer */
txBuf[0] = 0xAAU;
transferLength = 1U;
transaction.status=-1; /* Setting an initial value to be replaced with a proper return status */
transaction.count = transferLength;
transaction.txBuf = &txBuf[0];
transaction.rxBuf = &rxBuf[0];
retVal = SPI_transfer(handle, &transaction);
SPI_close(handle);
while(1)
;
}
代码编译没有问题,但是运行时候总是卡在了retVal = SPI_transfer(handle, &transaction);这个函数这。
请问上述是什么问题呢?
期待您的指导!谢谢了!
祝好!