利用STM32F103C8控制六片595级联,NSS(PA4)接595RCK(12管脚),SCK(PA5)接595SRCLR(11管脚),MOSI(PA7)接第一个595 SER(14管脚),直接利用MOSI输出数据可以让六片595顺利移位吗?
void SpiSend(uint16_t SendData1,uint16_t SendData2,uint16_t SendData3)
{
RCK_LOW();
while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
SPI_I2S_SendData(SPI1, SendData1);
while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
SPI_I2S_SendData(SPI1, SendData2);
while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
SPI_I2S_SendData(SPI1, SendData3);
RCK_HIGH();
DisDelay();
}
这样写有问题吗? |