⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd_screen.c

📁 1、arm7芯片2148驱动大液晶 2、ym320240的液晶驱动 3、I2c通信at24c256 4、各种字符的显示
💻 C
📖 第 1 页 / 共 5 页
字号:
		LCD_WR_Singer_24x24(0, Testing_24x24_addr_x1, Testing_24x24_addr_y, 2, (Uchar8 *)&WorkMode_code_24[0][0]);			 //显示“自动,手动”
	}
	else 				  //表示自动
	{
		LCD_WR_Singer_24x24(0, Testing_24x24_addr_x1, Testing_24x24_addr_y, 2, (Uchar8 *)&WorkMode_code_24[2][0]);			 //显示“自动,手动”
	}

    if(((temp_v == 0x80) && (Parameter_Setup.Hv_Channels == 0)) || ((temp_v != 0x80) && (Parameter_Setup.Lv_Channels == 0)))
	{
		LCD_WR_Singer_24x24(0, TongDaoCheShi_24x24_addr_x1, TongDaoCheShi_24x24_addr_y, 1, (Uchar8 *)&DanSan_code_24[0][0]);			 //显示“单三”
		if(temp_y == 0)   //表示第一项
		{
			LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x1, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[0]);			 			//显示“Rab”
		}
		else if(temp_y == 1)   //表示第二项
		{
			LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x1, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[3]);			 			//显示“Rbc”
		}
		else 				  //表示第二项
		{
			LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x1, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[6]);			 			//显示“Rbc”
		}
			//显示直流电阻
		Account_R_V_A_RATE(0, Temp_Test_buf[0][0]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x11, Testing_Data_8x8_addr_y2, 8, (Uchar8 *)&Disp_buf[0]);						 //直流电阻

		Account_R_V_A_RATE(1, Temp_Test_buf[1][0]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x11, Testing_Data_8x8_addr_y3, 8, (Uchar8 *)&Disp_buf[0]);						 //显示实时电压

		Account_R_V_A_RATE(2, Temp_Test_buf[2][0]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x11, Testing_Data_8x8_addr_y4, 8, (Uchar8 *)&Disp_buf[0]);						 //显示实时电压
	}	
	else if(((temp_v == 0x80) && (Parameter_Setup.Hv_Channels != 0)) || ((temp_v != 0x80) && (Parameter_Setup.Lv_Channels != 0)))
	{
		LCD_WR_Singer_24x24(0, TongDaoCheShi_24x24_addr_x1, TongDaoCheShi_24x24_addr_y, 1, (Uchar8 *)&DanSan_code_24[1][0]);			 //显示“单三”
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x1, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[9]);			 			//显示“Rao”
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x2, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[12]);			 			//显示“Rbo”
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x3, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[15]);			 			//显示“Rco”
			//显示直流电阻
		Account_R_V_A_RATE(0, Temp_Test_buf[0][0]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x11, Testing_Data_8x8_addr_y2, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻

		Account_R_V_A_RATE(0, Temp_Test_buf[0][1]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x21, Testing_Data_8x8_addr_y2, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻

		Account_R_V_A_RATE(0, Temp_Test_buf[0][2]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x31, Testing_Data_8x8_addr_y2, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻

			//显示实时电压

		Account_R_V_A_RATE(1, Temp_Test_buf[1][0]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x11, Testing_Data_8x8_addr_y3, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻

		Account_R_V_A_RATE(1, Temp_Test_buf[1][1]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x21, Testing_Data_8x8_addr_y3, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻

		Account_R_V_A_RATE(1, Temp_Test_buf[1][2]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x31, Testing_Data_8x8_addr_y3, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻
			//显示实时电流
		Account_R_V_A_RATE(2, Temp_Test_buf[2][0]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x11, Testing_Data_8x8_addr_y4, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻

		Account_R_V_A_RATE(2, Temp_Test_buf[2][1]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x21, Testing_Data_8x8_addr_y4, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻

		Account_R_V_A_RATE(2, Temp_Test_buf[2][2]);
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x31, Testing_Data_8x8_addr_y4, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻
	}

	if(Scan_num > 1)				 //表示扫描了两次,计算比率
	{
		if(((temp_v == 0x80) && (Parameter_Setup.Hv_Channels == 0)) || ((temp_v != 0x80) && (Parameter_Setup.Lv_Channels == 0)))
		{
			if((Temp_Test_buf[0][0] != 0xffffffff) && (Temp_Test_bak_buf[0][0] != 0xffffffff))
			{
				temp_data = Account_error(Temp_Test_bak_buf[0][0], Temp_Test_buf[0][0]);
				Account_R_V_A_RATE(3, temp_data);
				LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x11, Testing_Data_8x8_addr_y5, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻
			}
		}
		else if(((temp_v == 0x80) && (Parameter_Setup.Hv_Channels != 0)) || ((temp_v != 0x80) && (Parameter_Setup.Lv_Channels != 0)))
		{
			if((Temp_Test_buf[0][0] != 0xffffffff) && (Temp_Test_bak_buf[0][0] != 0xffffffff))
			{
				temp_data = Account_error(Temp_Test_bak_buf[0][0], Temp_Test_buf[0][0]);
				Account_R_V_A_RATE(3, temp_data);
				LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x11, Testing_Data_8x8_addr_y5, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻
			}
			if((Temp_Test_buf[0][1] != 0xffffffff) && (Temp_Test_bak_buf[0][1] != 0xffffffff))
			{
				temp_data = Account_error(Temp_Test_bak_buf[0][1], Temp_Test_buf[0][1]);
				Account_R_V_A_RATE(3, temp_data);
				LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x21, Testing_Data_8x8_addr_y5, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻
			}
			if((Temp_Test_buf[0][2] != 0xffffffff) && (Temp_Test_bak_buf[0][2] != 0xffffffff))
			{
				temp_data = Account_error(Temp_Test_bak_buf[0][2], Temp_Test_buf[0][2]);
				Account_R_V_A_RATE(3, temp_data);
				LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x31, Testing_Data_8x8_addr_y5, 8, (Uchar8 *)&Disp_buf[0]);						 //显示直流电阻
			}
		}
	}
	// 计算载流时间:
	temp_data = (Time_Data.DD * 24 + Time_Data.HH) * 3600 + Time_Data.MI * 60 + Time_Data.SS;
	temp_data1 = (Scan_Time_Data.DD * 24 + Scan_Time_Data.HH) * 3600 + Scan_Time_Data.MI * 60 + Scan_Time_Data.SS;
	temp_data = temp_data - temp_data1;
	temp_data1 = (temp_data / 3600);	//计算小时 
	Account_num(3, temp_data1);
	if(num_buf[0] == 0)					//消隐显示"0"
	{
		num_buf[0] = 65;
	}	
	LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x111, Testing_Data_8x8_addr_y6, 3, (Uchar8 *)&num_buf[0]);						 //显示直流电阻
	temp_data = temp_data % 3600;	//计算分 
	temp_data1 = temp_data / 60;	//计算分 
	if(temp_data1 > 999)		   //防止时间溢出
	{
		temp_data1 = 999;
	}
	Account_num(2, temp_data1);
	LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x112, Testing_Data_8x8_addr_y6, 2, (Uchar8 *)&num_buf[0]);						 //显示直流电阻
	
	temp_data1 = temp_data % 60;	//计算秒 
	Account_num(2, temp_data1);
	LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x113, Testing_Data_8x8_addr_y6, 2, (Uchar8 *)&num_buf[0]);						 //显示直流电阻

	for(m = 0; m < 3; m++)
	{
		for(n = 0; n < 3; n++)
		{
			Temp_Test_bak_buf[m][n] = Temp_Test_buf[m][n];
			Test_Data++; 
		}
	}
}
/*********************************************************************************************************
** 函数名称:void Dis_Lcd_Start(void)
** 输 入: 
			T_Cursor光标的位置 最高位为1表示HV,0表示LV ,高位的低七位表示行(< 19),低位表示列( < 3);
			T_Data1,数据1,单通道三通道此位数据都有效
			T_Data2,数据1,三通道此位数据都有效,单通道无效
			T_Data3,数据1,三通道此位数据都有效,单通道无效

** 输 出: 
** 全局变量: 无
** 调用模块: 无
** 作 者: 邱志城
** 日 期: 2008_08_21
** 功能描述: 写温度16*8
********************************************************************************************************/
void Dis_Lcd_Test_State(Ushort16 T_Cursor)
{
	Uchar8 temp_x, temp_y, temp_v;
	Uchar8 temp_buf[20];

	temp_v = (T_Cursor& 0x8000) >> 8;			//记算是 HV还是LV;
	temp_x = (T_Cursor >> 8) & 0x7f;			//记算X的位置
	temp_y = T_Cursor  & 0x00ff;			//记算y的位置
	if(temp_x > 18)		  temp_x = 18;
	if(temp_y > 2)		  temp_y = 2;

	temp_buf[0] = CHAR_R; 							 //写“R”
	temp_buf[1] = CHAR_a; 							 //写“a”
	temp_buf[2] = CHAR_b; 							 //写“b”
	temp_buf[3] = CHAR_R; 							 //写“R”
	temp_buf[4] = CHAR_b; 							 //写“b”
	temp_buf[5] = CHAR_c;							 //写“c”
	temp_buf[6] = CHAR_R; 							 //写“R”
	temp_buf[7] = CHAR_c; 							 //写“c”
	temp_buf[8] = CHAR_a;							 //写“a”

	temp_buf[9] = CHAR_R; 							 //写“R”
	temp_buf[10] = CHAR_a; 							 //写“a”
	temp_buf[11] = CHAR_o; 							 //写“o”
	temp_buf[12] = CHAR_R; 							 //写“R”
	temp_buf[13] = CHAR_b; 							 //写“b”
	temp_buf[14] = CHAR_o;							 //写“o”
	temp_buf[15] = CHAR_R; 							 //写“R”
	temp_buf[16] = CHAR_c; 							//写“c”
	temp_buf[17] = CHAR_o;							//写“o”

	temp_buf[18] = (temp_x + 1) / 10;						//显示分接点的位置
	temp_buf[19] = (temp_x + 1) % 10; 

	if(temp_v == 0x80)			//表示高压侧
	{
		LCD_WR_string_16x16(0, CurrentFenJieAddress_16x16_addr_x4, CurrentFenJieAddress_16x16_addr_y, 1, (Uchar8 *)&Testing_Voltage_code_16[0][0]);		//显示“高”
	}
	else 					  //表示低压侧
	{
		LCD_WR_string_16x16(0, CurrentFenJieAddress_16x16_addr_x4, CurrentFenJieAddress_16x16_addr_y, 1, (Uchar8 *)&Testing_Voltage_code_16[1][0]);		//显示“低”
	}
	LCD_WR_string_8x8(0, CurrentFenJieAddress_16x16_addr_x5, CurrentFenJieAddress_16x16_addr_y1, 2, (Uchar8 *)&temp_buf[18]);		//显示“分接点号”

	if(((temp_v == 0x80) && (Parameter_Setup.Hv_Channels == 0)) || ((temp_v != 0x80) && (Parameter_Setup.Lv_Channels == 0)))
	{
		LCD_WR_Singer_24x24(0, TongDaoCheShi_24x24_addr_x1, TongDaoCheShi_24x24_addr_y, 1, (Uchar8 *)&DanSan_code_24[0][0]);			 //显示“单三”
		if(temp_y == 0)   //表示第一项
		{
			LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x1, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[0]);			 			//显示“Rab”
		}
		else if(temp_y == 1)   //表示第二项
		{
			LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x1, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[3]);			 			//显示“Rbc”
		}
		else 				  //表示第二项
		{
			LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x1, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[6]);			 			//显示“Rbc”
		}
	}	
	else if(((temp_v == 0x80) && (Parameter_Setup.Hv_Channels != 0)) || ((temp_v != 0x80) && (Parameter_Setup.Lv_Channels != 0)))
	{
		LCD_WR_Singer_24x24(0, TongDaoCheShi_24x24_addr_x1, TongDaoCheShi_24x24_addr_y, 1, (Uchar8 *)&DanSan_code_24[1][0]);			 //显示“单三”
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x1, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[9]);			 			//显示“Rao”
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x2, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[12]);			 			//显示“Rbo”
		LCD_WR_string_8x8(0, Testing_Data_8x8_addr_x3, Testing_Data_8x8_addr_y1, 3, (Uchar8 *)&temp_buf[15]);			 			//显示“Rco”
    }

	if(Parameter_Setup.Work_Mode == 0)		//表示手动
	{
		LCD_WR_Singer_24x24(0, Testing_24x24_addr_x1, Testing_24x24_addr_y, 2, (Uchar8 *)&WorkMode_code_24[0][0]);			 //显示“自动,手动”
	}
	else 				  //表示自动
	{
		LCD_WR_Singer_24x24(0, Testing_24x24_addr_x1, Testing_24x24_addr_y, 2, (Uchar8 *)&WorkMode_code_24[2][0]);			 //显示“自动,手动”
	}
}

