/*********************************************************************************************************************
* RT1064DVL6A Opensourec Library RT1064DVL6A Դ⣩һڹٷ SDK ӿڵĵԴ
* Copyright (c) 2022 SEEKFREE ɿƼ
* 
* ļ RT1064DVL6A Դһ
* 
* RT1064DVL6A Դ 
* Ըᷢ GPLGNU General Public License GNUͨù֤
*  GPL ĵ3棨 GPL3.0ѡģκκİ汾·/޸
* 
* Դķϣܷãδκεı֤
* ûԻʺض;ı֤
* ϸμ GPL
* 
* ӦյԴͬʱյһ GPL ĸ
* ûУ<https://www.gnu.org/licenses/>
* 
* ע
* Դʹ GPL3.0 Դ֤Э Ϊİ汾
* Ӣİ libraries/doc ļµ GPL3_permission_statement.txt ļ
* ֤ libraries ļ ļµ LICENSE ļ
* ӭλʹò ޸ʱ뱣ɿƼİȨ
* 
* ļ          zf_driver_adc
* ˾          ɶɿƼ޹˾
* 汾Ϣ          鿴 libraries/doc ļ version ļ 汾˵
*           IAR 8.32.4 or MDK 5.33
* ƽ̨          RT1064DVL6A
*           https://seekfree.taobao.com/
* 
* ޸ļ¼
*                               ע
* 2022-09-21        SeekFree            first version
********************************************************************************************************************/

#ifndef _zf_driver_adc_h_
#define _zf_driver_adc_h_

#include "zf_common_typedef.h"

typedef enum                                                                    // ö ADC ͨ  öٶ岻û޸
{
    ADC1_CH0_B27 = 1*16,    
    ADC1_CH1_B12,    
    ADC1_CH2_B13,    
    ADC1_CH3_B14,    
    ADC1_CH4_B15,    
    ADC1_CH5_B16,    
    ADC1_CH6_B17,    
    ADC1_CH7_B18,        
    ADC1_CH8_B19,        
    ADC1_CH9_B20,        
    ADC1_CH10_B21,       
    ADC1_CH11_B22,
    ADC1_CH12_B23,
    ADC1_CH13_B24,
    ADC1_CH14_B25,
    ADC1_CH15_B26,
    
    ADC2_CH0_B27,    
    ADC2_CH1_B28,    
    ADC2_CH2_B29,    
    ADC2_CH3_B30,    
    ADC2_CH4_B31,    
    ADC2_CH5_B16,    
    ADC2_CH6_B17,    
    ADC2_CH7_B18,        
    ADC2_CH8_B19,        
    ADC2_CH9_B20,        
    ADC2_CH10_B21,       
    ADC2_CH11_B22,
    ADC2_CH12_B23,
    ADC2_CH13_B24,
    ADC2_CH14_B25,
    ADC2_CH15_B26,
}adc_channel_enum;

typedef enum                                                                    // ö ADC ֱ   öٶ岻û޸
{
    ADC_8BIT,                                                                   // 8λֱ
    ADC_10BIT,                                                                  // 10λֱ
    ADC_12BIT,                                                                  // 12λֱ
}adc_resolution_enum;

uint16      adc_convert             (adc_channel_enum ch);
uint16      adc_mean_filter_convert (adc_channel_enum ch, const uint8 count);
void        adc_init                (adc_channel_enum ch, adc_resolution_enum resolution);

#endif
