2022-01-18 00:58:54 +08:00

86 lines
2.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*********************************************************************************************************************
* COPYRIGHT NOTICE
* Copyright (c) 2020,<2C><><EFBFBD>ɿƼ<C9BF>
* All rights reserved.
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQȺ<51><C8BA><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA>824575535
*
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD>У<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>;<EFBFBD><CDBE>
* <20><>ӭ<EFBFBD><D3AD>λʹ<CEBB>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EBB1A3><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC>İ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @file zf_vadc
* @company <09>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD>޹<EFBFBD>˾
* @author <09><><EFBFBD>ɿƼ<C9BF>(QQ3184284598)
* @version <09>鿴doc<6F><63>version<6F>ļ<EFBFBD> <20>汾˵<E6B1BE><CBB5>
* @Software ADS v1.2.2
* @Target core TC264D
* @Taobao https://seekfree.taobao.com/
* @date 2020-3-23
********************************************************************************************************************/
#ifndef _zf_vadc_h
#define _zf_vadc_h
#include "common.h"
//<2F><>ö<EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><E5B2BB><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>޸<EFBFBD>
typedef enum // ö<><C3B6>ADC<44><43><EFBFBD><EFBFBD>
{
ADC_0,
ADC_1,
ADC_2,
}VADCN_enum;
typedef enum // ö<><C3B6>ADCͨ<43><CDA8>
{
//ADC0<43><30>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
ADC0_CH0_A0 = 0*16 + 0,
ADC0_CH1_A1,
ADC0_CH2_A2,
ADC0_CH3_A3,
ADC0_CH4_A4,
ADC0_CH5_A5,
ADC0_CH6_A6,
ADC0_CH7_A7,
ADC0_CH8_A8,
ADC0_CH10_A10 = 0*16 + 10,
ADC0_CH11_A11,
ADC0_CH12_A12,
ADC0_CH13_A13,
//ADC1<43><31>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
ADC1_CH0_A16 = 1*16 + 0,
ADC1_CH1_A17 = 1*16 + 1,
ADC1_CH4_A20 = 1*16 + 4,
ADC1_CH5_A21 = 1*16 + 5,
ADC1_CH8_A24 = 1*16 + 8,
ADC1_CH9_A25 = 1*16 + 9,
//ADC2<43><32>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
ADC2_CH3_A35 = 2*16 + 3,
ADC2_CH4_A36,
ADC2_CH5_A37,
ADC2_CH6_A38,
ADC2_CH7_A39,
ADC2_CH10_A44 = 2*16 + 10,
ADC2_CH11_A45,
ADC2_CH12_A46,
ADC2_CH13_A47,
ADC2_CH14_A48,
ADC2_CH15_A49,
}VADC_CHN_enum;
//<2F><>ö<EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><E5B2BB><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>޸<EFBFBD>
typedef enum // ö<><C3B6>ADCͨ<43><CDA8>
{
ADC_8BIT, //8λ<38>ֱ<EFBFBD><D6B1><EFBFBD>
ADC_10BIT, //10λ<30>ֱ<EFBFBD><D6B1><EFBFBD>
ADC_12BIT, //12λ<32>ֱ<EFBFBD><D6B1><EFBFBD>
}VADC_RES_enum;
void adc_init(VADCN_enum vadc_n, VADC_CHN_enum vadc_chn);
uint16 adc_convert(VADCN_enum vadc_n, VADC_CHN_enum vadc_chn, VADC_RES_enum vadc_res);
uint16 adc_mean_filter(VADCN_enum vadc_n, VADC_CHN_enum vadc_chn, VADC_RES_enum vadc_res, uint8 count);
#endif