/* Return the output level (high or low) of the selected comparator. The output level depends on the selected polarity. If the polarity is not inverted:  */
u32 COMP_GetOutputLevel(COMP_Selection_TypeDef selection)
/* Return the output level (high or low) of the selected comparator. The output level depends on the selected polarity. If the polarity is not inverted:  */
u32 COMP_GetOutputLevel(COMP_Selection_TypeDef selection)
{
    return (((*(vu32*)(COMP_BASE + selection) & COMP_CSR_STA) != 0) ?
            COMP_OutputLevel_High :
            COMP_OutputLevel_Low );
}