/*************************************************  
  File name     : hal_interface_ver.c
  Module        : hal ver library interface typedefs
  Author        :
  Version       :
  Created on    : 2020-11-21
  Description   :
      Data structure and function definitions required by 
      the led interface

  Modify History:
  1. Date:        Author:         Modification:
  2020-11-21    borg.zhang         create
*************************************************/
#include "pal.h"
#include "hal_product_config.h"
#include "hal_interface.h"
#include "hal_interface_ver.h"
#if (HAL_CFG_VER_TYPE == HAL_CFG_VER_TYPE_T31)
#include "ver_t31.h"
#elif (HAL_CFG_VER_TYPE == HAL_CFG_VER_TYPE_RK3326)
#include "ver_rk3326.h"
#endif


#ifndef HAL_CFG_VER_TYPE
#error HAL_CFG_VER_TYPE undefined !!! Go to "hal_gernerate_product_config_h.sh" settings
#endif


ST_HAL_VER_INTERFACE g_HAL_VER_Itf[] =
{
#if (HAL_CFG_VER_TYPE == HAL_TYPE_NONE)
#elif (HAL_CFG_VER_TYPE == HAL_CFG_VER_TYPE_RK3326)
{
    .pfnVerInit = HAL_VER_Init_T8350,
    .pfnVerDeinit = HAL_VER_Deinit_T8350,
    .pfnGetSwVersion = HAL_VER_GetSwVersion_T8350,
    .pfnGetHwVersion = HAL_VER_GetHwVersion_T8350,
    .pfnGetAppVersion = HAL_VER_GetAppVersion_T8350,
    .pfnGetRootfsVersion = HAL_VER_GetRootfsVersion_T8350,
    .pfnGetUbootVersion = HAL_VER_GetUbootVersion_T8350,
    .pfnGetKernelVersion = HAL_VER_GetKernelVersion_T8350,
},

#else
{
    .pfnVerInit = HAL_VER_Init,
    .pfnVerDeinit = HAL_VER_Deinit,
    .pfnGetSwVersion = HAL_VER_GetSwVersion,
    .pfnGetHwVersion = HAL_VER_GetHwVersion,
    .pfnGetAppVersion = HAL_VER_GetAppVersion,
    .pfnGetRootfsVersion = HAL_VER_GetRootfsVersion,
    .pfnGetUbootVersion = HAL_VER_GetUbootVersion,
    .pfnGetKernelVersion = HAL_VER_GetKernelVersion,
    .pfnGetTagVersion = HAL_VER_GetTagVersion
},
#endif
};

ST_HAL_VER_INTERFACE *HAL_Ver_GetInterface(int32_t Channel)
{
#if (HAL_CFG_VER_TYPE == HAL_TYPE_NONE)
    return NULL;
#else
    HAL_ITF_INDEX idx = HAL_SELF;

    if ( Channel == HAL_CHANNEL_SELF )
    {
        idx = HAL_SELF;
    }
    else
    {
        // 需要从NV获取通道号Channel对应的设备类型对应的hal
        //idx = HAL_REMOTE_SUB1G;
        return NULL;
    }
    return &g_HAL_VER_Itf[Channel];
#endif
}

