/*************************************************  
  File name     : hal_interface_nv.c
  Module        : hal nv library interface typedefs
  Author        : 
  Version       :
  Created on    : 2020-10-20
  Description   :
      Data structure and function definitions required by 
      the nv interface
    
  Modify History:   
  1. Date:        Author:         Modification:
  2020-10-20    amir.liang         create
*************************************************/
#include "pal.h"
#include "hal_product_config.h"
#include "hal_interface.h"
#include "hal_interface_solar.h"


#ifndef HAL_CFG_SOLAR_TYPE
#define HAL_CFG_SOLAR_TYPE HAL_TYPE_NONE
#endif


#if (HAL_CFG_SOLAR_TYPE ==  HAL_CFG_BATTERY_TYPE_T31)

#elif (HAL_CFG_SOLAR_TYPE ==  HAL_CFG_SOLAR_TYPE_MCU)
#include "solar_mcu.h"
#elif (HAL_CFG_SOLAR_TYPE ==  HAL_CFG_SOLAR_TYPE_6441)
#include "solar_atbm6441.h"
#endif




ST_HAL_SOLAR_INTERFACE g_HAL_Solar_Itf[] =
{
#if (HAL_CFG_SOLAR_TYPE ==  HAL_CFG_SOLAR_TYPE_T31)
{
    .pfnInit      = NULL,
    .pfnDeinit    = NULL,
    .pfnGetStatus = NULL,
    .pfnGetEvent  = NULL,
    .pfnCalibration = NULL
},
#elif (HAL_CFG_SOLAR_TYPE ==  HAL_CFG_SOLAR_TYPE_MCU)
{
    .pfnInit 	  = Mcu_Solar_Init,
    .pfnDeinit 	  = Mcu_Solar_DeInit,
    .pfnGetStatus = Mcu_Solar_GetStatus,
    .pfnGetEvent  = NULL,
    .pfnCalibration = NULL
},
#elif (HAL_CFG_SOLAR_TYPE ==  HAL_CFG_SOLAR_TYPE_6441)
{
    .pfnInit 	  = Atbm6441_Solar_Init,
    .pfnDeinit	  = Atbm6441_Solar_DeInit,
    .pfnGetStatus = NULL,
    .pfnGetEvent  = Atbm6441_Solar_GetEvent,
    .pfnCalibration = Atbm6441_Solar_Calibration
},
#endif
};



ST_HAL_SOLAR_INTERFACE* HAL_Solar_GetInterface(int32_t channel)
{

#if (HAL_CFG_SOLAR_TYPE == HAL_CFG_SOLAR_TYPE_MCU || HAL_CFG_SOLAR_TYPE == HAL_CFG_SOLAR_TYPE_6441)
    return &g_HAL_Solar_Itf[0];

#else
    return NULL;
#endif

}

