#include "ys32md211.h"

#define AN_VDC_PIN                       GPIO_Pin_0  
#define AN_I_BUS_PIN                     GPIO_Pin_4  

//***********************************************************//
typedef struct {
	
	  uint32_t   i_bus_sum;
	  uint32_t   bat_sum;
	  uint8_t    ad_i_inc;
	  uint8_t    ad_bat_inc;
	  uint16_t   i_data;
	  uint16_t   bat_data;
	  uint16_t   over_i_inc;
	  uint16_t   over_vdd_inc;
	  uint16_t   low_vdd_inc;
	  uint16_t   vdd_sample_time;
	  uint16_t   V_ref_data;
	  uint16_t   Pot_data;
	  uint16_t   Pot_inc;
	  uint16_t   adc_start_inc;
	  uint16_t   adc_off_inc;
	  uint8_t    bat_flag;
  	uint16_t   REV_vdd_inc;

} AD;
 extern AD  AD_s;



void adc_data_process(void);
void adc_int(void);
void adc_config(void);
uint16_t  Adc_IPD_process(void);
void clr_pid_i(void);
void INT_REF_DATA(void);
void adc_pwm_process(void);
