在数据手册中有这样一段话:19.2.4 SPI Enable:
The SPI transmit/receive enable bit USPIEx enables or disables the USART in SPI mode. When USPIEx
= 0, the USART stops operation after the current transfer completes, or immediately if no operation is
active. A PUC or set SWRST bit disables the USART immediately and any active transfer is terminated.
可是如何设置USPIE=1,从而使得SPI模块工作呢?
Peter_Zheng:
这应该是F1xx里的spi模块,可以按照下面的方式
//中断及使能
ME1 |= USPIE0; // Module enable
U0CTL &= ~SWRST; // SPI enable