/**
 * @file IRConfig.h
 * @brief Header file of IR configuration.
 *
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 *
 *
 @ endverbatim
 *
 * @author HiView SoC Software Team
 * @version 1.0.0
 * @date 2024-01-12
 */

#include "hv_comm_DataType.h"
#include "hv_comm_Define.h"
#include "hv_comm_Event.h"

#include "IRConfig.h"

OsdEvtKeyValue g_enIRValueMapping0[][2] =
{
    /* user ir */
    {0x0d, OSDEVT_KEY_UP},
};

OsdEvtKeyValue g_enIRValueMapping1[][2] =
{
    {0x47, OSDEVT_KEY_DOWN},
};

UINT32 GetIRMappedValue(UCHAR8 ucSysCode, UINT32 uiAdcValue)
{
    UINT32 uiArrayIndex = 0;

    if (ucSysCode == (HV_PROJECT_CONFIG_PM51_IR_SYSCODE0&0xff))
    {
        for (uiArrayIndex = 0;
             uiArrayIndex < sizeof(g_enIRValueMapping0) / sizeof(g_enIRValueMapping0[0]);
             uiArrayIndex++)
        {
            if (uiAdcValue == g_enIRValueMapping0[uiArrayIndex][0])
            {
                return  g_enIRValueMapping0[uiArrayIndex][1];
            }
        }

        return 0xff;
    }
    else if (ucSysCode == (HV_PROJECT_CONFIG_PM51_IR_SYSCODE1&0xff))
    {
        for (uiArrayIndex = 0;
             uiArrayIndex < sizeof(g_enIRValueMapping1) / sizeof(g_enIRValueMapping1[0]);
             uiArrayIndex++)
        {
            if (uiAdcValue == g_enIRValueMapping1[uiArrayIndex][0])
            {
                return  g_enIRValueMapping1[uiArrayIndex][1];
            }
        }

        return 0xff;
    }
    else
    {
    }
    return 0xff;
}

