GD SPI波形,在使用過程中會寫入隻是寫入寄存器,如果這是立馬取消片選,則會錯誤
ST SPI波形
GD改善後,添加新的判斷
void spi_write_byte(uint32_t spi_periph, uint8_t data)
{
while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_TBE));
spi_i2s_data_transmit(spi_periph, data);
while(SET == spi_i2s_flag_get(spi_periph, SPI_FLAG_TRANS));
}