结构体 | |
struct | COMP_InitType |
COMP初始化结构体句柄,初始化时请定义该句柄,并用其地址来传参。 更多... | |
枚举 | |
enum | COMPDIRPut_Type { COMP_DIR_Forward = 0x00 , COMP_DIR_Reverse = 0x01 } |
COMP输出方向枚举体。 更多... | |
enum | COMPTri_Type { COMP_Tri_Null = 0x00 , COMP_Tri_Falling = 0x10 , COMP_Tri_Rising = 0x20 , COMP_Tri_Edge = 0x30 } |
COMP中断触发方式枚举体。 更多... | |
函数 | |
FSCSTATE | COMP_Init (const COMP_InitType *compx) |
COMP初始化函数。 更多... | |
FSCSTATE | NVIC_COMP_Init (NVICPri_Type pri, COMPTri_Type triMode) |
COMP中断初始化函数。 更多... | |
FSCSTATE | GPIO_COMP_SWPort (GPIOSWPort_Type port) |
COMP切换复用IO函数。 更多... | |
#define COMP_CLEAR_FLAG | ( | ) | do{CMPCR1 &= 0xBF;}while(0) |
COMP清除比较完成(也是中断)标志位宏函数。
Comp clears compare complete (interrupt) flag bit macro function.
#define COMP_GET_FLAG | ( | ) | (CMPCR1 & 0x40) |
获取比较完成(也是中断)标志位宏函数。
Comp gets compare complete (interrupt) flag bit macro function.
#define COMP_GET_RESULT | ( | ) | (CMPCR1 & 0x01) |
COMP获取比较结果宏函数。
Comp gets the macro function of the comparison result.
#define COMP_IN_REV 0x0F |
正极和负极都可以接入,内部测试电压。NEPin and PEPin : Test the internal 1.344v refv voltage.
#define COMP_NE_P36 0x10 |
比较器负极。NEPin.
#define COMP_NVIC_PRI | ( | pri | ) |
#define COMP_PE_P00_8Ax 0x08 |
STC8A: 比较器正极复用ADC通道8。ADC channel 8.
#define COMP_PE_P00_8G2K64S2_S4 0x08 |
8G2K64: 比较器正极复用ADC通道8。ADC channel 8.
#define COMP_PE_P00_8H1K28 0x08 |
8H1K28: 比较器正极复用ADC通道8。ADC channel 8.
#define COMP_PE_P00_8H3K64S2_S4 0x08 |
8H3K64: 比较器正极复用ADC通道8。ADC channel 8.
#define COMP_PE_P00_8H8K64U_2K64T 0x08 |
8H8K/2K: 比较器正极复用ADC通道8。ADC channel 8.
#define COMP_PE_P01_8Ax 0x09 |
STC8A: 比较器正极复用ADC通道9。ADC channel 9.
#define COMP_PE_P01_8G2K64S2_S4 0x09 |
8G2K64: 比较器正极复用ADC通道9。ADC channel 9.
#define COMP_PE_P01_8H1K28 0x09 |
8H1K28: 比较器正极复用ADC通道9。ADC channel 9.
#define COMP_PE_P01_8H3K64S2_S4 0x09 |
8H3K64: 比较器正极复用ADC通道9。ADC channel 9.
#define COMP_PE_P01_8H8K64U_2K64T 0x09 |
8H8K/2K: 比较器正极复用ADC通道9。ADC channel 9.
#define COMP_PE_P02_8Ax 0x0A |
STC8A: 比较器正极复用ADC通道10。ADC channel 10.
#define COMP_PE_P02_8G2K64S2_S4 0x0A |
8G2K64: 比较器正极复用ADC通道10。ADC channel 10.
#define COMP_PE_P02_8H1K28 0x0A |
8H1K28: 比较器正极复用ADC通道10。ADC channel 10.
#define COMP_PE_P02_8H3K64S2_S4 0x0A |
8H3K64: 比较器正极复用ADC通道10。ADC channel 10.
#define COMP_PE_P02_8H8K64U_2K64T 0x0A |
8H8K/2K: 比较器正极复用ADC通道10。ADC channel 10.
#define COMP_PE_P03_8Ax 0x0B |
STC8A: 比较器正极复用ADC通道11。ADC channel 11.
#define COMP_PE_P03_8G2K64S2_S4 0x0B |
8G2K64: 比较器正极复用ADC通道11。ADC channel 11.
#define COMP_PE_P03_8H1K28 0x0B |
8H1K28: 比较器正极复用ADC通道11。ADC channel 11.
#define COMP_PE_P03_8H3K64S2_S4 0x0B |
8H3K64: 比较器正极复用ADC通道11。ADC channel 11.
#define COMP_PE_P03_8H8K64U_2K64T 0x0B |
8H8K/2K: 比较器正极复用ADC通道11。ADC channel 11.
#define COMP_PE_P04_8Ax 0x0C |
STC8A: 比较器正极复用ADC通道12。ADC channel 12.
#define COMP_PE_P04_8G2K64S2_S4 0x0C |
8G2K64: 比较器正极复用ADC通道12。ADC channel 12.
#define COMP_PE_P04_8H3K64S2_S4 0x0C |
8H3K64: 比较器正极复用ADC通道12。ADC channel 12.
#define COMP_PE_P04_8H8K64U_2K64T 0x0C |
8H8K/2K: 比较器正极复用ADC通道12。ADC channel 12.
#define COMP_PE_P05_8Ax 0x0D |
STC8A: 比较器正极复用ADC通道13。ADC channel 13.
#define COMP_PE_P05_8G2K64S2_S4 0x0D |
8G2K64: 比较器正极复用ADC通道13。ADC channel 13.
#define COMP_PE_P05_8H3K64S2_S4 0x0D |
8H3K64: 比较器正极复用ADC通道13。ADC channel 13.
#define COMP_PE_P05_8H8K64U_2K64T 0x0D |
8H8K/2K: 比较器正极复用ADC通道13。ADC channel 13.
#define COMP_PE_P06_8Ax 0x0E |
STC8A: 比较器正极复用ADC通道14。ADC channel 14.
#define COMP_PE_P06_8G2K64S2_S4 0x0E |
8G2K64: 比较器正极复用ADC通道14。ADC channel 14.
#define COMP_PE_P06_8H3K64S2_S4 0x0E |
8H3K64: 比较器正极复用ADC通道14。ADC channel 14.
#define COMP_PE_P06_8H8K64U_2K64T 0x0E |
8H8K/2K: 比较器正极复用ADC通道14。ADC channel 14.
#define COMP_PE_P10_8Ax 0x00 |
STC8A: 比较器正极复用ADC通道0。ADC channel 0.
#define COMP_PE_P10_8G1K08_T 0x00 |
8G1K08: 比较器正极复用ADC通道0。ADC channel 0.
#define COMP_PE_P10_8G2K64S2_S4 0x00 |
8G2K64: 比较器正极复用ADC通道0。ADC channel 0.
#define COMP_PE_P10_8H1K08 0x00 |
8H1K28: 比较器正极复用ADC通道0。ADC channel 0.
#define COMP_PE_P10_8H1K28 0x00 |
8H1K28: 比较器正极复用ADC通道0。ADC channel 0.
#define COMP_PE_P10_8H3K64S2_S4 0x00 |
8H3K64: 比较器正极复用ADC通道0。ADC channel 0.
#define COMP_PE_P10_8H8K64U_2K64T 0x00 |
8H8K/2K: 比较器正极复用ADC通道0。ADC channel 0.
#define COMP_PE_P11_8Ax 0x01 |
STC8A: 比较器正极复用ADC通道1。ADC channel 1.
#define COMP_PE_P11_8G1K08_T 0x01 |
8G1K08: 比较器正极复用ADC通道1。ADC channel 1.
#define COMP_PE_P11_8G2K64S2_S4 0x01 |
8G2K64: 比较器正极复用ADC通道1。ADC channel 1.
#define COMP_PE_P11_8H1K08 0x01 |
8H1K28: 比较器正极复用ADC通道1。ADC channel 1.
#define COMP_PE_P11_8H1K28 0x01 |
8H1K28: 比较器正极复用ADC通道1。ADC channel 1.
#define COMP_PE_P11_8H3K64S2_S4 0x01 |
8H3K64: 比较器正极复用ADC通道1。ADC channel 1.
#define COMP_PE_P11_8H8K64U_2K64T 0x01 |
8H8K/2K: 比较器正极复用ADC通道1。ADC channel 1.
#define COMP_PE_P12_8Ax 0x02 |
STC8A: 比较器正极复用ADC通道2。ADC channel 2.
#define COMP_PE_P12_8G1K08_T 0x02 |
8G1K08: 比较器正极复用ADC通道2。ADC channel 2.
#define COMP_PE_P12_8G2K64S2_S4 0x02 |
8G2K64: 比较器正极复用ADC通道2。ADC channel 2.
#define COMP_PE_P12_8H1K28 0x02 |
8H1K28: 比较器正极复用ADC通道2。ADC channel 2.
#define COMP_PE_P12_8H3K64S2_S4 0x02 |
8H3K64: 比较器正极复用ADC通道2。ADC channel 2.
#define COMP_PE_P13_8Ax 0x03 |
STC8A: 比较器正极复用ADC通道3。ADC channel 3.
#define COMP_PE_P13_8G1K08_T 0x03 |
8G1K08: 比较器正极复用ADC通道3。ADC channel 3.
#define COMP_PE_P13_8G2K64S2_S4 0x03 |
8G2K64: 比较器正极复用ADC通道3。ADC channel 3.
#define COMP_PE_P13_8H1K28 0x03 |
8H1K28: 比较器正极复用ADC通道3。ADC channel 3.
#define COMP_PE_P13_8H8K64U_2K64T 0x03 |
8H8K/2K: 比较器正极复用ADC通道3。ADC channel 3.
#define COMP_PE_P14_8Ax 0x04 |
STC8A: 比较器正极复用ADC通道4。ADC channel 4.
#define COMP_PE_P14_8G1K08_T 0x04 |
8G1K08: 比较器正极复用ADC通道4。ADC channel 4.
#define COMP_PE_P14_8G2K64S2_S4 0x04 |
8G2K64: 比较器正极复用ADC通道4。ADC channel 4.
#define COMP_PE_P14_8H1K28 0x04 |
8H1K28: 比较器正极复用ADC通道4。ADC channel 4.
#define COMP_PE_P14_8H8K64U_2K64T 0x04 |
8H8K/2K: 比较器正极复用ADC通道4。ADC channel 4.
#define COMP_PE_P15_8Ax 0x05 |
STC8A: 比较器正极复用ADC通道5。ADC channel 5.
#define COMP_PE_P15_8G1K08_T 0x05 |
8G1K08: 比较器正极复用ADC通道5。ADC channel 5.
#define COMP_PE_P15_8G2K64S2_S4 0x05 |
8G2K64: 比较器正极复用ADC通道5。ADC channel 5.
#define COMP_PE_P15_8H1K28 0x05 |
8H1K28: 比较器正极复用ADC通道5。ADC channel 5.
#define COMP_PE_P15_8H8K64U_2K64T 0x05 |
8H8K/2K: 比较器正极复用ADC通道5。ADC channel 5.
#define COMP_PE_P16_8Ax 0x06 |
STC8A: 比较器正极复用ADC通道6。ADC channel 6.
#define COMP_PE_P16_8G1K08_T 0x06 |
8G1K08: 比较器正极复用ADC通道6。ADC channel 6.
#define COMP_PE_P16_8G2K64S2_S4 0x06 |
8G2K64: 比较器正极复用ADC通道6。ADC channel 6.
#define COMP_PE_P16_8H1K28 0x06 |
8H1K28: 比较器正极复用ADC通道6。ADC channel 6.
#define COMP_PE_P16_8H3K64S2_S4 0x06 |
8H3K64: 比较器正极复用ADC通道6。ADC channel 6.
#define COMP_PE_P16_8H8K64U_2K64T 0x06 |
8H8K/2K: 比较器正极复用ADC通道6。ADC channel 6.
#define COMP_PE_P17_8Ax 0x07 |
STC8A: 比较器正极复用ADC通道7。ADC channel 7.
#define COMP_PE_P17_8G1K08_T 0x07 |
8G1K08: 比较器正极复用ADC通道7。ADC channel 7.
#define COMP_PE_P17_8G2K64S2_S4 0x07 |
8G2K64: 比较器正极复用ADC通道7。ADC channel 7.
#define COMP_PE_P17_8H1K28 0x07 |
8H1K28: 比较器正极复用ADC通道7。ADC channel 7.
#define COMP_PE_P17_8H3K64S2_S4 0x07 |
8H3K64: 比较器正极复用ADC通道7。ADC channel 7.
#define COMP_PE_P17_8H8K64U_2K64T 0x07 |
8H8K/2K: 比较器正极复用ADC通道7。ADC channel 7.
#define COMP_PE_P30_8G1K08_T 0x08 |
8G1K08: 比较器正极复用ADC通道8。ADC channel 8.
#define COMP_PE_P30_8G1K08A 0x00 |
8G1K08A: 比较器正极复用ADC通道0。ADC channel 0.
#define COMP_PE_P30_8H1K08 0x08 |
8H1K28: 比较器正极复用ADC通道8。ADC channel 8.
#define COMP_PE_P31_8G1K08_T 0x09 |
8G1K08: 比较器正极复用ADC通道9。ADC channel 9.
#define COMP_PE_P31_8G1K08A 0x01 |
8G1K08A: 比较器正极复用ADC通道1。ADC channel 1.
#define COMP_PE_P31_8H1K08 0x09 |
8H1K28: 比较器正极复用ADC通道9。ADC channel 9.
#define COMP_PE_P32_8G1K08_T 0x0A |
8G1K08: 比较器正极复用ADC通道10。ADC channel 10.
#define COMP_PE_P32_8G1K08A 0x02 |
8G1K08A: 比较器正极复用ADC通道2。ADC channel 2.
#define COMP_PE_P32_8H1K08 0x0A |
8H1K28: 比较器正极复用ADC通道10。ADC channel 10.
#define COMP_PE_P33_8G1K08_T 0x0B |
8G1K08: 比较器正极复用ADC通道11。ADC channel 11.
#define COMP_PE_P33_8G1K08A 0x03 |
8G1K08A: 比较器正极复用ADC通道3。ADC channel 3.
#define COMP_PE_P33_8H1K08 0x0B |
8H1K28: 比较器正极复用ADC通道11。ADC channel 11.
#define COMP_PE_P34_8G1K08_T 0x0C |
8G1K08: 比较器正极复用ADC通道12。ADC channel 12.
#define COMP_PE_P34_8H1K08 0x0C |
8H1K28: 比较器正极复用ADC通道12。ADC channel 12.
#define COMP_PE_P35_8G1K08_T 0x0D |
8G1K08: 比较器正极复用ADC通道13。ADC channel 13.
#define COMP_PE_P35_8H1K08 0x0D |
8H1K28: 比较器正极复用ADC通道13。ADC channel 13.
#define COMP_PE_P36_8G1K08_T 0x0E |
8G1K08: 比较器正极复用ADC通道14。ADC channel 14.
#define COMP_PE_P36_8H1K08 0x0E |
8H1K28: 比较器正极复用ADC通道14。ADC channel 14.
#define COMP_PE_P37 0xF7 |
#define COMP_PE_P54_8G1K08A 0x04 |
8G1K08A: 比较器正极复用ADC通道4。ADC channel 4.
#define COMP_PE_P54_8H8K64U_2K64T 0x02 |
8H8K/2K: 比较器正极复用ADC通道2。ADC channel 2.
#define COMP_PE_P55_8G1K08A 0x05 |
8G1K08A: 比较器正极复用ADC通道5。ADC channel 5.
COMP中断开关控制宏函数。
COMP interrupt switch control macro function.
[in] | run | 使能控制位。Enable control bit. |
#define PER_LIB_COMP_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_COMP_INIT_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_COMP_NVIC_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_COMP_WORK_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_MCU_MUODEL STC8Ax |
如果没有定义这个宏,默认为STC8Ax。 If the mirco is undefined,select to STC8Ax
enum COMPDIRPut_Type |
COMP输出方向枚举体。
COMP output direction enumerator.
enum COMPTri_Type |
COMP中断触发方式枚举体。
COMP interrupt Trigger enumerator.
FSCSTATE COMP_Init | ( | const COMP_InitType * | compx | ) |
COMP初始化函数。
COMP initialization function.
[in] | compx | COMP结构体句柄,初始化时请定义该句柄,并用其地址来传参。 COMP structure handle. When initializing, please define the handle and use its address to pass parameters. |
FSCSTATE GPIO_COMP_SWPort | ( | GPIOSWPort_Type | port | ) |
COMP切换复用IO函数。
COMP switch out port control function.
port | [IN] 复用IO枚举体。IO switch enumerator. |
FSCSTATE NVIC_COMP_Init | ( | NVICPri_Type | pri, |
COMPTri_Type | triMode | ||
) |
COMP中断初始化函数。
COMP interrupt initialization function.
[in] | pri | 中断优先级。Interrupt priority. |
[in] | triMode | 触发模式。Trigger mode. |