/*
 * @file hv_pm51_driver_ADC.h
 * @brief Header file of ADC driver.
 *
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 * (+) Use ()
 *
 * @endverbatim
 * @author HiView SoC Software Team
 * @version 1.0.0
 * @date 2023-03-01
 */
 
#ifndef __HV_PM51_DRIVER_ADC_H__
#define __HV_PM51_DRIVER_ADC_H__

typedef enum _AdcNum
{
    E_ADC0 = 0, 
    E_ADC1,
    E_ADC_NUM_MAX
}AdcNum;

/**
 * @brief ADC initialization.
 * @param[in] enAdcNum: ADC port number.
 * @param[in] bIsUseInterrupt: enable ADC interrupt or not.
 * @return None.
 */
void Hv_PM51_Adc_Init(AdcNum enAdcNum, iBOOL bIsUseInterrupt);

/**
 * @brief Enable ADC.
 * @param[in] enAdcNum: ADC port number.
 * @return None.
 */
void Hv_PM51_Adc_Enable(AdcNum enAdcNum);

/**
 * @brief Disable ADC.
 * @param[in] enAdcNum: ADC port number.
 * @return None.
 */
void Hv_PM51_Adc_Disable(AdcNum enAdcNum);

/**
 * @brief Set theshold of ADC.
 * @param[in] enAdcNum: ADC port number.
 * @param[in] usLow: Minimum threshold for ADC triggering.
 * @param[in] usHigh: Maximum threshold for ADC triggering.
 * @return None.
 */
void Hv_PM51_Adc_SetTheshold(AdcNum enAdcNum, xUSHORT16 usLow, xUSHORT16 usHigh);

/**
 * @brief Read ADC sampling value.
 * @param[in] enAdcNum: ADC port number.
 * @return None.
 */
ULONG32 Hv_PM51_Adc_ReadVal(AdcNum enAdcNum);

/**
 * @brief Set ADC filter number.
 * @param[in] ulFilterNum: ADC filter number.
 * @return None.
 */
void Hv_PM51_Adc_SetFilterNum(AdcNum enAdcNum, xULONG32 ulFilterNum);

#endif
