int main(void) { periphery_init(); while(SPI_I2S_GetFlagStatus(SPI1,SPI_I2S_FLAG_RXNE)==RESET); received_value = SPI1->DR; }