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.
Hi,
我想将CC1310和传感器进行SPI通信,所以我将SPI做了如下配置:
SPI_init();
SPI_Params_init(&SPIparams);
SPIparams.bitRate = 4000000;
SPIparams.frameFormat = SPI_POL0_PHA1;
SPIparams.mode = SPI_MASTER;
// Configure the transaction
transaction.txBuf = AS393_TxBuffer;
transaction.rxBuf = AS393_RxBuffer;
SPIhandle = SPI_open(Board_SPI0, &SPIparams);
if (SPIhandle == NULL) {
// System_abort("Error initializing SPI\n");
asm("nop");
}
else {
asm("nop");
//System_printf("SPI initialized\n");
}
,这个配置我看了是在时钟下降沿的时候发送数据的,我现在想让时钟在上升沿发送数据改怎么设置呢?frameFormat里面的几项是什么意思呢?
谢谢!
typedef enum SPI_FrameFormat_ {
SPI_POL0_PHA0 = 0, /*!< SPI mode Polarity 0 Phase 0 */
SPI_POL0_PHA1 = 1, /*!< SPI mode Polarity 0 Phase 1 */
SPI_POL1_PHA0 = 2, /*!< SPI mode Polarity 1 Phase 0 */
SPI_POL1_PHA1 = 3, /*!< SPI mode Polarity 1 Phase 1 */
SPI_TI = 4, /*!< TI mode (not supported on all
implementations) */
SPI_MW = 5 /*!< Micro-wire mode (not supported on all
implementations) */
} SPI_FrameFormat;