8051-ELL库  beta 1.1.6
8051-ELL library API Document Center
STC8x_COMP.c 文件参考
#include "STC8x_COMP.h"
STC8x_COMP.c 的引用(Include)关系图:

宏定义

#define COMP_TRISTATE_SELECT(triMode)
 COMP选择触发模式宏函数,仅限本文件调用。 更多...
 
#define COMP_PEINPUT_SELECT(pePin)
 COMP选择正极输入脚宏函数,仅限本文件调用。 更多...
 
#define COMP_NEINPUT_SELECT(nePin)
 COMP选择负极输入脚宏函数,仅限本文件调用。 更多...
 

宏定义说明

◆ COMP_NEINPUT_SELECT

#define COMP_NEINPUT_SELECT (   nePin)
值:
do{ \
CMPCR1 = (CMPCR1 & 0xFB) | ((nePin & 0xF0) >> 2); \
}while(0)
sfr CMPCR1
Definition: STC15x_REG.h:743

COMP选择负极输入脚宏函数,仅限本文件调用。

Comp select negative input pin macro function, only this file call.

参数
[in]nePin负极输入引脚。Negative input pin.

◆ COMP_PEINPUT_SELECT

#define COMP_PEINPUT_SELECT (   pePin)
值:
do{ \
if(pePin == COMP_PE_P37) {CMPCR1 &= 0xF7;} \
else {CMPCR1 |= 0x08; \
ADC_CONTR = (ADC_CONTR & 0xF0)|(pePin)|0x80;} \
}while(0)
sfr ADC_CONTR
Definition: STC15x_REG.h:767
#define COMP_PE_P37
Definition: STC8x_COMP.h:92

COMP选择正极输入脚宏函数,仅限本文件调用。

Comp select positive input pin macro function, only this file call.

参数
[in]pePin正极输入引脚。Positive input pin.

◆ COMP_TRISTATE_SELECT

#define COMP_TRISTATE_SELECT (   triMode)
值:
do{ \
CMPCR1 = (CMPCR1 & 0xCF)|(triMode); \
}while(0)

COMP选择触发模式宏函数,仅限本文件调用。

Comp select trigger state macro function, only this file call.

参数
[in]triMode触发模式。 Mode of trigeer.