#ifndef HAL_DRIVER_DATA_LOGGER_COMMON_H_
#define HAL_DRIVER_DATA_LOGGER_COMMON_H_

#include <stdint.h>
#include "exo_io_al_common.h"
#include "exo_hal_common.h"
#include "exo_ahw_al_common.h"
#include "ad7291.h"

typedef struct
{
    ahw_al_gen_info ahw_gen_info;
    uint8_t slave_address;                           /*!< slave_address                  */
    uint16_t device_id;                              /*!< device_id                      */
}ahw_al_ad7291_hdl;


//typedef ahw_al_ad7291_hdl ahw_al_ad7291_hdl_ptr;

typedef struct
{
	ahw_al_gen_info ahw_gen_info;				/*!< IO interface handle pointer    */
}s_ahw_ad7291_hdle;


typedef enum
{
    ADC_CHNL_0 = 0,
    ADC_CHNL_1,
    ADC_CHNL_2,
    ADC_CHNL_3,
    ADC_CHNL_4,
    ADC_CHNL_5,
    ADC_CHNL_6,
    ADC_CHNL_7,
    ADC_CHNL_8,
	ADC_CHNL_MAX

} adc_channel_id;

/**
 * @brief API to init the data logger
 * @param[in] ahw_inst_id_t : structure handle of data logger handle..
 * @retval hal_ret_sts      :returns the success or error code
 */
hal_ret_sts ahw_al_data_logger_init(ahw_al_ad7291_hdl* ht_arg, ahw_inst_id_t ahw_id);

/**
 * @brief API to get voltage in data logger
 * @param[in] ahw_inst_id_t : structure handle of data logger handle.
 * @param[in] e_ad7291_chnl : structure handle of data logger channel id.
 * @param[in] data          : return the voltage data
 * @retval hal_ret_sts      : returns the success or error code
 */
hal_ret_sts ahw_al_data_logger_getvoltage_convertion(ahw_inst_id_t ahw_id, adc_channel_id chnl, float *data);

/**
 * @brief API to self test the data logger 
 * @param[in] ahw_id        : data logger ennum id
 * @retval hal_ret_sts      :returns the success or error code
 */
hal_ret_sts ahw_al_data_logger_self_test(uint32_t ahw_id);

#endif
