#define   COMP_EN                       (1)
#define   COMP_PA3                       (2<<7)
#define   POLARI_TY                      (0<<15)
#define   NPOLARI_TY                     (1<<15)
#define   COM_HYST                       (0<<19)
#define   COM_LOCK                       (1<<31)
#define   COM_DEG                        (3<<8)

#define   COMP_PA2                       (0<<5)
#define   COMU_SET                       (COMP_EN|COMP_PA2|COMP_PA3)//|COM_HYST)//|COM_LOCK)

#define   COMP_PA5                       (1<<3)
#define   COMW_SET                       (COMP_EN|COMP_PA5|COMP_PA3)//|COM_HYST)//|COM_LOCK)

#define   COMP_PA4                       (1<<2)
#define   COMV_SET                       (COMP_EN|COMP_PA4|COMP_PA3)//|COM_HYST)//|COM_LOCK)

#define U_RISING	{COMP2->CSR=0;COMP2->CSR=(COMU_SET |  NPOLARI_TY );}
#define U_FALLING	{COMP2->CSR=0;COMP2->CSR=(COMU_SET |  POLARI_TY   );}
#define V_RISING	{COMP2->CSR=0;COMP2->CSR=(COMV_SET |  NPOLARI_TY);}
#define V_FALLING	{COMP2->CSR=0;COMP2->CSR=(COMV_SET |  POLARI_TY  );}
#define W_RISING	{COMP2->CSR=0;COMP2->CSR=(COMW_SET | NPOLARI_TY);}
#define W_FALLING	{COMP2->CSR=0;COMP2->CSR=(COMW_SET | POLARI_TY  );}

void COMP_Config(void);
void TIMER_Initializes(void);

