/* Checks whether the specified interrupt has occurred or not.  */
ITStatus SPI_GetITStatus(SPI_TypeDef *SPIx, SPI_IT_TypeDef SPI_IT)
/* Checks whether the specified interrupt has occurred or not.  */
ITStatus SPI_GetITStatus(SPI_TypeDef *SPIx, SPI_IT_TypeDef SPI_IT)
{
  ITStatus pendingbitstatus = RESET;
  uint8_t itpos = 0;
  uint8_t itmask1 = 0;
  uint8_t itmask2 = 0;
  __IO uint8_t enablestatus = 0;
  assert_param(IS_SPI_GET_IT(SPI_IT));
  itpos = (uint8_t)((uint8_t)1 << ((uint8_t)SPI_IT & (uint8_t)0x0F));
  itmask1 = (uint8_t)((uint8_t)SPI_IT >> (uint8_t)4);
  itmask2 = (uint8_t)((uint8_t)1 << itmask1);
  enablestatus = (uint8_t)((uint8_t)SPIx->SR & itmask2);
  if (((SPIx->CR3 & itpos) != RESET) && enablestatus)
  {
    pendingbitstatus = SET;
  }
  else
  {
    pendingbitstatus = RESET;
  }
  return  pendingbitstatus;
}