📄 ht1621.lst
字号:
283 2 icID=0; //显示的第二行后4个字符(location=16-19)为第一芯片(icID=0)的12-15
284 2 location=location-4;
285 2 }
286 1 else if ((location>=20) && (location<=31)){
287 2 icID=1; //显示的第二行字符(location=20-31)为第二芯片(icID=1)的4-15
288 2 location=location-16;
289 2 }
290 1 //第芯片显示位置为倒序排列
291 1 if(icID == 1) location=15-location;
292 1
293 1 //前12个字符为一个表
294 1 if(location<12)
295 1 {
296 2 if(!icID)
297 2 {
298 3 Font = FontTab1[character] & (m_DisplayDriveBuf[icID][location]|0x7f);
C51 COMPILER V8.06 HT1621 02/13/2009 09:29:11 PAGE 6
299 3 EnableFirstHT1621();
300 3 }
301 2 else
302 2 {
303 3 Font = FontTab1[character];
304 3 Font = (Font<<4)|(Font>>4);
305 3 Font = Font&(m_DisplayDriveBuf[icID][location]|0xf7);
306 3 EnableSecondHT1621();
307 3 }
308 2
309 2 }
310 1 //后4个字符为一个表
311 1 else
312 1 {
313 2 if(!icID) //0路
314 2 {
315 3 Font = FontTab2[character] & (m_DisplayDriveBuf[icID][location]|0xef);
316 3 EnableFirstHT1621();
317 3 }
318 2 else//1路
319 2 {
320 3
321 3 Font = FontTab2[character];
322 3 Font = (Font<<4)|(Font>>4);
323 3 EnableSecondHT1621();
324 3 if(location != 13)//第12个字符的真值表特殊
325 3 {
326 4 Font = Font&(m_DisplayDriveBuf[icID][location]|0xfe);
327 4 }
328 3 else
329 3 {
330 4 Font = (Font&0xf0)|(((Font>>1)&0x0f)|0x08);
331 4 Font = Font&(m_DisplayDriveBuf[icID][location]|0xf7);
332 4 }
333 3 }
334 2 }
335 1 m_DisplayDriveBuf[icID][location] = Font;
336 1 SendDataHead();//101
337 1 SendAddress(location*2);
338 1 SendOneByte(Font); //一次写一字节
339 1 HT1621CS1 = 1;
340 1 HT1621CS2 = 1;
341 1 }
342
343 /*****************************************************************
344 //特殊段的显示
345 //enable: 0不显示 1显示
346 //icid: 特殊段所属1621
347 //addr: 特殊段在显示缓冲区中所在位置
348 //ciid = 0
349 //addr 0 1 2 3 4 5 6 7 8
350 //字符 号码 时间符C1 起始时间 去电 通话时长 时间符C2 优惠 时间符C4 小数点C7
351 // 9 10 11 12 13 14 15
352 // 来电 通讯 星期 合计 小数点C6 序号 锁
353 //ciid = 1
354 //addr 0 1 2 3 4 5 6 7 8
355 //字符 小数点S6 小数点S5 时间符D6 小数点S4 时间符D5 挂机话柄S10 时间符D4 小数点S3 小数点S2
356 // 9 10 11 12 13 14 15
357 // 小数点S1 时间符D2 摘机话柄S11 时间符D3 时间符D1 话费S7 话机座S9
358 ******************************************************************/
359 void Display_Exe(bit Enable,unsigned char icID , unsigned char Addr)
360 {
C51 COMPILER V8.06 HT1621 02/13/2009 09:29:11 PAGE 7
361 1 if(Enable)//显示
362 1 {
363 2 if(!icID) //0路
364 2 {
365 3 EnableFirstHT1621();
366 3 if(Addr<12)//前半字模
367 3 {
368 4 m_DisplayDriveBuf[0][Addr] = m_DisplayDriveBuf[0][Addr]|0x80;
369 4 }
370 3 else
371 3 {
372 4 m_DisplayDriveBuf[0][Addr] = m_DisplayDriveBuf[0][Addr]|0x10;
373 4 }
374 3 }
375 2 else//1路
376 2 {
377 3 EnableSecondHT1621();
378 3 if(Addr<12 || Addr == 13)
379 3 {
380 4 m_DisplayDriveBuf[1][Addr] = m_DisplayDriveBuf[1][Addr]|0x08;
381 4 }
382 3 else
383 3 {
384 4 m_DisplayDriveBuf[1][Addr] = m_DisplayDriveBuf[1][Addr]|0x01;
385 4 }
386 3 }
387 2 }
388 1 else //隐藏特殊段
389 1 {
390 2 if(!icID) //0路
391 2 {
392 3 EnableFirstHT1621();
393 3 if(Addr<12)
394 3 {
395 4 m_DisplayDriveBuf[0][Addr] = m_DisplayDriveBuf[0][Addr]&0x7f;
396 4 }
397 3 else
398 3 {
399 4 m_DisplayDriveBuf[0][Addr] = m_DisplayDriveBuf[0][Addr]&0xef;
400 4 }
401 3 }
402 2 else
403 2 {
404 3 EnableSecondHT1621();
405 3 if(Addr<12 || Addr == 13)
406 3 {
407 4 m_DisplayDriveBuf[1][Addr] = m_DisplayDriveBuf[1][Addr]&0xf7;
408 4 }
409 3 else
410 3 {
411 4 m_DisplayDriveBuf[1][Addr] = m_DisplayDriveBuf[1][Addr]&0xfe;
412 4 }
413 3 }
414 2 }
415 1 SendDataHead();//101
416 1 SendAddress(Addr*2);
417 1 SendOneByte(m_DisplayDriveBuf[icID][Addr]); //一次写一字节
418 1 HT1621CS1 = 1;
419 1 HT1621CS2 = 1;
420 1 }
421 //全显
422 void disp_all(void)
C51 COMPILER V8.06 HT1621 02/13/2009 09:29:11 PAGE 8
423 {
424 1 unsigned char i;
425 1 for (i=0;i<32;i++){
426 2 DisplayChar(i,8);//显示8
427 2 }
428 1 for (i=0;i<16;i++){
429 2 Display_Exe(1,0,i);//显示特殊字符
430 2 Display_Exe(1,1,i);//显示特殊字符
431 2 }
432 1 }
433 /*
434 //以十进制方式显示长整形数
435 void disp_long_decimal(unsigned char location,unsigned long long_data)
436 {
437 unsigned char shiyi,yi,qianwan,baiwan,shiwan,wan,qian,bai,shi,ge;
438 ge = long_data%10;
439 long_data = long_data/10;
440 shi = long_data%10;
441 long_data = long_data/10;
442 bai = long_data%10;
443 long_data = long_data/10;
444 qian = long_data%10;
445 long_data = long_data/10;
446 wan = long_data%10;
447 long_data = long_data/10;
448 shiwan = long_data%10;
449 long_data = long_data/10;
450 baiwan = long_data%10;
451 long_data = long_data/10;
452 qianwan = long_data%10;
453 long_data = long_data/10;
454 yi = long_data%10;
455 long_data = long_data/10;
456 shiyi = long_data%10;
457 // 0 1 2 3 4 5 6 7 8 9 10 11
458 // 十亿 亿 千万 百万 十万 万 千 百 十 个
459 if (shiyi!=0) {
460 DisplayChar(location+0,shiyi);
461 DisplayChar(location+1,yi);
462 DisplayChar(location+2,qianwan);
463 DisplayChar(location+3,baiwan);
464 DisplayChar(location+4,shiwan);
465 DisplayChar(location+5,wan);
466 }
467 else if (yi!=0) {
468 DisplayChar(location+0,0x10);
469 DisplayChar(location+1,yi);
470 DisplayChar(location+2,qianwan);
471 DisplayChar(location+3,baiwan);
472 DisplayChar(location+4,shiwan);
473 DisplayChar(location+5,wan);
474 }
475 else if (qianwan!=0) {
476 DisplayChar(location+0,0x10);
477 DisplayChar(location+1,0x10);
478 DisplayChar(location+2,qianwan);
479 DisplayChar(location+3,baiwan);
480 DisplayChar(location+4,shiwan);
481 DisplayChar(location+5,wan);
482 }
483 else if (baiwan!=0) {
484 DisplayChar(location+0,0x10);
C51 COMPILER V8.06 HT1621 02/13/2009 09:29:11 PAGE 9
485 DisplayChar(location+1,0x10);
486 DisplayChar(location+2,0x10);
487 DisplayChar(location+3,baiwan);
488 DisplayChar(location+4,shiwan);
489 DisplayChar(location+5,wan);
490 }
491 else if (shiwan!=0) {
492 DisplayChar(location+0,0x10);
493 DisplayChar(location+1,0x10);
494 DisplayChar(location+2,0x10);
495 DisplayChar(location+3,0x10);
496 DisplayChar(location+4,shiwan);
497 DisplayChar(location+5,wan);
498 }
499 else if (wan!=0) {
500 DisplayChar(location+0,0x10);
501 DisplayChar(location+1,0x10);
502 DisplayChar(location+2,0x10);
503 DisplayChar(location+3,0x10);
504 DisplayChar(location+4,0x10);
505 DisplayChar(location+5,wan);
506 }
507 DisplayChar(location+6,qian);
508 DisplayChar(location+7,bai);
509 DisplayChar(location+8,shi);
510 DisplayChar(location+9,ge);
511 }
512
513 */
514
515 //以十进制方式显示整形数
516 void disp_int(unsigned char location,unsigned int int_data)
517 {
518 1 unsigned char wan,qian,bai,shi,ge;
519 1 ge = int_data%10;
520 1 int_data = int_data/10;
521 1 shi = int_data%10;
522 1 int_data = int_data/10;
523 1 bai = int_data%10;
524 1 int_data = int_data/10;
525 1 qian = int_data%10;
526 1 int_data = int_data/10;
527 1 wan = int_data%10;
528 1 if (wan!=0) {
529 2 DisplayChar(location,wan);
530 2 DisplayChar(location+1,qian);
531 2 }
532 1 else if (qian!=0) {
533 2 DisplayChar(location+0,0x10);
534 2 DisplayChar(location+1,qian);
535 2 }
536 1 else {
537 2 DisplayChar(location+0,0x10);
538 2 DisplayChar(location+1,0x10);
539 2 }
540 1 DisplayChar(location+2,bai);
541 1 DisplayChar(location+3,shi);
542 1 DisplayChar(location+4,ge);
543 1 }
544
545 //以十进制方式浮点数(最多显示65535),返回1表示超过65535
546 bit disp_float_max65536(unsigned char location,float float_data)
C51 COMPILER V8.06 HT1621 02/13/2009 09:29:11 PAGE 10
547 {
548 1 if (float_data>65535) { //超过显示最大值
549 2 DisplayChar(location+0,0x10);
550 2 DisplayChar(location+1,0x10);
551 2 DisplayChar(location+2,0x11); //-
552 2 DisplayChar(location+3,0x11); //-
553 2 DisplayChar(location+4,0x11); //-
554 2 }
555 1 disp_int(location,(unsigned int)float_data);
556 1 return 0; //未超过显示最大值
557 1 }
558
559
560
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1018 ----
CONSTANT SIZE = 54 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 12
IDATA SIZE = 32 ----
BIT SIZE = 1 1
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -