/* Initializes the COMP2 peripheral according to the specified parameters in the COMP_InitStruct.  */
void COMP_Init(COMP_InitTypeDef *COMP_InitStruct)
/* Initializes the COMP2 peripheral according to the specified parameters in the COMP_InitStruct.  */
void COMP_Init(COMP_InitTypeDef *COMP_InitStruct)
{
  uint32_t tmpreg = 0;
  assert_param(IS_COMP_INVERTING_INPUT(COMP_InitStruct->COMP_InvertingInput));
  assert_param(IS_COMP_OUTPUT(COMP_InitStruct->COMP_OutputSelect));
  assert_param(IS_COMP_SPEED(COMP_InitStruct->COMP_Speed));
  tmpreg = COMP->CSR; 
  tmpreg &= (uint32_t) (~(uint32_t) (COMP_CSR_OUTSEL | COMP_CSR_INSEL | COMP_CSR_SPEED));  
  tmpreg |= (uint32_t)((COMP_InitStruct->COMP_Speed | COMP_InitStruct->COMP_InvertingInput 
                        | COMP_InitStruct->COMP_OutputSelect));
  COMP->CSR = tmpreg;  
}