/* Return the output level (high or low) of the selected comparator.  */
uint8_t COMP_GetOutputLevel(uint32_t COMP_Selection)
/* Return the output level (high or low) of the selected comparator.  */
uint8_t COMP_GetOutputLevel(uint32_t COMP_Selection)
{
  uint8_t compout = 0x0;
  assert_param(IS_COMP_ALL_PERIPH(COMP_Selection));
  if(COMP_Selection == COMP_Selection_COMP1)
  {
    if((COMP->CSR & COMP_CSR_CMP1OUT) != (uint8_t) RESET)
    {
      compout = (uint8_t) COMP_OutputLevel_High;
    }
    else
    {
      compout = (uint8_t) COMP_OutputLevel_Low;
    }
  }
  else
  {
    if((COMP->CSR & COMP_CSR_CMP2OUT) != (uint8_t) RESET)
    {
      compout = (uint8_t) COMP_OutputLevel_High;
    }
    else
    {
      compout = (uint8_t) COMP_OutputLevel_Low;
    }
  }
  return (uint8_t)(compout);
}