⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msapi_ir.c

📁 mstar 776 开发的车载dvd
💻 C
字号:
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2007 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
// MStar Semiconductor Inc. and be kept in strict confidence
// (¨MStar Confidential Information〃) by the recipient.
// Any unauthorized act including without limitation unauthorized disclosure,
// copying, use, reproduction, sale, distribution, modification, disassembling,
// reverse engineering and compiling of the contents of MStar Confidential
// Information is unlawful and strictly prohibited. MStar hereby reserves the
// rights to any and all damages, losses, costs and expenses resulting therefrom.
//
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
//
/// @file msAPI_IR.h
/// @brief API for Irda Control
/// @author MStar Semiconductor, Inc.
//
////////////////////////////////////////////////////////////////////////////////

#define MSAPI_IR_C

#include "board.h"
#include "DataType.h"
#include "sysinfo.h"
#include "msAPI_IR.h"
#include "msGPIO.h"
#include "msKeypad.h"
#include "drvmiu.h"
#include "drvpower.h"
#include "MsIR.h"
#include "drvsys.h"
#include "drvcpu.h"
#include "msAPI_DrvInit.h"

/******************************************************************************/
/// API for Get Irda Key::
/// Get Irda Key value and Status
/// @param u8key \b OUT Irda Key Mapping value
/// @param u8Repstatus \b OUT Irda Repeat and FIFO status
/******************************************************************************/
U8 msAPI_GetIRKey(U8 *u8key,U8 *u8Repstatus)
{
    //printf("\r\nGet IR Key");//kevin test
    return msIR_GetIRKeyCode(u8key, u8Repstatus);
}

/******************************************************************************/
/// API for clear IR FIFO::
/// Called by application init or preparation
/******************************************************************************/
void msAPI_ClearIRFIFO(void)
{
    msIR_Clear_FIFO();
}

/******************************************************************************/
/// API for Get Keypad Key::
/// Get Keypad Key value and Status
/// @param u8key \b OUT Keypad Key Mapping value
/// @param u8Repstatus \b OUT Keypad Repeat and FIFO status
/******************************************************************************/
U8 msAPI_GetKeyPad(U8 *u8key,U8 *u8Repstatus)
{
    //printf("\r\nGet Key Pad");//kevin test
    return  msKeypad_GetKey(u8key, u8Repstatus);
}

/******************************************************************************/
/// API for Power Down::
/// Execute Power sequence, be called after press Power Button to Power OFF
/******************************************************************************/
void msAPI_Key_PowerDown_Mode(U8 u8Mode)
{
    #if POWER_DOWN_SEQ
    MDrv_Power_Set_PDMode(u8Mode);

    switch(u8Mode)
    {
        case POWERMODE_S1:
            //MDrv_MIU_SetFrequency(MIU_BOOTUP_CLOCK_MHZ);
            break;
        case POWERMODE_S2:
        case POWERMODE_S3:
        case POWERMODE_S4:
            msAPI_Power_PowerDown_EXEC();
            //MDrv_Power_ResetAndPowerDown();
            break;
        default:
            break;
    }
    #else
    u8Mode = u8Mode;
    #endif
}

/******************************************************************************/
/// API for Power Resume::
/// Execute Power sequence, be called after press Power Button to Power ON
/******************************************************************************/
void msAPI_Key_PowerResume()
{
    #if POWER_DOWN_SEQ
    switch(MDrv_Power_Get_PDMode())
    {
        case POWERMODE_S0:
            break;
        case POWERMODE_S1:
        case POWERMODE_S2:
        case POWERMODE_S3:
        case POWERMODE_S4:
        default:
            MDrv_Power_ResetAndPowerUp();
            break;
    }
    #endif
}
#undef MSAPI_IR_C

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -