¼ÙÈçÎÒÃÇʹÓõ½ÁËÓ²¼þÉϵÄSPI1½Ó¿Ú£¬PB3,PB5Òý½Å¡£¶øÕâÁ½¸öÒý½ÅÓÖÊÇĬÈÏģʽΪJTAG¹¦ÄÜÒý½Å£¬ÎÒÃÇÔÚʹÓÃÕâÁ½¸öÒý½ÅµÄʱºòÖ»ÐèÒª°Ñ¹Ü½ÅÉèÖÃΪ¸´Óù¦ÄÜ£¬¸´Óõ½SPI¼´¿É¡£
//PB3 ʱÖÓ
GPIOB->MODER &=~(3<<6);
GPIOB->MODER |=2<<6;
GPIOB->AFR[0]|=5<<12;
//PB5
GPIOB->MODER &=~(3<<10);
GPIOB->MODER |=2<<10;
GPIOB->AFR[0]|=5<<20;
SPI1->CR1|= (4<<3); // SPIµÄSCKʱÖÓΪ£¨100MHZ/32£©???
SPI1->CR1|=1<<9;
SPI1->CR1|=1<<8;
SPI1->CR1|=1<<1; //ʱÖÓ¿ÕÏÐ״̬Ϊ¸ßµçƽ
SPI1->CR1|=1<<0; //ÔÚʱÖÓµÚ¶þ¸öµçƽ·¢ËÍÊý¾Ý
SPI1->CR1|=1<<2; //Ö÷SPI
SPI1->CR1 |=1<<6; //ʹÄÜSPI
ÕâÊÇÎÒÃÇÏÂÔسÌÐò·½Ê½ºÍµ÷ÊÔ·½Ê½Ö»ÄÜÑ¡ÔñSWģʽÁË¡£ÈçÐèÒª°Ñ¹Ü½Å¸ü¸Ä»ØĬÈÏ·½Ê½¼´JTAGģʽ£¬Ö»ÐèÒª°ÑAF¼Ä´æÆ÷ÅäÖÃΪ0¼´¿É¡£