#include "exo_hal_io_al_common.h"
#include "exo_ahw_vdp_data_logger_ad7291.h"
#include "exo_ahw_al_data_logger_wrapper.h"

/**
 * @brief Mapping API to initializes the control block memory and do the basic configurations
 *
 */
hal_ret_sts ahw_al_dl_common_init(ahw_al_ad7291_hdl* al_dl_h)
{
    hal_ret_sts sts;
    switch(al_dl_h->ahw_gen_info.ahw_inst_id)
    {
        case ADC_AD7291_PS_1:
        case ADC_AD7291_PS_2:
        case ADC_AD7291_ORING_CIRCUIT:
            sts = ahw_vdp_dl_ad7291_init(al_dl_h);
            break;
        default:
            sts = HAL_AH_INVLD_INST_ID;
    }
    return sts;
}
hal_ret_sts ahw_al_dl_common_get_voltage_convertion(ahw_al_ad7291_hdl* al_dl_h,adc_channel_id chnl,float *data)
{
    hal_ret_sts sts;
    switch(al_dl_h->ahw_gen_info.ahw_inst_id)
    {
    case ADC_AD7291_PS_1:
    case ADC_AD7291_PS_2:
    case ADC_AD7291_ORING_CIRCUIT:
            sts = ahw_vdp_dl_ad7291_get_voltage_convertion(al_dl_h,chnl,data);

            break;
        default:
            sts = HAL_AH_INVLD_INST_ID;
    }
    return sts;
}

