Other Parts Discussed in Thread: CC2640R2F, SYSCONFIG, ADS1299
请问我的SPI初始化和读写数据函数有错嘛,为什么我的程序执行到SPI_transfer就卡住了,望回复!
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.
你可以看下CC2640r2f移植spi的程序https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1014053/faq-launchxl-cc2640r2-how-to-merge-a-driver-example-in-the-simple_peripheral-project-step-by-step-guide?tisearch=e2e-sitesearch&keymatch=faq%3Atrue
除了没有sysconfig,其他都是类似的
callback参考下面的打开方式:
SPI_Handle spi; SPI_Params spiParams; SPI_Params_init(&spiParams); spiParams.transferMode = SPI_MODE_CALLBACK; spiParams.transferCallbackFxn = UserCallbackFxn; spi = SPI_open(CONFIG_SPI0, &spiParams); if (spi == NULL) { // Error opening SPI while (1); }
注意如果之前使用SPI_open打开过spi,设置callback则需要先使用SPI_close()关闭,然后再重新打开
当工作在SPI_SLAVE模式时,必须要有,作为master不需要