#include"sn8p_bias_lcd_driver.h"
//定义22幅画面
__ROM unsigned char
//SetMode
seg_code_1[4] = {0x40,0x20,0x68,0x20},//flash_1
seg_code_2[4] = {0x80,0xE0,0x60,0xA8},//flash_2
seg_code_3[4] = {0xC0,0x60,0x60,0x60},//flash_3
seg_code_4[4] = {0x00,0x20,0x20,0x20},//flash_none 0000 0000,0010 0000,0010 0000,0010 0000
//RunMode
seg_code_1r[28] =
{
0x40,0x20,0x68,0x20,
0x40,0x28,0x68,0x20,
0x48,0x28,0x68,0x20,
0x58,0x28,0x68,0x20,
0x58,0x38,0x68,0x20,
0x58,0x38,0x78,0x20,
0x58,0x38,0x78,0x30,
},
seg_code_2r[28] =
{
0x80,0xE0,0x60,0xA8,
0x80,0xE8,0x60,0xA8,
0x88,0xE8,0x60,0xA8,
0x98,0xE8,0x60,0xA8,
0x98,0xF8,0x60,0xA8,
0x98,0xF8,0x70,0xA8,
0x98,0xF8,0x70,0xB8,
},
seg_code_3r[28] =
{
0xC0,0x60,0x60,0xE0,
0xC0,0x68,0x60,0xE0,
0xC8,0x68,0x60,0xE0,
0xD8,0x68,0x60,0xE0,
0xD8,0x78,0x60,0xE0,
0xD8,0x78,0x70,0xE0,
0xD8,0x78,0x70,0xF0,
}
;
void dispp(unsigned char *pCode);
static void select_seg(unsigned char seg_x);
static void select_seg(unsigned char seg_x)
{
seg1 =(seg_x&0x80)>0x00?1:0;
seg2 =(seg_x&0x40)>0x00?1:0;
seg3 =(seg_x&0x20)>0x00?1:0;
seg4 =(seg_x&0x10)>0x00?1:0;
seg5 =(seg_x&0x08)>0x00?1:0;
}
void dispp(unsigned char *pCode)
{
static unsigned char ScanCount=0;
switch(ScanCount) //动态扫描显示
{
case 0: //com1正向驱动
select_seg(*pCode);
com1 = 0;
com1_m = 1;
com2_m = 0;
com3_m = 0;
com4_m = 0; //除com1输出外,其余com设为输入
break;
case 1: //com1反向驱动
select_seg(~*pCode);
com1 = 1;
break;
case 2: //com2正向驱动
select_seg(*(pCode+1));
com2 = 0;
com1_m = 0;
com2_m = 1;
com3_m = 0;
com4_m = 0;
break;
case 3: //com2反向驱动
select_seg(~*(pCode+1));
com2 = 1;
break;
case 4: //com3正向驱动
select_seg(*(pCode+2));
com3 = 0;
com1_m = 0;
com2_m = 0;
com3_m = 1;
com4_m = 0;
break;
case 5: //com3反向驱动
select_seg(~*(pCode+2));
com3 = 1;
break;
case 6: //com4正向驱动
select_seg(*(pCode+3));
com4 = 0;
com1_m = 0;
com2_m = 0;
com3_m = 0;
com4_m = 1;
break;
case 7: //com4反向驱动
select_seg(~*(pCode+3));//1111 1111
com4 = 1;
com1_m = 0;
com2_m = 0;
com3_m = 0;
com4_m = 1;
break;
default:
break;
}
ScanCount++;
if(ScanCount>=8)
{
ScanCount=0;
}
}