结构体 | |
struct | ADC_InitType |
ADC初始化结构体句柄,初始化时请定义该句柄,并用其地址来传参。 更多... | |
枚举 | |
enum | ADCAcc_Type { ADC_Acc_12Bits = 0x00 , ADC_Acc_11Bits = 0x01 , ADC_Acc_10Bits = 0x02 , ADC_Acc_9Bits = 0x03 , ADC_Acc_8Bits = 0x04 } |
ADC采集精度枚举体。 更多... | |
enum | ADCAlign_Type { ADC_Left = 0x00 , ADC_Right = 0x01 } |
ADC输出结果对齐方向枚举体。 更多... | |
函数 | |
FSCSTATE | ADC_Init (const ADC_InitType *adcx) |
ADC外设初始化函数。 更多... | |
uint16_t | ADC_Get_Sample (uint8_t channel, ADCAcc_Type acc) |
ADC获取采集结果函数(查询法)。 更多... | |
uint16_t | ADC_Get_Sample_Interrupt (ADCAcc_Type acc) |
ADC获取采集结果函数(中断法)。 更多... | |
FSCSTATE | NVIC_ADC_Init (NVICPri_Type pri, BOOL run) |
ADC中断初始化函数。 更多... | |
#define ADC_CHANGE_CHANNEL | ( | channel | ) |
ADC改变采集通道宏函数。
ADC change the macro function of the current acquisition channel.
[in] | channel | ADC采集通道,不同的芯片型号,通道有所不同,请查看头文件的宏定义。 ADC acquisition channel, different chip models, the channel is different, please check the macro definition of the header file |
#define ADC_Channel_P00_8Ax 0x08 |
STC8A: ADC通道8。ADC channel 8.
#define ADC_Channel_P00_8G2K64S2_S4 0x08 |
8G2K64: ADC通道8。ADC channel 8.
#define ADC_Channel_P00_8H1K28 0x08 |
8H1K28: ADC通道8。ADC channel 8.
#define ADC_Channel_P00_8H3K64S2_S4 0x08 |
8H3K64: ADC通道8。ADC channel 8.
#define ADC_Channel_P00_8H8K64U_2K64T 0x08 |
8H8K/2K: ADC通道8。ADC channel 8.
#define ADC_Channel_P01_8Ax 0x09 |
STC8A: ADC通道9。ADC channel 9.
#define ADC_Channel_P01_8G2K64S2_S4 0x09 |
8G2K64: ADC通道9。ADC channel 9.
#define ADC_Channel_P01_8H1K28 0x09 |
8H1K28: ADC通道9。ADC channel 9.
#define ADC_Channel_P01_8H3K64S2_S4 0x09 |
8H3K64: ADC通道9。ADC channel 9.
#define ADC_Channel_P01_8H8K64U_2K64T 0x09 |
8H8K/2K: ADC通道9。ADC channel 9.
#define ADC_Channel_P02_8Ax 0x0A |
STC8A: ADC通道10。ADC channel 10.
#define ADC_Channel_P02_8G2K64S2_S4 0x0A |
8G2K64: ADC通道10。ADC channel 10.
#define ADC_Channel_P02_8H1K28 0x0A |
8H1K28: ADC通道10。ADC channel 10.
#define ADC_Channel_P02_8H3K64S2_S4 0x0A |
8H3K64: ADC通道10。ADC channel 10.
#define ADC_Channel_P02_8H8K64U_2K64T 0x0A |
8H8K/2K: ADC通道10。ADC channel 10.
#define ADC_Channel_P03_8Ax 0x0B |
STC8A: ADC通道11。ADC channel 11.
#define ADC_Channel_P03_8G2K64S2_S4 0x0B |
8G2K64: ADC通道11。ADC channel 11.
#define ADC_Channel_P03_8H1K28 0x0B |
8H1K28: ADC通道11。ADC channel 11.
#define ADC_Channel_P03_8H3K64S2_S4 0x0B |
8H3K64: ADC通道11。ADC channel 11.
#define ADC_Channel_P03_8H8K64U_2K64T 0x0B |
8H8K/2K: ADC通道11。ADC channel 11.
#define ADC_Channel_P04_8Ax 0x0C |
STC8A: ADC通道12。ADC channel 12.
#define ADC_Channel_P04_8G2K64S2_S4 0x0C |
8G2K64: ADC通道12。ADC channel 12.
#define ADC_Channel_P04_8H3K64S2_S4 0x0C |
8H3K64: ADC通道12。ADC channel 12.
#define ADC_Channel_P04_8H8K64U_2K64T 0x0C |
8H8K/2K: ADC通道12。ADC channel 12.
#define ADC_Channel_P05_8Ax 0x0D |
STC8A: ADC通道13。ADC channel 13.
#define ADC_Channel_P05_8G2K64S2_S4 0x0D |
8G2K64: ADC通道13。ADC channel 13.
#define ADC_Channel_P05_8H3K64S2_S4 0x0D |
8H3K64: ADC通道13。ADC channel 13.
#define ADC_Channel_P05_8H8K64U_2K64T 0x0D |
8H8K/2K: ADC通道13。ADC channel 13.
#define ADC_Channel_P06_8Ax 0x0E |
STC8A: ADC通道14。ADC channel 14.
#define ADC_Channel_P06_8G2K64S2_S4 0x0E |
8G2K64: ADC通道14。ADC channel 14.
#define ADC_Channel_P06_8H3K64S2_S4 0x0E |
8H3K64: ADC通道14。ADC channel 14.
#define ADC_Channel_P06_8H8K64U_2K64T 0x0E |
8H8K/2K: ADC通道14。ADC channel 14.
#define ADC_Channel_P10_8Ax 0x00 |
STC8A: ADC通道0。ADC channel 0.
#define ADC_Channel_P10_8G1K08_T 0x00 |
8G1K08: ADC通道0。ADC channel 0.
#define ADC_Channel_P10_8G2K64S2_S4 0x00 |
8G2K64: ADC通道0。ADC channel 0.
#define ADC_Channel_P10_8H1K08 0x00 |
8H1K28: ADC通道0。ADC channel 0.
#define ADC_Channel_P10_8H1K28 0x00 |
8H1K28: ADC通道0。ADC channel 0.
#define ADC_Channel_P10_8H3K64S2_S4 0x00 |
8H3K64: ADC通道0。ADC channel 0.
#define ADC_Channel_P10_8H8K64U_2K64T 0x00 |
8H8K/2K: ADC通道0。ADC channel 0.
#define ADC_Channel_P11_8Ax 0x01 |
STC8A: ADC通道1。ADC channel 1.
#define ADC_Channel_P11_8G1K08_T 0x01 |
8G1K08: ADC通道1。ADC channel 1.
#define ADC_Channel_P11_8G2K64S2_S4 0x01 |
8G2K64: ADC通道1。ADC channel 1.
#define ADC_Channel_P11_8H1K08 0x01 |
8H1K28: ADC通道1。ADC channel 1.
#define ADC_Channel_P11_8H1K28 0x01 |
8H1K28: ADC通道1。ADC channel 1.
#define ADC_Channel_P11_8H3K64S2_S4 0x01 |
8H3K64: ADC通道1。ADC channel 1.
#define ADC_Channel_P11_8H8K64U_2K64T 0x01 |
8H8K/2K: ADC通道1。ADC channel 1.
#define ADC_Channel_P12_8Ax 0x02 |
STC8A: ADC通道2。ADC channel 2.
#define ADC_Channel_P12_8G1K08_T 0x02 |
8G1K08: ADC通道2。ADC channel 2.
#define ADC_Channel_P12_8G2K64S2_S4 0x02 |
8G2K64: ADC通道2。ADC channel 2.
#define ADC_Channel_P12_8H1K28 0x02 |
8H1K28: ADC通道2。ADC channel 2.
#define ADC_Channel_P12_8H3K64S2_S4 0x02 |
8H3K64: ADC通道2。ADC channel 2.
#define ADC_Channel_P13_8Ax 0x03 |
STC8A: ADC通道3。ADC channel 3.
#define ADC_Channel_P13_8G1K08_T 0x03 |
8G1K08: ADC通道3。ADC channel 3.
#define ADC_Channel_P13_8G2K64S2_S4 0x03 |
8G2K64: ADC通道3。ADC channel 3.
#define ADC_Channel_P13_8H1K28 0x03 |
8H1K28: ADC通道3。ADC channel 3.
#define ADC_Channel_P13_8H8K64U_2K64T 0x03 |
8H8K/2K: ADC通道3。ADC channel 3.
#define ADC_Channel_P14_8Ax 0x04 |
STC8A: ADC通道4。ADC channel 4.
#define ADC_Channel_P14_8G1K08_T 0x04 |
8G1K08: ADC通道4。ADC channel 4.
#define ADC_Channel_P14_8G2K64S2_S4 0x04 |
8G2K64: ADC通道4。ADC channel 4.
#define ADC_Channel_P14_8H1K28 0x04 |
8H1K28: ADC通道4。ADC channel 4.
#define ADC_Channel_P14_8H8K64U_2K64T 0x04 |
8H8K/2K: ADC通道4。ADC channel 4.
#define ADC_Channel_P15_8Ax 0x05 |
STC8A: ADC通道5。ADC channel 5.
#define ADC_Channel_P15_8G1K08_T 0x05 |
8G1K08: ADC通道5。ADC channel 5.
#define ADC_Channel_P15_8G2K64S2_S4 0x05 |
8G2K64: ADC通道5。ADC channel 5.
#define ADC_Channel_P15_8H1K28 0x05 |
8H1K28: ADC通道5。ADC channel 5.
#define ADC_Channel_P15_8H8K64U_2K64T 0x05 |
8H8K/2K: ADC通道5。ADC channel 5.
#define ADC_Channel_P16_8Ax 0x06 |
STC8A: ADC通道6。ADC channel 6.
#define ADC_Channel_P16_8G1K08_T 0x06 |
8G1K08: ADC通道6。ADC channel 6.
#define ADC_Channel_P16_8G2K64S2_S4 0x06 |
8G2K64: ADC通道6。ADC channel 6.
#define ADC_Channel_P16_8H1K28 0x06 |
8H1K28: ADC通道6。ADC channel 6.
#define ADC_Channel_P16_8H3K64S2_S4 0x06 |
8H3K64: ADC通道6。ADC channel 6.
#define ADC_Channel_P16_8H8K64U_2K64T 0x06 |
8H8K/2K: ADC通道6。ADC channel 6.
#define ADC_Channel_P17_8Ax 0x07 |
STC8A: ADC通道7。ADC channel 7.
#define ADC_Channel_P17_8G1K08_T 0x07 |
8G1K08: ADC通道7。ADC channel 7.
#define ADC_Channel_P17_8G2K64S2_S4 0x07 |
8G2K64: ADC通道7。ADC channel 7.
#define ADC_Channel_P17_8H1K28 0x07 |
8H1K28: ADC通道7。ADC channel 7.
#define ADC_Channel_P17_8H3K64S2_S4 0x07 |
8H3K64: ADC通道7。ADC channel 7.
#define ADC_Channel_P17_8H8K64U_2K64T 0x07 |
8H8K/2K: ADC通道7。ADC channel 7.
#define ADC_Channel_P30_8G1K08_T 0x08 |
8G1K08: ADC通道8。ADC channel 8.
#define ADC_Channel_P30_8G1K08A 0x00 |
8G1K08A: ADC通道0。ADC channel 0.
#define ADC_Channel_P30_8H1K08 0x08 |
8H1K28: ADC通道8。ADC channel 8.
#define ADC_Channel_P31_8G1K08_T 0x09 |
8G1K08: ADC通道9。ADC channel 9.
#define ADC_Channel_P31_8G1K08A 0x01 |
8G1K08A: ADC通道1。ADC channel 1.
#define ADC_Channel_P31_8H1K08 0x09 |
8H1K28: ADC通道9。ADC channel 9.
#define ADC_Channel_P32_8G1K08_T 0x0A |
8G1K08: ADC通道10。ADC channel 10.
#define ADC_Channel_P32_8G1K08A 0x02 |
8G1K08A: ADC通道2。ADC channel 2.
#define ADC_Channel_P32_8H1K08 0x0A |
8H1K28: ADC通道10。ADC channel 10.
#define ADC_Channel_P33_8G1K08_T 0x0B |
8G1K08: ADC通道11。ADC channel 11.
#define ADC_Channel_P33_8G1K08A 0x03 |
8G1K08A: ADC通道3。ADC channel 3.
#define ADC_Channel_P33_8H1K08 0x0B |
8H1K28: ADC通道11。ADC channel 11.
#define ADC_Channel_P34_8G1K08_T 0x0C |
8G1K08: ADC通道12。ADC channel 12.
#define ADC_Channel_P34_8H1K08 0x0C |
8H1K28: ADC通道12。ADC channel 12.
#define ADC_Channel_P35_8G1K08_T 0x0D |
8G1K08: ADC通道13。ADC channel 13.
#define ADC_Channel_P35_8H1K08 0x0D |
8H1K28: ADC通道13。ADC channel 13.
#define ADC_Channel_P36_8G1K08_T 0x0E |
8G1K08: ADC通道14。ADC channel 14.
#define ADC_Channel_P36_8H1K08 0x0E |
8H1K28: ADC通道14。ADC channel 14.
#define ADC_Channel_P54_8G1K08A 0x04 |
8G1K08A: ADC通道4。ADC channel 4.
#define ADC_Channel_P54_8H8K64U_2K64T 0x02 |
8H8K/2K: ADC通道2。ADC channel 2.
#define ADC_Channel_P55_8G1K08A 0x05 |
8G1K08A: ADC通道5。ADC channel 5.
#define ADC_Channel_REV 0x0F |
ADC通道15,测量内部参考电压。ADC channel 15 is internal refv voltage.
#define ADC_CLEAR_FLAG | ( | ) | do{ADC_CONTR &= 0xDF;}while(0) |
ADC清除采集完成(中断)标志位宏函数。
ADC clears macro function of acquisition completion (interrupt) flag bit.
#define ADC_GET_CHANNEL | ( | ) | (ADC_CONTR & 0x0F) |
ADC获取当前采集通道宏函数。
ADC obtains the macro function of the current acquisition channel.
#define ADC_GET_FLAG | ( | ) | (ADC_CONTR & 0x20) |
ADC获取采集完成(中断)标志位宏函数。
ADC obtains macro function of acquisition completion (interrupt) flag bit.
#define NVIC_ADC_CTRL | ( | run | ) | do{EADC = run;}while(0) |
ADC中断开关控制宏函数。
ADC interrupt switch control macro function.
[in] | run | 使能控制位。Enable control bit. |
#define NVIC_ADC_PRI | ( | pri | ) |
#define PER_LIB_ADC_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_ADC_INIT_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_ADC_NVIC_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_ADC_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 ADCAcc_Type |
ADC采集精度枚举体。
This is the ADC acquisition accuracy enumeration.
enum ADCAlign_Type |
uint16_t ADC_Get_Sample | ( | uint8_t | channel, |
ADCAcc_Type | acc | ||
) |
ADC获取采集结果函数(查询法)。
This is a ADC get sample function.
[in] | channel | ADC采集通道,不同的芯片型号,通道有所不同,请查看头文件的宏定义。 ADC acquisition accuracy, different chip models, the highest accuracy is different, please check the macro definition of the header file. |
[in] | acc | ADC采集精度,不同的芯片型号,最高精度有所不同,请查看头文件的宏定义。 ADC acquisition accuracy, different chip models, the highest accuracy is different, please check the macro definition of the header file. |
uint16_t ADC_Get_Sample_Interrupt | ( | ADCAcc_Type | acc | ) |
ADC获取采集结果函数(中断法)。
This is a ADC get sample function in interrupt.
[in] | acc | ADC采集精度,不同的芯片型号,最高精度有所不同,请查看头文件的宏定义。 ADC acquisition accuracy, different chip models, the highest accuracy is different, please check the macro definition of the header file. |
FSCSTATE ADC_Init | ( | const ADC_InitType * | adcx | ) |
ADC外设初始化函数。
This is a ADC peripheral init function.
[in] | adcx | ADC结构体句柄,初始化时请定义该句柄,并用其地址来传参。 ADC structure handle. When initializing, please define the handle and use its address to pass parameters. |
FSCSTATE NVIC_ADC_Init | ( | NVICPri_Type | pri, |
BOOL | run | ||
) |
ADC中断初始化函数。
This is a ADC priority initialization function.
[in] | pri | 中断优先级。Interrupt priority. |
[in] | run | 中断运行控制位。Interrupt operation control bit. |