半年前,公司需要我设计一些工具软件来对部分硬件模块做测试
对DVB33110D-PS1前面板的测试流程如下:
1. 开机后, 自动点亮Standby LED.共阴二极管初始化显示----
2. 按下 Power, 共阴二极管显示8888, 放掉 SW1, 共阴二极管显示清空.
3. 按下Menu, 共阴二极管显示11:11, 放掉 SW2, 共阴二极管显示1111.
4. 按下CH-, 共阴二极管显示22:22., 放掉 SW5, 共阴二极管显示2222.
5. 按下CH+, 共阴二极管显示33:33, 放掉 SW6, 共阴二极管显示3333.
6. 按下OK, 共阴二极管显示44:44, 放掉 SW4, 共阴二极管显示4444.
7. 按下VOL+, 共阴二极管显示55:55, 放掉 SW7, 共阴二极管显示5555.
8. 按下VOL_, 共阴二极管显示66:66., 放掉 SW3, 共阴二极管显示6666.
9. 按下遥控器[OK]键, 点亮Lock LED, 熄灭Standby LED,共阴二极管显示清空.
10. 按下遥控器[MENU],自动点亮Standby LED.共阴二极管初始化显示----.
测试完成.
按下Power键,实际应用操作的效果
放掉 SW3,显示6666
1)Front board checker source code position.
2) The buttons , remote control and led that we need to check.
All message will displayed through the 4 common cathode/anode led.
1, CH+
2, CH-
3, MENU
4, OK
5, VOL-
6, VOL+
7, POWER
8, Remote control keys (0-9) need to be displayed.
9, Led need to flicker when the box is running.
3) APIs for front board checker.
1-6: button_scan ( );
7: power_check( );
8: remote_control( );
9: led_flicker( );
/*
*Describe: this function is the main interface of the front board checker
* name: FB_checker_main()
*
*/
FB_checker_main()
{
While(1)
{
button_scan ( );
power_check( );
remote_control( );
led_flicker( );
}
}
/*
*Describe: this function for checking front board buttons
* name: button_scan()
*
*/
button_scan()
{
For( I = 0 to 6)
{
ret = sys_get_button_msg(&btn_id);
if(ret == TRUE)
{
switch(i)
{
0: Display(“CH+”);
1: Display(“CH-”);
2: Display(“MENU”);
3: Display(“OK”);
4: Display(“VOL-”);
5: Display(“VOL+”);
}
break;
}
}
}
/*
*Describe: this function for checking power button
* name: power_check( )
*
*/
power_check( )
{
ret = sys_get_button_msg(&btn_id);
if(ret == TRUE)
{
Display(“POWR”);
}
}
/*
*Describe: this function for checking remote control
* name: remote_control()
*/
remote_control()
{
For( i= 0 to 9)
{
ret = sys_get_button_msg(&btn_id);
if(ret == TRUE)
{
switch(i)
{
0: Display(“0”);
1: Display(“1”);
2: Display(“2”);
3: Display(“3”);
4: Display(“4”);
5: Display(“5”);
6: Display(“6”);
7: Display(“7”);
8: Display(“8”);
9: Display(“9”);
}
break;
}
}
}
/*
*Describe: this function for checking led status
* name: led_flicker()
*/
led_flicker( )
{
led0 = ON;
delay();
led0 = OFF;
led1 = ON;
delay();
led1 = OFF;
}