RCC->APB2ENR|=1<<12;
SPI_Init(SPI1, &SPI_InitStructure);
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler =SPI_BaudRatePrescaler_128;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Cmd(SPI1,ENABLE);
whie(1)
{
SPI_I2S_SendData(SPI1,0xff);
}//为什么在PA7没有波形啊 新手哦 各位老师指点一下不甚感激啊
此帖出自
小平头技术问答
一周热门 更多>