/* Checks whether the specified SPI flag is set or not.  */
FlagStatus SPI_GetFlagStatus(SPI_TypeDef *spi, SPI_FLAG_TypeDef flag)
/* Checks whether the specified SPI flag is set or not.  */
FlagStatus SPI_GetFlagStatus(SPI_TypeDef *spi, SPI_FLAG_TypeDef flag)
{
    return (spi->SR & flag) ? SET : RESET;
}