📄 aprv_htv.c
字号:
//#include "version_api.h"
#include "rmpi.h"
#include "rbsc_api.h"
#include "rbsc_cnf.h"
#include "fsrt_api.h"
#include "ri2c_api.h"
#include "aprv_api.h"
#include "ri2c_cnf.h"
//#include "msdefine.h"
#include "rsrv_api.h"
#include "rsrv_map.h"
#if(GTVA_HTV_PLM_PRESENT == TRUE)
/*=======================================================================*/
/* G L O B A L R E F E R E N C E S */
/*=======================================================================*/
/*=======================================================================*/
/* L O C A L S Y M B O L D E C L A R A T I O N S */
/*=======================================================================*/
#define FILTER_NUM 5
#define PLM1000_ADDR 0x2e
#define RIGHT 0
#define LEFT 1
#define DOWN 0
#define UP 1
#define PC_PARA_CONTROL_RANGE 15
#define Demo_Switch_2 TRUE
//#define Demo_Switch_3 FALSE
#define Demo_Switch_4 FALSE
#define Demo_Switch_5 FALSE
/*=======================================================================*/
/* L O C A L DATA */
/*=======================================================================*/
Byte code register_480i[]={249,240,184,128, 1, 64, 88,150,220,170,128,128,128,251,107, 85, 32, 5, 20,111,101,156,220,156, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,249,241,
0, 0, 0, 0, 0, 0, 0, 70, 40,162,238, 17,149, 7,192, 58,135, 98,183, 68, 18, 73, 36, 67, 34, 34, 34, 42, 0, 40, 0, 0, 38, 38, 38, 38, 38, 38, 38, 64,
0,101, 12, 64, 0, 63, 63,143, 0, 15,182, 62, 15, 10, 10, 10, 10, 32, 87, 0, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 31, 0, 32, 28, 32, 1, 0, 33, 85,
60,128, 18,250, 0,238,238, 78, 2, 0, 12, 2, 0,112, 0, 0, 0, 0, 0, 0, 0, 0, 62,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
// 130, 0, 0, 0, 0, 64, 0, 0, 4,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 32, 22,128, 8, 1, 0, 0, 0, 0,
130, 0, 0, 0, 0, 127, 0, 0, 4,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 32, 22,128, 8, 1, 0, 0, 0, 0,
// 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 5, 21, 0, 0, 64, 0, 0, };
0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 5, 21, 0, 0, 127, 0, 0, };
Byte code register_480p[]={149,240,184, 56, 0,128, 88,145,240,255,128,128,128, 59,107, 85, 32, 5, 20,111,109,156,220,155, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,149,241,
0, 0, 0, 0, 0, 0, 0, 65,101, 1,145, 95,149, 7,192, 64, 32,149, 4, 68, 0, 0, 0, 60, 0, 0, 0, 42, 93, 29,121, 4, 31, 31, 31, 31, 31, 31, 31, 68,
160, 0, 0, 0, 0, 68,160, 0, 0, 0, 0, 68, 10, 5, 5, 5, 5, 32, 80, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 47, 0, 36, 30, 1, 4, 0, 45, 84,
0,128, 18,250, 0, 0, 0,126, 4, 0, 12, 96, 22,118,228,100,220,208,128, 8, 71, 64,190,224,128, 0, 3,239, 6, 89, 0, 3,169, 80, 19, 16,172,132, 2, 0,
129, 64, 80, 3, 28, 65,136, 49, 43,
// 2,248, 80, 67,130, 64, 0,128, 52,179, 4, 4,195,192,129, 44, 6,164,149, 56, 80, 39,248, 22,160,138, 1,130, 1,105,128,
2,248, 80, 67,130, 127, 0,128, 52,179, 4, 4,195,192,129, 44, 6,164,149, 56, 80, 39,248, 22,160,138, 1,130, 1,105,128,
// 15,119, 2, 75, 3, 8, 85, 1,106, 65,144, 64, 0, 51, 15, 15,128, 5, 21, 0, 80, 64, 0, 0, };
15,119, 2, 75, 3, 8, 85, 1,106, 65,144, 64, 0, 51, 15, 15,128, 5, 21, 0, 80, 127, 0, 0, };
Byte code register_576i[]={249,240,184,128, 1, 64, 88,150,220,170,128,128,128, 59,107, 85, 32, 3, 3,111,101,156,220,156, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,249,241,
0, 0, 0, 0, 0, 0, 0, 70, 40,162,238, 17,149, 7,192, 58,135, 98,183, 68, 18, 73, 36, 67, 34, 34, 34, 42, 0, 40, 0, 0, 38, 38, 38, 38, 38, 38, 38, 64,
0,101, 12, 64, 0, 63, 63,143, 0, 15,182, 62, 15, 10, 10, 10, 10, 32, 87, 0, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 31, 0, 32, 28, 32, 1, 0, 35, 85,
60,128, 18,250, 0,238,238,206, 2, 0, 12, 2, 1,113, 0, 0, 0, 0, 0, 0, 0, 0, 62,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
// 130, 0, 0, 0, 0, 64, 0, 0, 4,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 32, 22,128, 8, 1, 0, 0, 0, 0,
130, 0, 0, 0, 0, 127, 0, 0, 4,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 32, 22,128, 8, 1, 0, 0, 0, 0,
// 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 5, 21, 0, 0, 64, 0, 0, };
0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 5, 21, 0, 0, 127, 0, 0, };
Byte code register_576p[]={149,240,184,128, 0,200, 88,140,200,150,128,128,128,251,107, 85, 32, 5, 20,107,109,156,220,156, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,149,241,
0, 0, 0, 0, 0, 0, 0, 77,229, 1,145, 39,149, 7,192, 62,218,217, 6, 68, 0, 0, 0, 72, 0, 0, 0, 42,102, 96, 51, 1, 28, 28, 28, 28, 28, 28, 28, 64,
0, 0, 0, 0, 0, 66, 80, 37, 0, 15,219, 66, 5, 4, 4, 4, 4, 27, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 36, 30, 1, 4, 0, 47, 84,
0,128, 18,250, 0, 0, 0,145, 4, 0, 25, 96, 23,119,228,100,211, 72,172, 8, 87,137,190,224,128, 0, 3,239, 6, 90,144, 3,169, 80, 19, 16,172,132, 2, 0,
129, 64, 80, 3,170, 78, 9,193, 43,
// 34,248, 80, 43, 2, 64, 0,128, 52,179, 4, 4,195,192,129, 44, 6,164,149, 48, 80, 41,192, 22,166, 42, 1,156, 1,105,128,
34,248, 80, 43, 2, 127, 0,128, 52,179, 4, 4,195,192,129, 44, 6,164,149, 48, 80, 41,192, 22,166, 42, 1,156, 1,105,128,
// 12,119, 2, 75, 11, 8, 85, 1,106, 65,147,128, 0, 51, 15, 15,128, 5, 21, 0, 80, 64, 0, 0, };
12,119, 2, 75, 11, 8, 85, 1,106, 65,147,128, 0, 51, 15, 15,128, 5, 21, 0, 80, 127, 0, 0, };
Byte code register_720p_50[]={124,240,184, 56, 0,128, 88,140,235,255,128,128,128,251,107, 85, 32, 3, 3,111,109,156,220,155, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,124,241,
0, 0, 0, 0, 0, 0, 0, 91, 77,129,145, 49,149, 7,192, 3,144, 9,166, 36, 25,153,153, 90, 0, 0, 0, 42, 9,234, 4, 7, 37, 37, 37, 37, 37, 37, 37, 72,
0,114, 13,176, 0, 72, 15,129, 0, 15,173, 70, 13, 4, 4, 4, 4, 32, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 36, 30, 1, 4, 0, 51, 84,
0,128, 18,250, 0, 0, 0,126, 6, 0, 12, 96, 25,121,231,126,204, 75,133, 5, 72,199,190,224,153,153,147,239, 6, 79,176, 3,169, 80, 22,224,172,132, 2, 0,
129, 64, 80, 3, 28,119,238,252,249, 2,248, 84, 43, 2, 64, 0,128, 52,179, 4, 4,195,192,128,250, 6,164,124, 56, 81,174, 16, 20, 46,170, 1,225, 1, 65,128,
// 10,150, 66, 75, 11, 8, 70, 0,241,136,156, 32, 0, 51, 15, 15,128, 5, 21, 0, 24, 64, 0, 0, };
10,150, 66, 75, 11, 8, 70, 0,241,136,156, 32, 0, 51, 15, 15,128, 5, 21, 0, 24, 127, 0, 0, };
Byte code register_720p_60[]={104,240,184, 56, 0,128, 88,140,220,150,128,128,128, 59,107, 85, 32, 3, 3,107,109,156,220,156, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,104,241,
0, 0, 0, 0, 0, 0, 0, 93,141, 1,145, 62,149, 7,192, 4,148,159,167,196, 54,219,110, 90, 2, 2, 2, 42, 63, 42, 31, 4, 41, 41, 41, 41, 41, 41, 41, 64,
0,102, 12, 48, 0, 63,223,179, 0, 15,147, 63, 2, 5, 5, 5, 5, 32, 80, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 47, 0, 36, 30, 1, 4, 0, 49, 84,
0,128, 18,250, 0, 0, 0,134, 5, 0, 50, 96, 24,120,228, 54,204,128,202, 5, 86, 3, 62,224,182,219, 99,239, 6, 79,176, 3,169, 81, 20, 68,172,132, 20, 5,
5, 1, 64, 4, 28, 93,171,180,209, 2,232, 80, 50, 2, 64, 0,128, 52,179, 4, 4,195,192,128,210, 4,176, 19, 48, 80, 43,164, 12,174,154, 1,186, 64,201,128,
// 26,150, 66, 75, 3, 8, 70, 0,241,136,151, 72, 0, 51, 0, 32,128, 5, 21, 0, 40, 64, 0, 0, };
26,150, 66, 75, 3, 8, 70, 0,241,136,151, 72, 0, 51, 0, 32,128, 5, 21, 0, 40, 127, 0, 0, };
Byte code register_1080i_50[]={167,112,184, 56, 1,255, 88,150,240,150,128,128,128,251,107, 85, 32, 3, 3,251,101,156,220,156, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,139,241,
0, 0, 0, 0, 0, 0, 0, 70, 40,129,146,165,149, 7,192, 58,135, 98,250,196, 18, 73, 36, 67, 34, 34, 34, 42, 17,168, 8, 6, 38, 38, 38, 38, 38, 38, 38, 70,
80,112, 13, 96, 0, 70, 95,132, 0, 15,175, 69, 2,244,244,244,244, 32, 80, 0, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 15, 0, 36, 30, 1, 5, 0, 55, 84,
0,128, 18,250, 0, 0, 0,125, 1, 0, 12, 0, 11, 58,228,100,212,240,160, 7,249,228,190,224,230,102, 99,239, 6, 79,176, 3,169, 80, 14,160,172,132, 2, 0,
129, 64, 80, 3,218, 70, 40,201, 78, 66,184,208, 45, 2, 64, 0,128, 52,179, 4, 4,195,192,129, 79, 7,208, 31, 32, 80, 40,148, 26, 35, 42, 1,137, 65,201,232,
// 12,150, 75, 75,107, 32,182,193, 10,150,145,112, 0, 51, 63, 32,128, 5, 21, 0, 16, 64, 0, 0, };
12,150, 75, 75,107, 32,182,193, 10,150,145,112, 0, 51, 63, 32,128, 5, 21, 0, 16, 127, 0, 0, };
Byte code register_1080i_60[]={139,240,184, 56, 0,128, 88,150,235,160,128,128,128, 59,107, 85, 18, 3, 3,111,109,156,220,156, 3, 67,115, 0, 0, 4, 24, 0, 0, 0, 0, 0, 0,175,139,241,
0, 0, 0, 0, 0, 0, 0, 70, 42, 65,144,232,149, 7,192, 58,135, 98,255,228, 18, 73, 36, 67, 34, 34, 34, 42, 63,232, 31, 7, 38, 38, 38, 38, 38, 38, 38, 64,
0,102, 12, 48, 0, 57, 95,202, 0, 15,142, 56, 14, 10, 10, 10, 10, 32, 80, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47, 0, 36, 28, 1, 5, 0, 53, 84,
0,128, 18,250, 0, 0, 0,101, 4, 0, 12, 32, 26,122,228,100,209, 48,152, 8, 35,160, 62,225, 18, 73, 35,239, 6, 79,176, 3,169, 49, 76, 84,172,132, 20, 5,
5, 1, 64, 3, 28, 70, 40,201, 23, 66,152, 80, 43, 2, 64, 0,128, 52,179, 4, 4,195,192,129, 24, 5,220, 26, 48, 80, 40,192, 11, 35, 90, 1,140, 0,177,232,
// 12,150, 67, 75, 3, 8, 72,132, 42, 38, 14, 16, 0, 51, 0, 32,128, 5, 21, 0, 24, 64, 0, 0, };
12,150, 67, 75, 3, 8, 72,132, 42, 38, 14, 16, 0, 51, 0, 32,128, 5, 21, 0, 24, 127, 0, 0, };
Byte code register_1080p_50[]={83,176,184, 56, 0,128, 88,150,240,160,128,128,128, 59, 75, 85, 32, 15, 3,111,109,156,220,156, 3, 67,115, 0, 0, 4, 24, 0, 0, 0, 0, 0, 0,175, 83,177,
0, 0, 0, 0, 0, 0, 0, 3,208, 1,144,135,149, 7,192, 0, 0, 0,125,196,102,102,102,140, 24, 24, 24, 42, 20,104, 10, 1, 38, 33, 33, 33, 33, 33, 33, 69,
112,110, 13, 48, 0, 69,127,134, 0, 15,176, 68, 5, 7, 7, 7, 7, 32, 80, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47, 0, 36, 30, 1, 5, 0, 59, 84,
0,128, 18,250, 0, 0, 0,127, 5, 0, 12,102, 29,125,100,100,203,113, 44, 4, 0, 0, 62,224,230,102, 99,239, 6, 79,176, 3,169, 80, 23,168,172,132, 2, 0,
129, 64, 80, 3, 28,140,145,144,167, 2,137, 84, 25, 2, 15, 0,128, 52,176, 4, 4,195,192,128,167,131,132, 62,160, 80, 49, 88, 3,198, 10, 1, 4,128,121,232,
// 15,150, 70, 75,107, 40, 30, 1,109, 44, 35, 8, 0, 51, 15, 32,128, 5, 21, 0, 24, 64, 4, 0, };
15,150, 70, 75,107, 40, 30, 1,109, 44, 35, 8, 0, 51, 15, 32,128, 5, 21, 0, 24, 127, 4, 0, };
Byte code register_1080p_60[]={69,240,184, 56, 1, 64,255,200,240,170,128,128,128,191, 75, 85, 18, 15, 3,107,109,156,220,156, 3, 67,115, 0, 0, 4, 24, 0, 0, 0, 0, 0, 0,175,218,177,
0, 0, 0, 0, 0, 0, 0, 3,205, 65,144,139,149, 7,192, 0, 0, 0,125,196,102,102,102,140, 24, 24, 24, 42, 11,237, 80, 7, 40, 40, 40, 40, 40, 40, 40, 69,
112,110, 13, 48, 0, 69,127,134, 0, 15,176, 68, 5,251,251,251,251, 32, 80, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 47, 0, 36, 30, 1, 10, 0, 57, 4,
0,128, 18,250, 0, 0, 0,128, 6, 0, 10,108, 28, 79,228,100,202, 45, 24, 4, 0, 0, 62,225, 18, 73, 35,239, 6, 79,176, 3,169, 80, 23,168,172,132, 2, 0,
129, 64, 80, 3, 28,140,145,144,139, 2,249, 84, 25, 2, 64, 0,128, 52,176, 4, 4,195,192,128,139,227,132, 69,160, 83, 49, 88, 3,198, 10, 1, 4,128,121,232,
// 10,150, 66, 75, 3, 0, 30, 1,109, 19, 35, 8, 0, 51, 15, 32,128, 5, 21, 0, 8, 64, 4, 0,};
10,150, 66, 75, 3, 0, 30, 1,109, 19, 35, 8, 0, 51, 15, 32,128, 5, 21, 0, 8, 127, 4, 0,};
Byte code register_VGA640[]={149,240,184, 48, 0,128, 88,255,255,255,128,128,128,118,107, 80, 15, 3, 3,144,101,142,190,142, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,149,241,
0, 0, 0, 0, 0, 0, 0, 65,139, 65,145,184,149, 7,194, 58, 5, 25, 8, 68,102,102,102, 67, 32, 32, 32, 42, 51,225,100, 7, 33, 33, 33, 33, 33, 33, 33, 56,
241,208, 11, 29,162, 51, 47, 45,218,255, 73, 48, 8, 31, 31, 31, 31, 32, 80, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 0, 36, 30, 0, 10, 0, 61, 83,
8, 50, 18,250, 0, 0, 0, 48, 2, 0, 37, 66, 14, 23,228, 24,192, 0, 0, 8,103,211, 62,224,128, 0, 3,239, 6, 79,176,200,216,186,142,164,172,132, 20, 5,
5, 1, 64, 1,120, 65,136, 49, 43, 34,105, 80, 82,130, 64, 0,128, 52,179, 5, 5, 68, 0, 49, 44, 6,164, 28,128, 80, 40, 32, 17, 32,138, 1,130, 1, 17,232,
20,150, 74, 75, 3, 16,108, 1, 26, 80, 16, 25, 64, 51, 51, 32,128, 5, 21, 0, 24,127, 0, 0,};
Byte code register_VGA800[]={131, 48,184, 56, 0,128, 88,255,255,255,128,128,128, 50,107, 80, 15, 3, 3,180,101,142,190,142, 3, 67,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,218,177,
0, 0, 0, 0, 0, 0, 0, 78,103,129,145,254, 6, 3,248, 58, 5, 25,207,132,102,102,102, 67, 32, 32, 32, 42, 80, 37,118, 4, 35, 35, 35, 35, 35, 35, 35, 62,
17,250, 12, 29,108, 55,191, 26,215,175, 57, 52, 14, 31, 31, 31, 31, 32, 80, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 0, 36, 30, 1, 10, 0, 61, 83,
8, 50, 18,250, 0, 0, 0, 49, 1, 0, 25, 0, 14, 15,100,230,192, 0, 0, 6,153,179,190,224,153, 28,195,239, 6, 79,176,200,216,186,142,164,172,132, 20, 5,
5, 1, 64, 0, 80, 78,105,205, 6, 2,248, 80,137,130, 64, 0,128, 52,179, 5, 5, 68, 0, 49, 6,133,220, 24,128, 80, 41,176, 15, 38,250, 1,155, 0,241,232,
12,150, 74, 78,131,232,108,192,241,249, 19, 97, 64, 51, 51, 32,128, 5, 21, 0, 24,127, 0, 0,};
Byte code register_VGA1024[]={98, 96,184, 0, 0,128, 88,255,255,255,128,128,128,118,107, 80, 15, 3, 3,144,101,142,190,142, 3, 3,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,218,177,
0, 0, 0, 0, 0, 0, 0,100, 9,193,145, 69,149, 7,201, 58, 5, 25,164,228,102,102,102, 67, 32, 32, 32, 42,116,231,132, 3, 36, 36, 36, 36, 36, 36, 36, 60,
97,236, 11,205,126, 54, 63, 32,216,207, 62, 51, 7, 31, 31, 31, 31, 32, 80, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 0, 36, 30, 1, 10, 0, 61, 83,
8, 50, 18,248, 0, 0, 0, 48, 0,128, 51, 2, 14, 15,196, 24,192, 0, 0, 5, 62,153,190,224,196,130,179,239, 6, 79,176,200,216,186,142,164,172,132, 20, 5,
5, 1, 64, 2, 21,100,172,148,196, 34,200, 80, 51,130, 64, 0,128, 52,179, 5, 5, 68, 0, 48,196,228,176, 18,128, 80, 44,128, 20, 50, 90, 1,200, 1, 65,232,
15,150, 74, 75,147, 44,108, 1, 25,136,217, 1, 64, 51, 51, 32,128, 5, 21, 0, 24,127, 0, 0, };
#ifdef C4P43M
Word RDATA cfg_Limit[13][4] = { {250 ,330 ,240 ,289 },//480i
{250 ,330 ,290 ,360 },//576i
{120 ,160 ,510 ,549 },//480p
{120 ,160 ,610 ,630 },//576p
{105 ,129 ,730 ,760 },//720p50
{70 ,104 ,730 ,760 },//720p60
{135 ,180 ,550 ,580 },//1080i50
{100 ,134 ,550 ,580 },//1080i60
{73 ,100 ,1100,1170},//1080p50
{40 ,72 ,1100,1170},//1080p60
{80 ,100 ,790 ,820 },//VGA1024
{101 ,130 ,610 ,640 },//VGA800
{131 ,160 ,500 ,540 },//VGA640
};
#else
Word RDATA cfg_Limit[13][4] = /* { {600,950,230,296},//480i
{600, 950, 297 , 380 },//576i
{380 , 460 , 500, 540},//480p
{380, 460, 600, 640 },//576p
{330 ,390 ,730 ,760 },//720p50
{270 ,329, 730 ,760 },//720p60
{440 ,500 ,550 ,580 },//1080i50
{360 ,439 ,550 ,580 },//1080i60
{216 ,280 ,1100,1170},//1080p50
{160 ,215 ,1100, 1170},//1080p60
{240 ,320 ,790 ,820 },//VGA1024
{320 ,390 ,610 ,640 },//VGA800
{400 ,460 ,500 ,550 },//VGA640
};*/
{ {1300,1800,230,296},//480i
{1300, 1800, 297 , 380 },//576i
{800 , 900 , 500, 540},//480p
{800, 900, 600, 640 },//576p
{660 ,780 ,730 ,760 },//720p50
{540 ,659, 730 ,760 },//720p60
{880 ,1000 ,550 ,580 },//1080i50
{720 ,879 ,550 ,580 },//1080i60
{432 ,560 ,1100,1170},//1080p50
{320 ,431 ,1100, 1170},//1080p60
{480 ,640 ,790 ,820 },//VGA1024
{640 ,780 ,610 ,640 },//VGA800
{800 ,920 ,500 ,550 },//VGA640
};
#endif
static Byte XDATA work_ip_format = 0x0f;//当前的视频输入格式
static Byte XDATA work_ip_format_SWITCH[2] ={0x0f,0x0f};
//static Byte XDATA work_ip_format_vga=0x0f;
//0000 480i 0001 576i
//0110 480P 0111 576P 1000 720P/60
//1001 720P/50 1010 1080i/60 1011 1080i/50
//1111 N/A
//static Byte XDATA pre_ip_format=0x0f;//临时存储的视频输入格式,对应PLM1000芯片0x20,0x22.....
static Byte XDATA cur_ip_format;//当前读取的视频输入格式,对应PLM1000芯片0x20,0x22.....
static Byte XDATA filter_number[2]; //, filter_number_VGA;//各个芯片输入格式filter计数
static Byte XDATA VGA_Input = 2;
static Byte XDATA config_Second = 0 ;
static Byte XDATA Power_State = 1 ;//0-powerdown;1-powerup
static Byte XDATA Demo_Switch_2_On=1;
#if 0
static Byte XDATA jbl_bPreVGA = 0; // record the source state
#endif
static Byte XDATA pre_format[2]={0X0f,0x0f};
//static Byte XDATA pre_VGA_format=0X0f;
#if 0
static Byte XDATA filter_number_nosignal[2] = {0,0}; //, filter_number_VGA;//各个芯片输入格式filter计数
static Byte XDATA Detect_Num = 0;
//static Byte XDATA NoSignal_Num = 0;
#endif
static Word XDATA Loop_Number = 0 ;
static XDATA Byte phase;
static XDATA Byte phase_counter = 0;
static XDATA Byte AGCGain;
static XDATA Byte AGCth;
static XDATA char pre_sog = 0 ;
static XDATA Byte Demo_State_Machine = 0 ;
static XDATA Word DemoCounter = 0 ;
static XDATA Byte Jbl_Demo_PreState = 0xff;
static XDATA Byte jbl_DelayActive=FALSE;
static XDATA Byte jbl_DelayNum=0;
//Byte XDATA jbl_InputPortDetect;
#if 0
Byte XDATA jbl_bPreHD; //dh modify 071009
#endif
static Bool bRefresh= TRUE;
static Byte XDATA VII_status = 0 ;
static Byte XDATA pc_adjust_parameter[PC_ADJUST_PARA_MAX];
/*=======================================================================*/
/* L O C A L F U N C T I O N P R O T O T Y P E S */
/*=======================================================================*/
static void i2c_config(void);
static void VGA_config(Byte cur_ip_format);
static Byte Read_Ip_Format(Byte addr);
static void format_override(Byte addr , Byte force_ip_format);
static void Load_Config_Register(Byte ip_format);
static void Write_Enable(Bool Enable);
static void Phase_Adjustment(Byte cur_ip_format);
static void Phase_Manual_Adjustment(Byte value);
static void Config_Register_CE(Word V_Location,Word H_Location,Byte Demo_Left,Byte Demo_Up);
static void DemoControl(Bool onoff);
static void AGC_Adjustment(Byte format);
static void Switch_to_VGA(void);
static void Switch_to_HD(void);
static Bool Format_monitor(void);
static void jbl_Delay(void);
static void Write_HTV_Register(Byte slv_addr,
Byte cnt,
Byte RI2C_EXP_RAM *src_ptr,
Byte sub_addr);
static Byte Get_PCparameter_baseitem(PC_AjustParaEnum index);
/*=======================================================================*/
/* F U N C T I O N S */
/*=======================================================================*/
void aprv_HTVPLMTurnon(void)
{
Byte RI2C_EXP_RAM temp;
// pre_ip_format=0x0f;
work_ip_format=0x0f;
// Detect_Num=0;//dh modify 071011
if( Power_State == 1 )
return;
else
Power_State = 1;
/*dh add start*/
#if 0
jbl_bPreHD=0; //dh modify 071009
jbl_bPreVGA=0;
#endif
pre_format[0]=0x0f;
pre_format[1]=0x0f;
work_ip_format_SWITCH[0]=0x0f;
work_ip_format_SWITCH[1] =0x0f;
Write_Enable(TRUE);
for(temp =0 ; temp < 10 ; temp++)
rbsc_Wait100uSteps(255);
/*dh add end 070918*/
ri2c_ReadSub(PLM1000_ADDR,1,&temp,0x0f);
temp |= 0x01 ;
Write_HTV_Register(PLM1000_ADDR,1,&temp,0x0f);
for(temp =0 ; temp < 4 ; temp++)
rbsc_Wait100uSteps(255);
ri2c_ReadSub(PLM1000_ADDR,1,&temp,0x72);
temp &= ~0x40 ;
Write_HTV_Register(PLM1000_ADDR,1,&temp,0x72);
ri2c_ReadSub(PLM1000_ADDR,1,&temp,0x70);
temp &= 0xf1 ;
Write_HTV_Register(PLM1000_ADDR,1,&temp,0x70);
for(temp =0 ; temp < 4; temp++)
rbsc_Wait100uSteps(255);
ri2c_ReadSub(PLM1000_ADDR,1,&temp,0x70);
temp |= 0x0e ;
Write_HTV_Register(PLM1000_ADDR,1,&temp,0x70);
for(temp =0 ; temp < 4 ; temp++)
rbsc_Wait100uSteps(255);
ri2c_ReadSub(PLM1000_ADDR,1,&temp,0x72);
temp &= ~0x01 ;
Write_HTV_Register(PLM1000_ADDR,1,&temp,0x72);
#if 1
// jbl_UpdateRegister();
#endif
}
void aprv_HTVPLMTurnoff(void)
{
Byte RI2C_EXP_RAM temp;
if( Power_State == 0 )
return;
else
Power_State = 0;
// VGA_Input = 0
Write_Enable(TRUE);
for(temp =0 ; temp < 4 ; temp++)
rbsc_Wait100uSteps(255);
ri2c_ReadSub(PLM1000_ADDR,1,&temp,0x72);
temp |= 0x41 ;
Write_HTV_Register(PLM1000_ADDR,1,&temp,0x72);
ri2c_ReadSub(PLM1000_ADDR,1,&temp,0x0f);
temp &= ~(0x01) ;
Write_HTV_Register(PLM1000_ADDR,1,&temp,0x0f);
Write_Enable(FALSE);
}
//将addr所指的PLM1000芯片进行初始化
void aprv_HTVPLMInit(Byte source)
{
Byte i ,j;
Byte RI2C_EXP_RAM value = 175 ;
Write_HTV_Register(PLM1000_ADDR, 1, &value, 38); // force 38 to 175,for PLL issue [207-11-22]
if ( (source == FSRT_SRC_DVD))
{
for(i = 1 ; i <= sizeof(register_480i) ; i++)
{
// if(i > 27) // 28 - 47 not write the register
// j = i + 20;
// else
j = i;
value = register_480i[i-1] ;
Write_HTV_Register(PLM1000_ADDR, 1, &value, j);
}
}
else
{
for(i = 1 ; i <= sizeof(register_VGA640) ; i++)
{
if(i <6)
aprv_HTVPLMSetPCparameter(i);
// if(i > 27) // 25 - 47 not write the register
// j = i + 20;
// else
j = i;
value = register_VGA640[i-1] ;
Write_HTV_Register(PLM1000_ADDR, 1, &value, j);
}
}
i2c_config();
format_override(PLM1000_ADDR,15);
aprv_HTVPLMTurnon();
}
//运行配置
void aprv_HTVPLMUpdate(void)
{
Format_monitor();
}
Byte aprv_HTVPLMGetformat(void)
{
return (work_ip_format & 0x1f);
}
#if 0
Bool aprv_HTVPLMGetHDNoSignal(void)
{
return (((fsrt_GetCurrentSource() == FSRT_SRC_DVD)
||(fsrt_GetCurrentSource() == FSRT_SRC_RGB))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -