#ifndef __ACMP2_H
#define __ACMP2_H

void ACMP2_Open(unsigned char nPSEL, unsigned char nNSEL);
void ACMP2_Close(void);
void ACMP2_DebounceCount(unsigned char nDebounceCount);
unsigned char ACMP2_OutputStatus(void);
void ACMP2_EnableIE(unsigned char nIE_TYPE);
void ACMP2_DisableIE(void);
unsigned char ACMP2_OutputStatus(void);
void ACMP2_Set_Input(unsigned char Level);
#define d_ACMP1 0x00
#define d_ACMP2 0x01

#define d_ACMP0_P_CHANNEL_0 0x00
#define d_ACMP0_P_CHANNEL_1 0x01
#define d_ACMP0_P_CHANNEL_2 0x02

#define d_ACMP0_N_CHANNEL_0 0x00
#define d_ACMP0_N_CHANNEL_1 0x01



#define d_HYS_RANGE_0   0x00
#define d_HYS_RANGE_10  0x01
#define d_HYS_RANGE_20  0x02
#define d_HYS_RANGE_30  0x03
#define d_HYS_RANGE_40  0x04

#define d_ACMP_IE_TYPE_BOTH      0x00
#define d_ACMP_IE_TYPE_FALLING    0x01
#define d_ACMP_IE_TYPE_RISING     0x02

sbit PGA_P      = P2^5;
sbit PGA_N      = P2^4;
sbit CMP1_P0      = P0^7;
sbit CMP1_P1      = P1^0;
sbit CMP1_N0      = P1^1;

#endif