/*********************************************************************************************************
** 函数名称:void Dis_Lcd_Start(void)
** 输 入: 
			T_Cursor光标的位置 最高位为1表示HV,0表示LV ,高位的低七位表示行(< 19),低位表示列( < 3);
			T_Data1,数据1,单通道三通道此位数据都有效
			T_Data2,数据1,三通道此位数据都有效,单通道无效
			T_Data3,数据1,三通道此位数据都有效,单通道无效

** 输 出: 
** 全局变量: 无
** 调用模块: 无
** 作 者: 邱志城
** 日 期: 2008_08_21
** 功能描述: 写温度16*8
********************************************************************************************************/
void Deal_Lcd_Testing(void)
{
    Uchar8 temp_Project;
	temp_Project = 0;

	Dis_Lcd_Test_State(Cursor_num);		 //显示设置值
	while((Screen_num == 4) && (temp_Project != 3))
	{
		Key_Code = Key_Num(Key_Normal_code);
		switch(Key_Code)
		{
			case 7:							//表示按确定键
				temp_Project = 3;
                Screen_num = 3;         //显示提示界面
                Scan_num = 1;
				break;
		}
        Dis_Lcd_Test_Wr(Cursor_num, Testing_Data_buf[0]);     //显示更新的数据
	}
}


/*********************************************************************************************************
** 函数名称:void Dis_Lcd_Start(void)
** 输 入: 
			T_Cursor光标的位置 最高位为1表示HV,0表示LV ,高位的低七位表示行(< 19),低位表示列( < 3);
			T_Data1,数据1,单通道三通道此位数据都有效
			T_Data2,数据1,三通道此位数据都有效,单通道无效
			T_Data3,数据1,三通道此位数据都有效,单通道无效

** 输 出: 
** 全局变量: 无
** 调用模块: 无
** 作 者: 邱志城
** 日 期: 2008_08_21
** 功能描述: 写温度16*8
********************************************************************************************************/
void Save_Data_Disp(Uchar8 T_Current)
{
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -