|
选择HSI做为主时钟,16MHz
void CLK_Init(void)
{
CLK_DeInit();
CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);
}
//SPI初始化
void SPI_MyInit(void)
{
SPI_DeInit();
SPI_Init(SPI_FIRSTBIT_MSB,
SPI_BAUDRATEPRESCALER_128,
SPI_MODE_MASTER,
SPI_CLOCKPOLARITY_HIGH,
SPI_CLOCKPHASE_2EDGE,
SPI_DATADIRECTION_2LINES_FULLDUPLEX,
SPI_NSS_SOFT,
0x07);
//SPI_CalculateCRCCmd(DISABLE);
SPI_Cmd(ENABLE);
}
配置完上述两项后,SPI还是执行不过去,难道还有别的需要配置的参数吗?
|
|