📄 osd_dis_lib.c
字号:
uchar floor_h;
uchar floor_m;
uchar floor_l;
uint mm,nn,u_u;
char dis_types;
uint disappear_time;
uint sheding_time;
uchar xj;
uchar yy;
uchar cy;
uchar xx;
//#define text_b_c 2
//#define text_color C_COLOR_BLUE
//#define text_AT_sw 0
idata union
{
uchar Serial_Communication_Data_Buffer[80]; //二进制收码缓存&
struct text_x
{
uchar text_1[20];
uchar text_2[8];
uchar text_3[8];
uint text_4[8];
uint text_5[8];
uint text_6[20];
}u;
}h={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; /*初始化为空格*/
/********************************************************************************************************
** 函数名称:
** 功能描述:
********************************************************************************************************/
void row_1_text()
{
uchar i;
for(i=0;i<20;i++)
{
MB90092_DisChar (1+i,cy, h.u.text_1[i], 2, 2,C_COLOR_BLUE,0);
}
}
void row_2_text()
{
uchar i;
for(i=0;i<8;i++)
{
MB90092_DisChar (2+i,2, h.u.text_2[i]+u_u, 2, 2,C_COLOR_BLUE,0);
}
}
void row_3_text()
{
uchar i;
for(i=0;i<8;i++)
{
MB90092_DisChar (2+i,4, h.u.text_3[i]+mm, 2,2,C_COLOR_BLUE,0);
}
}
void row_4_text()
{
uchar i;
for(i=0;i<8;i++)
{
MB90092_DisChar (1+i,6, h.u.text_4[i]+mm, 3, 2,C_COLOR_BLUE,0);
}
}
void row_5_text()
{
uchar i;
for(i=0;i<8;i++)
{
MB90092_DisChar (1+i,8, h.u.text_5[i]+nn, 3, 2,C_COLOR_BLUE,0);
}
}
void row_6_text()
{
uchar i;
for(i=0;i<20;i++)
{
MB90092_DisChar (4+i,xx, h.u.text_6[i], 0, 2,C_COLOR_BLUE,0);
}
}
// dis part
//uchar arrow_space_x,arrow_space_y,arrow_size,arrow_b_c; arrow_color,arrow_AT_sw;
//uchar floor_space_x,floor_space_y,floor_size,floor_b_c; floor_color,floor_AT_sw;
// dis part end
/*********************************************************************************************************
** 函数名称: floor()
** 功能描述: 显示楼层值floor_h,floor_l
********************************************************************************************************/
void dis_floor()
{
h.u.text_1[yy+2]= floor_h;
h.u.text_1[yy+3]= floor_m;
h.u.text_1[yy+4]= floor_l;
h.u.text_1[yy+5]= 0xff;
h.u.text_1[yy+6]= 0xff;
}
/*********************************************************************************************************
** 函数名称: dis_number()
** 功能描述: 显示楼梯号
********************************************************************************************************/
void dis_number(uchar *t_h)
{
h.u.text_1[7] = 0xff;
h.u.text_1[8] = 0xff;
h.u.text_1[9] = 0xff;
h.u.text_1[xj] = 0xff;
h.u.text_1[xj+1] = *t_h;
h.u.text_1[xj+2] = *(t_h+1);
h.u.text_1[xj+3] = *(t_h+2);
h.u.text_1[xj+4] = *(t_h+3);
h.u.text_1[xj+5] = *(t_h+4);
h.u.text_1[xj+6]= 0xff;
h.u.text_1[17]= 0xff;
h.u.text_1[18] = 0xff;
h.u.text_1[19] = 0xff;
}
/*********************************************************************************************************
** 函数名称: up_arrow() and down_arrow()
** 功能描述: OSD图形:上下箭头
********************************************************************************************************/
void up_arrow_stop()
{
h.u.text_1[yy] = 0xff;
h.u.text_1[yy+1] = 0x4f;
}
void down_arrow_stop()
{
h.u.text_1[yy] = 0xff;
h.u.text_1[yy+1] = 0x5f;
}
void up_arrow()
{
h.u.text_1[yy] = 0xff;
h.u.text_1[yy+1] = 0x3f;
}
void down_arrow()
{
h.u.text_1[yy] = 0xff;
h.u.text_1[yy+1] = 0x2f;
}
void stop()
{
h.u.text_1[yy] = 0xff;
h.u.text_1[yy+1] = 0xff;
}
/*
void dis_mode( uchar n_t )
{
h.u.text_2[0] = 0xff;
h.u.text_2[1] = 0x84;
h.u.text_2[2] = 0x85;
h.u.text_2[3] = 0x86;
h.u.text_2[4] = 0x87;
h.u.text_2[5] = n_t;
h.u.text_2[6] = 0xff;
h.u.text_2[6] = 0xff;
}
*/
void dis_pv_set()
{
h.u.text_2[0] = 0xff;
h.u.text_2[1] = 0xff;
h.u.text_2[2] = 0x89;
h.u.text_2[3] = 0x8a;
h.u.text_2[4] = 0x69;
h.u.text_2[5] = 0x4a;
h.u.text_2[6] = 0xff;
h.u.text_2[6] = 0xff;
}
void dis_p_set()
{
h.u.text_2[0] = 0x89;
h.u.text_2[1] = 0x8a;
h.u.text_2[2] = 0x8b;
h.u.text_2[3] = 0x8c;
h.u.text_2[4] = 0x69;
h.u.text_2[5] = 0x4a;
h.u.text_2[6] = 0xff;
h.u.text_2[6] = 0xff;
}
void dis_v_set()
{
h.u.text_2[0] = 0x89;
h.u.text_2[1] = 0x8a;
h.u.text_2[2] = 0x80;
h.u.text_2[3] = 0x81;
h.u.text_2[4] = 0x69;
h.u.text_2[5] = 0x4a;
h.u.text_2[6] = 0xff;
h.u.text_2[6] = 0xff;
}
void dis_time_set()
{
h.u.text_2[0] = 0xff;
h.u.text_2[1] = 0x44;
h.u.text_2[2] = 0x49;
h.u.text_2[3] = 0x69;
h.u.text_2[4] = 0x4A;
h.u.text_2[5] = 0xFF;
h.u.text_2[6] = 0xff;
h.u.text_2[7] = 0xff;
}
void dis_back()
{
h.u.text_2[0] = 0x76;
h.u.text_2[1] = 0x77;
h.u.text_2[2] = 0x78;
h.u.text_2[3] = 0x79;
h.u.text_2[4] = 0x69;
h.u.text_2[5] = 0x4a;
h.u.text_2[6] = 0xff;
h.u.text_2[7] = 0xff;
}
//---------------------------------------
void dis_mode_set()
{
h.u.text_2[0] = 0xff;
h.u.text_2[1] = 0x84;
h.u.text_2[2] = 0x85;
h.u.text_2[3] = 0x86;
h.u.text_2[4] = 0x87;
h.u.text_2[5] = 0x69;
h.u.text_2[6] = 0x4a;
h.u.text_2[7] = 0xff;
}
void dis_floor_set()
{
h.u.text_2[0] = 0xff;
h.u.text_2[1] = 0xff;
h.u.text_2[2] = 0x4d;
h.u.text_2[3] = 0x4c;
h.u.text_2[4] = 0x69;
h.u.text_2[5] = 0x4a;
h.u.text_2[6] = 0xff;
h.u.text_2[7] = 0xff;
}
void exit()
{
h.u.text_2[0] = 0xff;
h.u.text_2[1] = 0x7a;
h.u.text_2[2] = 0xff;
h.u.text_2[3] = 0x50;
h.u.text_2[4] = 0xff;
h.u.text_2[5] = 0x51;
h.u.text_2[6] = 0xff;
h.u.text_2[7] = 0xff;
}
void dis_floor_seting(uchar num)
{
h.u.text_2[0] = 0xff;
h.u.text_2[1] = 0xff;
h.u.text_2[2] = 0x4d;
h.u.text_2[3] = 0x4c;
h.u.text_2[4] = 0x69;
h.u.text_2[5] = 0x4a;
h.u.text_2[6] = num;
h.u.text_2[7] = 0xff;
}
void year_set(uchar nian)
{
// h.u.text_2[0] = 0xff;
// h.u.text_2[1] = 0x44;
// h.u.text_2[2] = 0x49;
// h.u.text_2[3] = 0x69;
// h.u.text_2[4] = 0x4a;
// h.u.text_2[5] = 0xff;
h.u.text_2[6] = 0x40;
h.u.text_2[7] = nian;
}
void mon_set(uchar yue)
{
// h.u.text_2[0] = 0xff;
// h.u.text_2[1] = 0x44;
// h.u.text_2[2] = 0x49;
// h.u.text_2[3] = 0x69;
// h.u.text_2[4] = 0x4a;
// h.u.text_2[5] = 0xff;
h.u.text_2[6] = 0x41;
h.u.text_2[7] = yue;
}
void date_set(uchar ri)
{
// h.u.text_2[0] = 0xff;
// h.u.text_2[1] = 0x44;
// h.u.text_2[2] = 0x49;
// h.u.text_2[3] = 0x69;
// h.u.text_2[4] = 0x4a;
// h.u.text_2[5] = 0xff;
h.u.text_2[6] = 0x42;
h.u.text_2[7] = ri;
}
void day_set()
{
// h.u.text_2[0] = 0xff;
// h.u.text_2[1] = 0x44;
// h.u.text_2[2] = 0x49;
// h.u.text_2[3] = 0x69;
// h.u.text_2[4] = 0x4a;
// h.u.text_2[5] = 0xff;
h.u.text_2[6] = 0x43;
h.u.text_2[7] = 0xff;
}
void hr_set(uchar shi)
{
// h.u.text_2[0] = 0xff;
// h.u.text_2[1] = 0x44;
// h.u.text_2[2] = 0x49;
// h.u.text_2[3] = 0x69;
// h.u.text_2[4] = 0x4a;
// h.u.text_2[5] = 0xff;
h.u.text_2[6] = 0x44;
h.u.text_2[7] = shi;
}
void min_set(uchar fen)
{
// h.u.text_2[0] = 0xff;
// h.u.text_2[1] = 0x44;
// h.u.text_2[2] = 0x49;
// h.u.text_2[3] = 0x69;
// h.u.text_2[4] = 0x4a;
// h.u.text_2[5] = 0xff;
h.u.text_2[6] = 0x45;
h.u.text_2[7] = fen;
}
void sec_set(uchar miao)
{
// h.u.text_2[0] = 0xff;
// h.u.text_2[1] = 0x44;
// h.u.text_2[2] = 0x49;
// h.u.text_2[3] = 0x69;
// h.u.text_2[4] = 0x4a;
// h.u.text_2[5] = 0xff;
h.u.text_2[6] = 0x46;
h.u.text_2[7] = miao;
}
void dis_ioc()
{
h.u.text_2[0] = 0xff;
h.u.text_2[1] = 0x3b;
h.u.text_2[2] = 0x3c;
h.u.text_2[3] = 0x3d;
h.u.text_2[4] = 0x3e;
h.u.text_2[5] = 0x7d;
h.u.text_2[6] = 0x7e;
h.u.text_2[7] = 0xff;
}
void dis_udc()
{
h.u.text_2[0] = 0x5b;
h.u.text_2[1] = 0x5c;
h.u.text_2[2] = 0x4d;
h.u.text_2[3] = 0x4c;
h.u.text_2[4] = 0x70;
h.u.text_2[5] = 0x72;
h.u.text_2[6] = 0x7d;
h.u.text_2[7] = 0x7e;
}
void dis_lrc()
{
h.u.text_2[0] = 0x5b;
h.u.text_2[1] = 0x5c;
h.u.text_2[2] = 0x4d;
h.u.text_2[3] = 0x4c;
h.u.text_2[4] = 0x8d;
h.u.text_2[5] = 0x88;
h.u.text_2[6] = 0x7d;
h.u.text_2[7] = 0x7e;
}
void dis_dtc()
{
h.u.text_2[0] = 0x42;
h.u.text_2[1] = 0x5a;
h.u.text_2[2] = 0x44;
h.u.text_2[3] = 0x49;
h.u.text_2[4] = 0x84;
h.u.text_2[5] = 0x85;
h.u.text_2[6] = 0x7d;
h.u.text_2[7] = 0x7e;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -