直接写了CC1310的SPI测试程序!运行后3个IO都没有输出!代码如下:
/*
* ======== echoFxn ========
* Task for this function is created statically. See the project's .cfg file.
*/
Void taskFxn_SPI(UArg arg0, UArg arg1)
{
unsigned int ret;
// uint16_t temperature;
uint8_t txBuffer[2]={0x55,0x88};
uint8_t rxBuffer[2];
SPI_Handle handle;
SPI_Params params;
SPI_Transaction spiTransaction;
SPI_Params_init(¶ms);
params.bitRate = 1000000;
handle = SPI_open(Board_SPI0, ¶ms);
if (!handle) {
System_printf("SPI did not open");
}
else {
System_printf("SPI Initialized!\n");
}
spiTransaction.count = 2;
spiTransaction.txBuf = txBuffer;
spiTransaction.rxBuf = rxBuffer;
while(1)
{
ret = SPI_transfer(handle, &spiTransaction);
if (!ret) {
System_printf("Unsuccessful SPI transfer");
}
else {
System_printf("SPI Bus fault\n");
}
Task_sleep(500000 / Clock_tickPeriod);
}
/* Deinitialized spi */
SPI_close(handle);
System_printf("SPI closed!\n");
System_flush();
}
/*!*****************************************************************************
* @brief Application main entry point
*
* @param none
*
* @return int - Should never return
******************************************************************************/
int main(void)
{
/* Locals */
Task_Params taskParams;
/* Do PIN init before starting the kernel */
PIN_init(BoardGpioInitTable);
/* Call board init functions. */
Board_initGeneral();
Board_initSPI();
/* Configure task.
Task_Params_init(&taskParams);
taskParams.stack = myTaskStack;
taskParams.stackSize = sizeof(myTaskStack);
Task_construct(&myTask, taskFxn, &taskParams, NULL);
*/
/* Configure task. */
Task_Params_init(&taskParams);
taskParams.stack = myTaskStack;
taskParams.stackSize = sizeof(myTaskStack);
Task_construct(&myTask, taskFxn_SPI, &taskParams, NULL);
/* Start kernel. */
BIOS_start();
/* Should never get here; include a return to keep the compiler happy */
return 0;
}