原创
LCD头文件、积存器、标志定义(电子表项目)
#ifndef __lcd__h__
#define __lcd__h__
#include<mcu.h>
//************************************************************************************
extern xdata uchar cnt_speed;
extern xdata uint cnt_dis;
extern xdata uint cnt_cal;
//=======================================
extern xdata uchar cnt_time_s;//秒
extern xdata uchar cnt_time_min;//分钟
//**************************************
extern xdata uchar cnt_inc;
//======================================
extern xdata uchar mode_buf;
uchar prog_buf;
extern xdata uint dis_float_buf;
//======================================
extern xdata uchar count1;
extern xdata uchar prog_3s;
//**************************************
extern xdata uint dis_10m;
extern xdata uint dis_init_buf;
extern xdata uint cal_14m;
extern xdata uint cal_init_buf;
//**************************************
extern xdata uint time_s;
extern xdata uchar time_prog_buf; //设置时要段数清零
extern xdata uint time_prog_count;
extern xdata uchar time_20ms;
extern uchar err;
extern uchar pulse_s1;
extern uchar fat_cnt;
extern uchar age; //年龄计数器
extern uchar high; //身高计数器
extern uchar weigh; //体重计数器
extern uchar sex; //性别计数器
extern xdata uchar fat_data;
extern xdata uchar twin; //卡路里计算
extern xdata uchar key_time_cnt;
//**************************************
extern bit bz_g1;
extern xdata uchar bz_count1;
extern xdata uint sert_key;
extern xdata uchar end_count;
extern xdata uint end_count1;
//======================================
bit speed_dp;
bit time_dp;
bit dis_dp2;
bit dis_dp3;
bit cal_dp2;
bit cal_dp3;
bit pulse_g;
bit st5sg;
//************************************************************************************
extern bit dis_flag;
extern bit prog_g;
extern bit cal_flag;
extern bit time_flag;
extern bit start_g;
extern bit stop_g;
extern bit speed_foot;
extern bit suspend_g;
extern bit prog_run_g;
extern bit F_relay;
extern bit error_g;
extern bit end_g;
extern bit key_down;
extern bit prog_3s_g;
//*******************
extern bit fat_run;
extern bit fat_sex;
extern bit fat_weigh;
extern bit fat_high;
extern bit fat_age;
extern bit fat_end;
extern bit bz_off;
//*******************
uchar start5s;
uchar start20ms;
//*************************************************************************************
//com1 com2 com3 com4 com5 com6 com7 com8 8位数据段码13-27
// laps D C E G B F A
//-------------------------------------------------------------------------------------
// A
// ********
// * *
// * *
// F * * B
// * *
// * G *
// *********
// * *
// * *
// E * * C
// * *
// * *
// ******** LAPS
// D
//***************************************************************************
uchar code Lap_Tab[10]={0xf7,0xa4,0xdd,0xed,0xae,0xeb,0xfb,0xa5,0xff,0xef};
uchar code Lap_add[2]={188,184};//lap地址
extern xdata uchar cnt_lap;
extern xdata uchar cnt_lap_buf;
//*************************************************************************************
//com1 com2 com3 com4 com5 com6 com7 com8 8位数据段码13-27
// A F B G E C D
//-------------------------------------------------------------------------------------
// A
// ********
// * *
// * *
// F * * B
// * *
// * G *
// *********
// * *
// * *
// E * * C
// * *
// * *
// ******** * 其它符号或小数点
// D
//***************************************************************************
uchar code DataTab[17]={0xee,0x24,0xba,0xb6,0x74,0xd6,0xde,0xa4,0xfe,0xf6,0xf8,0xda,0xd8,0xfc,0x5a,0x1c,0x3e};//0-9,P,E,F,A,T,N,D
//*************************************************************************************
//com1 com2 com3 com4 com5 com6 com7 com8
// A I J B K L C
//com1 com2 com3 com4 com5 com6 com7 com8
// F H G E N M D
//-------------------------------------------------------
// A
// ******************
// * * *
// * * H *I J* *
// F * * * * * B
// * * * * *
// * G * * * K *
// ******** ********
// * * * * *
// * N * * * L *
// E * * * * * C
// * * *M * *
// * * *
// *****************
// D
uchar code spd_data [10][2]={0x92,0x92,0x12,0x00,0x98,0x32,0x9a,0x22,0x1a,0xa0,
0x8a,0xa2,0x8a,0xb2,0x92,0x00,0x9a,0xb2,0x9a,0xa2,};//0-9,a-z 26+10=36个数据
//************************************************************************************************************
uchar code spd_address[12]={120,112,104,96,88,80,72,64,56,48,40,32};//1-12 12个地址每地址寻址位为2=24位地址
//************************************************************************************************************
/**************************************************************************************
* 名 称: 数据结构在RAM区
* 功 能: 写命令模式
**************************************************************************************/
xdata struct lcd_da{
uchar pulse[3];
uchar dis[4];
uchar cal[4];
uchar time[4];
}LcdDa,*sp;
/**************************************************************************************
* 名 称: 地址结构体在code区固定
* 功 能: 写命令模式
**************************************************************************************/
/**************************************************************************************
* 名 称: 地址结构体在code区固定
* 功 能: 写命令模式
**************************************************************************************/
typedef code struct address{
uchar p[3];
uchar t[4];
uchar d[4];
uchar c[4];
};
struct address Address={{196,200,204},{208,212,216,220},{224,228,232,236},{240,244,248,252}};
//**************************************************************************************
extern void WrByte(uchar i,uchar j);
extern void bit1(void);
extern void bit0(void);
void wr_1625(void);
extern void get_key();
extern void bz_on();
//**************************************************************************************
#endif
文章评论(0条评论)
登录后参与讨论