/* ****************************************************************************** * * @file adc.h * @brief adc module * @ic sy8835 * * @version 1.0 * @date 2024/11/01 09:59:40 * @author Alex Xu * * Copyright (c) 2013-2099,Tkplusemi Technology Co.,Ltd. * All Rights Reserved * * History: * Revision Date Author Desc * 1.0.0 2024/11/01 Alex build this file ****************************************************************************** */ #ifndef __ADC_H__ #define __ADC_H__ /*_____ I N C L U D E S ____________________________________________________*/ #include "define.h" #if ADC_ENABLE /******************************************************************************\ Macro definitions \******************************************************************************/ #define VREF 1000 /******************************************************************************\ Variables definitions \******************************************************************************/ extern xdata uint8_t ADC_Chn_Num; extern xdata uint16_t g_Value_Adc; extern xdata uint16_t g_Value_Adc_Avg; #if 0 extern xdata uint16_t g_Value_Adc0; extern xdata uint16_t g_Value_Adc1; extern xdata uint16_t g_Vref_Adc; #endif extern xdata uint16_t g_Vntc_Adc; extern xdata uint16_t g_pmu_Adc_Ivol; extern xdata uint16_t g_pmu_Adc_Ivor; extern xdata uint16_t g_Vbat_Adc; extern xdata uint16_t g_pmu_Adc_Vout; extern xdata uint8_t g_ADC_Chn; extern xdata uint8_t Adc_Index; /* ADC通道枚举。 */ typedef enum { ADC_CH1 = 0x00, ADC_CH0, ADC_NTC, ADC_IVOL, ADC_IVOR, ADC_BAT, ADC_VREF, ADC_VOUT, ADC_MAX, //VOUT的2分压 }PMU_ADC_CHANNELS_E; /******************************************************************************\ Functions definitions \******************************************************************************/ extern void Adc_Init(void); extern void PMU_ADC_Chn_Data(PMU_ADC_CHANNELS_E pmu_Adc_Chn); #endif #endif