📄 remote.c
字号:
/*********************************************************************
COPYRIGHT (C) Himax Technologies, Inc.
File name : REMOTE.C
Description : Remote Controller Implement Code
Author : Nice Chen
Create date : 2004/10/07
Modifications :
*********************************************************************/
#define _REMOTE_C
/********************** Include Section *****************************/
#include "remote.h"
#include "tuner.h"
#include "osd.h"
/**************** Function Implement Section ************************/
/* ================================================================
Name : init_remote
Purpose : initial PA8204's remote controller function
Passed : None
Notes : None
================================================================ */
void Init_Remote(void)
{
// External interrupt enable
EX0 = 1;
// INT 0 type : falling edge
IT0 = 1;
// Setup Remote Controller Parameters to PA8204
I2CWrite2Byte(PA8204_ADDR,PA8204_CUSTOM_DATA_1 , _RMT_CUSTOM_HI, _RMT_CUSTOM_LO );
// Setup Repeat Threshold-Low [0x89 ~ 0x8A]
// [0x8A] Repear IR is not working
I2CWrite2Byte(PA8204_ADDR,PA8204_RD_WIDTH, 0x89, 0xA0);
// Enable HX6204A Interrupt Mask
I2CWriteByte(PA8204_ADDR, PA8204_INT_MASK_STAUS, 0x07);
}
/* ================================================================
Name : RemoteControl
Purpose : Pass PA8204 IR received IR data stream
Passed : Byte
Notes : None
================================================================ */
void RemoteControl(Byte IRStream)
{
// Display Press-Key Code
Puts_UART("RC="),HexTobyStr(IRStream),Puts_UART(byStr),Puts_UART("\r\n");
// According to SystemPower Status, then Processing Key function
switch (SystemPower)
{
// ============================[Power Off Section]==============================
case _Power_Off:
switch (IRStream)
{
// [1] FREEZE KEY
case _RMT_OverScan:
// ========== NICE_DEBUG ========== //
#if NICE_DEBUG==1
BootFromLDROM();
break;
#endif
// ========== END DEBUG =========== //
// [2] Power
case _RMT_StandBy:
SystemPower= _Power_On;
break;
}
break;
// ============================[End of Power Off]===============================
// ============================[Power On Section]===============================
case _Power_On:
switch (IRStream)
{
// [1] Power Key
case _RMT_StandBy:
SystemPower=_Power_Off;
break;
// [2] Mute
case _RMT_Mute:
// ========== NICE_DEBUG ========== //
#if NICE_DEBUG==1
Puts_UART("Start Auto Function\r\n");
InitAutoFunction();
SetAutoClock(_Main);
SetAutoPhase(_Main);
SetAutoPos(_Main);
SetAutoColor_RGB(_Main);
break;
#endif
// ========== END DEBUG =========== //
// [3] S-Video
case _RMT_AV2:
Puts_UART("S-Video\r\n");
byCurSource=_YC;
ChangeToVideo();
break;
// [4] YUV
case _RMT_AV3:
Puts_UART("YUV\r\n");
ChangeToYUV();
break;
// [5] VGA
case _RMT_PC:
Puts_UART("VGA\r\n");
ChangeToVGA();
break;
/*
// [6] TV
case _RMT_TV:
byCurSource=_Tuner;
Puts_UART("TV\r\n");
ChangeToVideo();
break;
*/
// [7] Channel ++
case _RMT_ChannelUp:
Puts_UART("CH+\r\n");
byChannelNumber++;
if(byChannelNumber>_Max_CH)
{
byChannelNumber=_Min_CH;
}
ChnlSet(byChannelNumber);
OsdSetChanelValue(4, 10, (8|Transparent), (5|Transparent),byChannelNumber);
break;
// [8] Channel --
case _RMT_ChannelDown:
Puts_UART("CH-\r\n");
byChannelNumber--;
if(byChannelNumber<_Min_CH)
{
byChannelNumber=_Max_CH;
}
ChnlSet(byChannelNumber);
OsdSetChanelValue(4, 10, (8|Transparent), (5|Transparent),byChannelNumber);
break;
}
break;
// ============================[End of Power On]================================
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -