/* Configs the COMP peripheral according to the specified parameters in COMP_InitStruct.  */
void COMP_Config(COMP_SELECT_T compSelect, COMP_Config_T *compConfig)
/* Configs the COMP peripheral according to the specified parameters in COMP_InitStruct.  */
void COMP_Config(COMP_SELECT_T compSelect, COMP_Config_T *compConfig)
{
    if(compSelect == COMP_SELECT_COMP1)
    {
        COMP->CSTS_B.INVINSEL1 = compConfig->invertingInput;
        COMP->CSTS_B.OUTSEL1 = compConfig->output;
        COMP->CSTS_B.OPINV1 = compConfig->outputPol;
        COMP->CSTS_B.HYSCFG1    = compConfig->hysterrsis;
        COMP->CSTS_B.MOD1   = compConfig->mode;
    }
    else
    {
        COMP->CSTS_B.INVINSEL2= compConfig->invertingInput;
        COMP->CSTS_B.OUTSEL2  = compConfig->output;
        COMP->CSTS_B.OPINV2  = compConfig->outputPol;
        COMP->CSTS_B.HYSCFG2 = compConfig->hysterrsis;
        COMP->CSTS_B.MOD2= compConfig->mode;
    }
}