vfd_io_util.c
资源名称:8202s.rar [点击查看]
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:78k
源码类别:
DVD
开发平台:
C/C++
- #if defined(GPIO_KEY_LIGHT)
- // DATA gpio56 IN/OUT
- // STB gpio57 IN/OUT
- // CLK gpio58 IN/OUT
- #ifdef HANYANG_DP02CD_WF_8202S_16//added by wangwei,2005-2-3 15:33
- void check_hanyang_dvdtv_keylight_status(void)
- {
- UINT32 key_data;
- static int key_state = 0;
- static UINT32 key_previ = 0xfff;
- //init_keylight_io();
- regs0->gpio_oe[21 / 16] &= (~0x1 << (21 % 16));
- regs0->gpio_oe[22 / 16] &= (~0x1 << (22 % 16));
- regs0->gpio_oe[23 / 16] &= (~0x1 << (23 % 16));
- key_data = (regs0->gpio_in[21 / 16] & (0x7 << (21 % 16)));
- if(key_data == key_previ)
- {
- //printf("1.key_previ=%xn",key_previ);
- //key_previ = 0xf0;
- #ifdef VFD_KEY_TEST
- psprintf(RegionValStr[REGION1], "KEY %x", key_data);
- PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
- #endif
- switch (key_data)
- {
- case 0xA0:
- if(key_state == 2)
- {
- call_ir_func(IRC_PLAY);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0x60:
- if(key_state == 2)
- {
- call_ir_func(IRC_EJECT); //call_ir_func(IRC_PAUSEPLAY);//HHQ
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0xC0:
- if(key_state == 2)
- {
- call_ir_func(IRC_STOP);
- //printf("STOPn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0x80:
- if(key_state == 2)
- {
- //gpio_key_only_next();
- //gpio_key_only_prev();
- #if defined(NEXT_FORWARD_IN_A_KEY)||defined(NEW_NEXT_FORWARD_IN_A_KEY)
- key_data_flag=1;
- #endif//#if defined(NEXT_FORWARD_IN_A_KEY)||defined(NEW_NEXT_FORWARD_IN_A_KEY)
- call_ir_func(IRC_PREV);
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0x100:
- if(key_state == 2)
- {
- //gpio_key_only_prev();
- //gpio_key_only_next();
- #if defined(NEXT_FORWARD_IN_A_KEY)||defined(NEW_NEXT_FORWARD_IN_A_KEY)
- key_data_flag=1;
- #endif//#if defined(NEXT_FORWARD_IN_A_KEY)||defined(NEW_NEXT_FORWARD_IN_A_KEY)
- call_ir_func(IRC_NEXT);
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- default:
- key_state = 2;
- break;
- }
- }
- else
- {
- //printf("out:key_state=%xn",key_state);
- key_previ = key_data;
- key_state = 2;
- #if defined(NEXT_FORWARD_IN_A_KEY)||defined(NEW_NEXT_FORWARD_IN_A_KEY)
- key_data_flag=0;
- #endif//#if defined(NEXT_FORWARD_IN_A_KEY)||defined(NEW_NEXT_FORWARD_IN_A_KEY)
- }
- }
- #endif//define HANYANG_DP02CD_WF_8202S_16
- #if defined(USE_VFD_GAME_PORT_TO_KEYBOARD_HJ)
- #ifdef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_2326
- void check_hj_keylight_status(void)
- {
- UINT32 key_data;
- UINT32 key_data1;
- UINT32 key_data2;
- // UINT32 key_data3;
- static int key_state = 0;
- static UINT32 key_previ = 0xffff;
- // regs0->gpio_oe[54 / 16] &= ~(0x7 << (54 % 16));
- // regs0->gpio_oe[42 / 16] &= ~(0x3 << (42 % 16));
- //key_data = ((regs0->gpio_in[42 / 16] & (0x3 << (42 % 16))) |(regs0->gpio_in[54 / 16] & (0x7 << (54 % 16))) );
- //key_data =(( regs0->gpio_in[42 / 16] & (0x3 << (42 % 16))) |(regs0->gpio_in[54 / 16] & (0x7 << (54 % 16))) );
- key_data1 = regs0->gpio_in[14 / 16] & (0x3 << (14 % 16));//14
- key_data2 = regs0->gpio_in[54 / 16] & (0x7 << (54 % 16));//6,7,8
- // key_data2 = regs0->gpio_in[4 / 16] & (0x1 << (4 % 16));//4
- // key_data3 = regs0->gpio_in[54 / 16] & (0x7 << (54 % 16));//6,7,8
- key_data =(key_data1|key_data2);//15,14,6,7,8
- //printf("key_data=%xn",key_data);
- //return;
- //printf("regs0->sft_cfg6=%xn",regs0->sft_cfg6);
- //printf("regs0->gpio_oe[14 / 16]=%xn",regs0->gpio_oe[14 / 16] );
- //printf("key_state=%xn",key_state);
- //printf("key_previ=%xn",key_previ);
- //regs0->gpio_out[56 / 16] &= ~(0x1 << (56 % 16));
- if(key_data == key_previ)
- {
- //printf("1.key_previ=%xn",key_previ);
- //key_previ = 0xf0;
- switch (key_data)
- {
- case 0x81C0:
- if(key_state == 2)
- {
- call_ir_func(IRC_EJECT);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0xc0c0:
- if(key_state == 2)
- {
- call_ir_func(IRC_ONLY_PAUSE);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0x40C0:
- if(key_state == 2)
- {
- call_ir_func(IRC_BACKWARD);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0x4180:
- if(key_state == 2)
- {
- call_ir_func(IRC_FORWARD);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0xc180://GPIO14 IO2//PIN109
- if(key_state == 2)
- {
- call_ir_func(IRC_PREV);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0xC140://VFD DATA
- if(key_state == 2)
- {
- //printf("STOPn");
- call_ir_func(IRC_STOP);
- }
- //printf("SS:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0xC100:
- if(key_state == 2)
- {
- call_ir_func(IRC_NEXT);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0x41C0:
- //printf("Ppppppp:key_state=%xn",key_state);
- if(key_state == 2)
- {
- //printf("PAUSEPLAYn");
- if(Is_JPEG_SlideMode())
- {
- if(bJpgVFDPause == 0)
- {
- //bJpgVFDPause = 1;
- if(play_state == VCD_STATE_PAUSE) //nono 2-6-28 14:00
- {
- bJpgVFDPause = 2;
- PrintOsdMsg(STR_OS_PLAY,REGION1,1,0);//nono 20030804
- }
- else
- bJpgVFDPause = 1;
- }
- else if(bJpgVFDPause == 1)
- {
- bJpgVFDPause = 2;
- }
- }
- else
- call_ir_func(IRC_PLAY);
- }
- //printf("P:key_state=%xn",key_state);
- key_state = 1;
- break;
- default:
- key_state = 2;
- break;
- }
- }
- else
- {
- //printf("out:key_state=%xn",key_state);
- key_previ = key_data;
- key_state = 2;
- }
- }
- #elif defined(USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_2290)
- void check_hj_keylight_status(void)
- {
- UINT32 key_data;//,key_data2;
- static int key_state = 0;//,key_state2 = 0;
- static UINT32 key_previ = 0xfff;//,key_previ2 = 0xfff;
- regs0->gpio_oe[54 / 16] &= (~0x1 << (54 % 16));
- regs0->gpio_oe[55 / 16] &= (~0x1 << (55 % 16));
- regs0->gpio_oe[56 / 16] &= (~0x1 << (56 % 16));
- key_data = (regs0->gpio_in[54 / 16] & (0x7 << (54 % 16)));
- //printf("key_data=%xn",key_data);
- // printf("key_state=%xn",key_state);
- // printf("key_previ=%xn",key_previ);
- if(key_data == key_previ)
- {
- //printf("1.key_previ=%xn",key_previ);
- //key_previ = 0xf0;
- switch (key_data)
- {
- case 0x180://CLK GPIO54
- if(key_state == 2)
- {
- call_ir_func(IRC_EJECT);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0x140://STB GPIO55
- //printf("Ppppppp:key_state2=%xn",key_state2);
- if(key_state == 2)
- {
- //printf("PAUSEPLAYn");
- if(Is_JPEG_SlideMode())
- {
- if(bJpgVFDPause == 0)
- {
- //bJpgVFDPause = 1;
- if(play_state == VCD_STATE_PAUSE) //nono 2-6-28 14:00
- {
- bJpgVFDPause = 2;
- PrintOsdMsg(STR_OS_PLAY,REGION1,1,0);//nono 20030804
- }
- else
- bJpgVFDPause = 1;
- }
- else if(bJpgVFDPause == 1)
- {
- bJpgVFDPause = 2;
- }
- }
- else
- call_ir_func(IRC_PLAY);
- }
- key_state = 1;
- //check_keylight_light_status();
- break;
- case 0x0C0://DATA GPIO56
- if(key_state == 2)
- {
- //printf("STOPn");
- call_ir_func(IRC_STOP);
- }
- key_state = 1;
- break;
- default:
- key_state = 2;
- break;
- }
- }
- else
- {
- //printf("out:key_state=%xn",key_state);
- key_previ = key_data;
- key_state = 2;
- }//if(key_data==key_previ) else ........
- }
- //dingzhy 3-11-17 11:02
- #elif defined(USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313)
- void CD_MP3_DVD_LIGHT_FOR_HJ( void )
- {
- if(cd_type_loaded==CDDVD)
- {
- GPIO_O_SET(3,1);
- GPIO_O_SET(62,0);
- GPIO_O_SET(63,1);
- }
- else if(cd_type_loaded==CDROM)
- {
- GPIO_O_SET(3,0);
- GPIO_O_SET(62,1);
- GPIO_O_SET(63,1);
- }
- else if(cd_type_loaded==CDDA || cd_type_loaded==CDVCD10 || cd_type_loaded==CDVCD20 || cd_type_loaded==CDSVCD)
- {
- GPIO_O_SET(3,1);
- GPIO_O_SET(62,1);
- GPIO_O_SET(63,0);
- }
- else if(play_state == VCD_STATE_OPEN)
- {
- GPIO_O_SET(3,1);
- GPIO_O_SET(62,1);
- GPIO_O_SET(63,1);
- }
- }
- void check_hj_keylight_status(void)
- {
- UINT32 key_data,key_data1,key_data2,key_data3,key_data4,key_data5;//,key_data2;
- static int key_state = 0;//,key_state2 = 0;
- static UINT32 key_previ = 0xfff;//,key_previ2 = 0xfff;
- key_data1 = (regs0->gpio_in[54 / 16] & (0x1 << (54 % 16)));
- key_data2 = (regs0->gpio_in[55 / 16] & (0x1 << (55 % 16)));
- key_data3 = (regs0->gpio_in[56 / 16] & (0x1 << (56 % 16)));
- key_data4 = (regs0->gpio_in[14 / 16] & (0x1 << (14 % 16)));
- key_data5 = (regs0->gpio_in[15 / 16] & (0x1 << (15 % 16)));
- // printf("key_data1=%xn",key_data1);
- // printf("key_data2=%xn",key_data2);
- // printf("key_data3=%xn",key_data3);
- key_data =(key_data1|key_data2|key_data3|key_data4|key_data5);//15,14,6,7,8
- // printf("key_data=%xn",key_data);
- // printf("key_previ=%xn",key_previ);
- if(key_data == key_previ)
- {
- //printf("1.key_previ=%xn",key_previ);
- //key_previ = 0xf0;
- switch (key_data)
- {
- case 0xc180:
- #ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- call_ir_func(IRC_STOP);
- }
- key_state = 1;
- break;
- #else//USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- call_ir_func(IRC_BACKWARD);
- }
- key_state = 1;
- break;
- #endif//USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- case 0xc140:
- #ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- call_ir_func(IRC_BACKWARD);
- }
- key_state = 1;
- break;
- #else//#ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- call_ir_func(IRC_FORWARD);
- }
- key_state = 1;
- break;
- #endif//#ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- case 0xc0c0:
- #ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- call_ir_func(IRC_FORWARD);
- }
- key_state = 1;
- break;
- #else//#ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- call_ir_func(IRC_DEFAULT_SETUP);
- }
- key_state = 1;
- break;
- #endif//#ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- case 0x81c0:
- #ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- if(Is_JPEG_SlideMode())
- {
- if( (bJpgVFDPause == 1)||(bJpgVFDPause == 0) )
- {
- bJpgVFDPause = 2;
- PrintOsdMsg(STR_OS_PLAY,REGION1,1,0);//nono 20030804
- }
- }
- else
- call_ir_func(IRC_PLAY);
- }
- key_state = 1;
- break;
- #else//#ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- //printf("Ppppppp:key_state=%xn",key_state);
- if(key_state == 2)
- {
- //printf("PAUSEPLAYn");
- if(Is_JPEG_SlideMode())
- {
- if(bJpgVFDPause == 0)
- {
- //bJpgVFDPause = 1;
- if(play_state == VCD_STATE_PAUSE) //nono 2-6-28 14:00
- {
- bJpgVFDPause = 2;
- PrintOsdMsg(STR_OS_PLAY,REGION1,1,0);//nono 20030804
- }
- else
- bJpgVFDPause = 1;
- }
- else if(bJpgVFDPause == 1)
- {
- bJpgVFDPause = 2;
- }
- }
- else
- call_ir_func(IRC_PAUSEPLAY);
- }
- //printf("P:key_state=%xn",key_state);
- key_state = 1;
- break;
- #endif//#ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- case 0x41c0:
- #ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- if(Is_JPEG_SlideMode())
- {
- bJpgVFDPause = 1;
- }else
- call_ir_func(IRC_ONLY_PAUSE);
- }
- key_state = 1;
- break;
- #else//#ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- if(key_state == 2)
- {
- call_ir_func(IRC_STOP);
- }
- key_state = 1;
- break;
- #endif//#ifndef USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_DP313_NEW_KEY
- case 0x1c0:
- if(key_state == 2)
- {
- call_ir_func(IRC_EJECT);
- }
- key_state = 1;
- break;
- default:
- key_state = 2;
- break;
- }
- }
- else
- {
- //printf("out:key_state=%xn",key_state);
- key_previ = key_data;
- key_state = 2;
- }
- //dingzhy 3-11-17 10:08
- CD_MP3_DVD_LIGHT_FOR_HJ();
- }
- #else//USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_2326
- void check_hj_keylight_status(void)
- {
- UINT32 key_data;
- UINT32 key_data1;
- UINT32 key_data2;
- // UINT32 key_data3;
- static int key_state = 0;
- static UINT32 key_previ = 0xffff;
- // regs0->gpio_oe[54 / 16] &= ~(0x7 << (54 % 16));
- // regs0->gpio_oe[42 / 16] &= ~(0x3 << (42 % 16));
- //key_data = ((regs0->gpio_in[42 / 16] & (0x3 << (42 % 16))) |(regs0->gpio_in[54 / 16] & (0x7 << (54 % 16))) );
- //key_data =(( regs0->gpio_in[42 / 16] & (0x3 << (42 % 16))) |(regs0->gpio_in[54 / 16] & (0x7 << (54 % 16))) );
- key_data1 = regs0->gpio_in[14 / 16] & (0x3 << (14 % 16));//14
- key_data2 = regs0->gpio_in[54 / 16] & (0x7 << (54 % 16));//6,7,8
- // key_data2 = regs0->gpio_in[4 / 16] & (0x1 << (4 % 16));//4
- // key_data3 = regs0->gpio_in[54 / 16] & (0x7 << (54 % 16));//6,7,8
- key_data =(key_data1|key_data2);//15,14,6,7,8
- //printf("key_data=%xn",key_data);
- //return;
- //printf("regs0->sft_cfg6=%xn",regs0->sft_cfg6);
- //printf("regs0->gpio_oe[14 / 16]=%xn",regs0->gpio_oe[14 / 16] );
- //printf("key_state=%xn",key_state);
- //printf("key_previ=%xn",key_previ);
- //regs0->gpio_out[56 / 16] &= ~(0x1 << (56 % 16));
- if(key_data == key_previ)
- {
- //printf("1.key_previ=%xn",key_previ);
- //key_previ = 0xf0;
- switch (key_data)
- {
- case 0x81C0://GPIO15 IO1//PIN121
- if(key_state == 2)
- {
- call_ir_func(IRC_NEXT);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0x41C0://GPIO14 IO2//PIN109
- if(key_state == 2)
- {
- call_ir_func(IRC_PREV);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0xC0C0://VFD DATA
- if(key_state == 2)
- {
- //printf("STOPn");
- call_ir_func(IRC_STOP);
- }
- //printf("SS:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0xC180://VFD CLK
- if(key_state == 2)
- {
- call_ir_func(IRC_EJECT);
- //printf("EJECTn");
- }
- //printf("EEE:key_state=%xn",key_state);
- key_state = 1;
- break;
- case 0xC140://VFD STB
- //printf("Ppppppp:key_state=%xn",key_state);
- if(key_state == 2)
- {
- //printf("PAUSEPLAYn");
- if(Is_JPEG_SlideMode())
- {
- if(bJpgVFDPause == 0)
- {
- //bJpgVFDPause = 1;
- if(play_state == VCD_STATE_PAUSE) //nono 2-6-28 14:00
- {
- bJpgVFDPause = 2;
- PrintOsdMsg(STR_OS_PLAY,REGION1,1,0);//nono 20030804
- }
- else
- bJpgVFDPause = 1;
- }
- else if(bJpgVFDPause == 1)
- {
- bJpgVFDPause = 2;
- }
- }
- else
- call_ir_func(IRC_PAUSEPLAY);
- }
- //printf("P:key_state=%xn",key_state);
- key_state = 1;
- break;
- default:
- key_state = 2;
- break;
- }
- }
- else
- {
- //printf("out:key_state=%xn",key_state);
- key_previ = key_data;
- key_state = 2;
- }
- }
- #endif//USE_VFD_GAME_PORT_TO_KEYBOARD_HJ_2326
- #elif defined(USE_VFDPORT_TO_KEYLIGHT_GBM)
- #if defined(NEXT_FORWARD_IN_A_KEY)||defined(NEW_NEXT_FORWARD_IN_A_KEY)
- extern BYTE key_data_flag;
- #endif//#if defined(NEXT_FORWARD_IN_A_KEY)||defined(NEW_NEXT_FORWARD_IN_A_KEY)
- #ifdef NEW_GBM_VFD_GPIO_KEY //gerry,2004/2/11 05:58