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

📄 disp.lst

📁 一个可作为mp3播放器固件的代码集,包括解码,播放,控制,任务管理等.
💻 LST
📖 第 1 页 / 共 4 页
字号:
 529   1      }
 530          
 531          
 532          /*F**************************************************************************
 533          * NAME: print_voice_vol
 534          *----------------------------------------------------------------------------
 535          * PARAMS:
 536          *
 537          * return:
 538          *----------------------------------------------------------------------------
 539          * PURPOSE:
 540          *   Print the voice volume
 541          *----------------------------------------------------------------------------
 542          * EXAMPLE:
 543          *----------------------------------------------------------------------------
 544          * NOTE:
 545          *----------------------------------------------------------------------------
 546          * REQUIREMENTS:
 547          *****************************************************************************/
 548          void print_voice_vol (char volume)
 549          {
 550   1      #if CONF_DISPLAY == LCD
C51 COMPILER V7.50   DISP                                                                  09/20/2005 21:47:47 PAGE 10  

                lcd_set_cur(POS_SOUND_LVL);
                lcd_putchar(volume + '0');
              #else
 554   1        if (!bargraph) return;
 555   1        // volume must be between 0 -> 4
 556   1        LED_ON = (15 >> (4 - volume));
 557   1        LED_FAST = 3;
 558   1      #endif
 559   1      }
 560          
 561          
 562          /*F**************************************************************************
 563          * NAME: print_time
 564          *----------------------------------------------------------------------------
 565          * PARAMS:
 566          *   - min: minute to display
 567          *   - sec: second to display
 568          * return:
 569          *----------------------------------------------------------------------------
 570          * PURPOSE:
 571          *   Print time on the LCD
 572          *----------------------------------------------------------------------------
 573          * EXAMPLE:
 574          *----------------------------------------------------------------------------
 575          * NOTE:
 576          *----------------------------------------------------------------------------
 577          * REQUIREMENTS:
 578          *****************************************************************************/
 579          void print_time (Byte min, Byte sec)
 580          {
 581   1      #if CONF_DISPLAY == LCD
                lcd_set_cur(POS_TIME);
              #endif
 584   1        print_decim(min, TRUE);
 585   1      #if CONF_DISPLAY == LCD
                lcd_putchar(':');
              #endif
 588   1        print_decim(sec, FALSE);
 589   1      }
 590          
 591          
 592          /*F**************************************************************************
 593          * NAME: print_sec
 594          *----------------------------------------------------------------------------
 595          * PARAMS:
 596          *   - sec: second to display
 597          * return:
 598          *----------------------------------------------------------------------------
 599          * PURPOSE:
 600          *   Print second of time on the LCD
 601          *----------------------------------------------------------------------------
 602          * EXAMPLE:
 603          *----------------------------------------------------------------------------
 604          * NOTE:
 605          *----------------------------------------------------------------------------
 606          * REQUIREMENTS:
 607          *****************************************************************************/
 608          void print_sec (Byte sec)
 609          {
 610   1      #if CONF_DISPLAY == LCD
                lcd_set_cur(POS_SECOND);
                print_decim(sec, FALSE);
C51 COMPILER V7.50   DISP                                                                  09/20/2005 21:47:47 PAGE 11  

              #else
 614   1        if (func_timeout>2)
 615   1          {
 616   2          func_state = 0;
 617   2          bargraph = FALSE;
 618   2          LED_ON = (8 >> ref_state);
 619   2          if (recording) LED_ON = 15 - LED_ON;
 620   2          LED_FAST = 1;
 621   2          song_sound = SND_VOLUME;
 622   2          }
 623   1        else func_timeout++;
 624   1        if (sec);
 625   1      #endif
 626   1      }
 627          
 628          
 629          /*F**************************************************************************
 630          * NAME: print_min
 631          *----------------------------------------------------------------------------
 632          * PARAMS:
 633          *   - min: minute to display
 634          * return:
 635          *----------------------------------------------------------------------------
 636          * PURPOSE:
 637          *   Print minute of time on the LCD
 638          *----------------------------------------------------------------------------
 639          * EXAMPLE:
 640          *----------------------------------------------------------------------------
 641          * NOTE:
 642          *----------------------------------------------------------------------------
 643          * REQUIREMENTS:
 644          *****************************************************************************/
 645          void print_min (Byte min)
 646          {
 647   1      #if CONF_DISPLAY == LCD
                lcd_set_cur(POS_MINUTE);
              #endif
 650   1        print_decim(min, TRUE);
 651   1      }
 652          
 653          
 654          /*F**************************************************************************
 655          * NAME: print_kbd_lock
 656          *----------------------------------------------------------------------------
 657          * PARAMS:
 658          *
 659          * return:
 660          *----------------------------------------------------------------------------
 661          * PURPOSE:
 662          *   Print the lock status
 663          *----------------------------------------------------------------------------
 664          * EXAMPLE:
 665          *----------------------------------------------------------------------------
 666          * NOTE:
 667          *----------------------------------------------------------------------------
 668          * REQUIREMENTS:
 669          *****************************************************************************/
 670          void print_kbd_lock (void)
 671          {
 672   1      #if CONF_DISPLAY == LCD
                  lcd_cgram(CGRAM_LOCK, cgram_lock);      /* init lock icon to locked */
              #endif
C51 COMPILER V7.50   DISP                                                                  09/20/2005 21:47:47 PAGE 12  

 675   1      }
 676          
 677          /*F**************************************************************************
 678          * NAME: print_kbd_lock
 679          *----------------------------------------------------------------------------
 680          * PARAMS:
 681          *
 682          * return:
 683          *----------------------------------------------------------------------------
 684          * PURPOSE:
 685          *   Print the unlock status
 686          *----------------------------------------------------------------------------
 687          * EXAMPLE:
 688          *----------------------------------------------------------------------------
 689          * NOTE:
 690          *----------------------------------------------------------------------------
 691          * REQUIREMENTS:
 692          *****************************************************************************/
 693          void print_kbd_unlock (void)
 694          {
 695   1      #if CONF_DISPLAY == LCD
                lcd_cgram(CGRAM_LOCK, cgram_blank);     /* init lock icon to unlocked */
              #endif
 698   1      }
 699          
 700          /*F**************************************************************************
 701          * NAME: print_mem
 702          *----------------------------------------------------------------------------
 703          * PARAMS:
 704          *   - mem_type  SYMB_CHIP
 705          *               SYMB_CARD
 706          *               SYMB_CARD2
 707          *               SYMB_NO_MEM
 708          * return:
 709          *----------------------------------------------------------------------------
 710          * PURPOSE:
 711          *   Print the memory type on the LCD
 712          *----------------------------------------------------------------------------
 713          * EXAMPLE:
 714          *----------------------------------------------------------------------------
 715          * NOTE:
 716          *----------------------------------------------------------------------------
 717          * REQUIREMENTS:
 718          *****************************************************************************/
 719          void print_mem (Byte mem_type)
 720          {
 721   1      #if CONF_DISPLAY == LCD
                switch (mem_type)
                {
                  case SYMB_CHIP:
                    lcd_cgram(CGRAM_MEM, cgram_chip);
                    break;
              
                  case SYMB_CARD:
                    lcd_cgram(CGRAM_MEM, cgram_card);
                    break;
              
                  case SYMB_CARD1:
                    lcd_cgram(CGRAM_MEM, cgram_card1);
                    break;
              
                  case SYMB_CARD2:
C51 COMPILER V7.50   DISP                                                                  09/20/2005 21:47:47 PAGE 13  

                    lcd_cgram(CGRAM_MEM, cgram_card2);
                    break;
              
                  default:
                    lcd_cgram(CGRAM_MEM, cgram_blank);
                    break;
                }
              #else
 745   1        if (mem_type);
 746   1      #endif
 747   1      }
 748          
 749          
 750          /*F**************************************************************************
 751          * NAME: print_repeat
 752          *----------------------------------------------------------------------------
 753          * PARAMS:
 754          *   status: - TRUE:  play is repeated after last song
 755          *           - FALSE: play is stopped after last song
 756          * return:
 757          *----------------------------------------------------------------------------
 758          * PURPOSE:
 759          *   Print repeat status on the LCD
 760          *----------------------------------------------------------------------------
 761          * EXAMPLE:
 762          *----------------------------------------------------------------------------
 763          * NOTE:
 764          *----------------------------------------------------------------------------
 765          * REQUIREMENTS:
 766          *****************************************************************************/
 767          void print_repeat (Byte rep_type)
 768          {
 769   1      #if CONF_DISPLAY == LCD
                switch (rep_type)
                {
                  case SYMB_REP_DIR:
                    lcd_cgram(CGRAM_REPEAT, cgram_repeat);
                    break;
              
                  case SYMB_REP_FILE:
                    lcd_cgram(CGRAM_REPEAT, cgram_repeat);
                    break;
              
                  case SYMB_REP_A:
                    lcd_cgram(CGRAM_REPEAT, cgram_rep_A);
                    break;
              
                  case SYMB_REP_B:
                    lcd_cgram(CGRAM_REPEAT, cgram_rep_B);
                    break;
              
                  default:
                    lcd_cgram(CGRAM_REPEAT, cgram_blank);
                    break;
                }
              #else
 793   1        if (rep_type);
 794   1      #endif
 795   1      }
 796          
 797          

⌨️ 快捷键说明

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