SPI_InitStructure.SPI_Direction = SPI_Direction_1Line_Rx;//SPIÊý¾ÝģʽΪµ¥Ïò½ÓÊÕ
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;//SPI ²Ù×÷ģʽΪÖ÷ģʽ
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;//Êý¾Ý³¤¶ÈΪ8λÊý¾Ý
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;//¿ÕÏÐ״̬SCKΪ¸ßµçƽ£¬
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;//SCKµÚ¶þ±ßÑØ´¥·¢
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;//NSSÒý½ÅÈí¼þÇý¶¯
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_64;//·ÖƵʱÖÓ£¬ÅäÖò¨ÌØÂÊ
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;//Êý¾Ý´«Êä´Ó¸ßλ¿ªÊ¼
SPI_InitStructure.SPI_CRCPolynomial = 0;//
SPI_Init(SPI1, &SPI_InitStructure);
当前配置后,SPI时钟脚一直有时钟输出,造成目前串行数据读不到 |