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

📄 song_drv.lst

📁 这是atmel公司的89C51SND1C的mp3源程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V6.20c  SONG_DRV                                                              07/10/2002 15:17:36 PAGE 1   


C51 COMPILER V6.20c, COMPILATION OF MODULE SONG_DRV
OBJECT MODULE PLACED IN ..\obj\song_drv.obj
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE ..\src\song\song_drv.c BROWSE INCDIR(..\src\system;..\..\..\lib) DEFINE(KEI
                    -L) DEBUG OBJECTEXTEND PRINT(.\song_drv.lst) OBJECT(..\obj\song_drv.obj) 

stmt level    source

   1          /*C**************************************************************************
   2          * $RCSfile: song_drv.c,v $
   3          *----------------------------------------------------------------------------
   4          * Copyright (c) 2002 Atmel.
   5          *----------------------------------------------------------------------------
   6          * RELEASE:      $Name: DEMO_FAT_1_2_5 $      
   7          * REVISION:     $Revision: 1.7 $     
   8          * FILE_CVSID:   $Id: song_drv.c,v 1.7 2002/06/06 15:30:13 ffosse Exp $       
   9          *----------------------------------------------------------------------------
  10          * PURPOSE:
  11          * This file contains the song driver routines
  12          *****************************************************************************/
  13          
  14          /*_____ I N C L U D E S ____________________________________________________*/
  15          
  16          #include "config.h"                         /* system configuration */
  17          #include "..\..\..\..\lib\aud\aud_drv.h"    /* audio driver definition */
  18          #include "..\..\..\..\lib\mp3\mp3_drv.h"    /* mp3 driver definition */
  19          #include "..\..\..\..\lib_demob\dac\dac_drv.h"/* dac driver definition */
  20          #include "..\file\file.h"                   /* file definition */
  21          #include "..\clock\clock.h"                 /* clock definition */
  22          #include "song_drv.h"                       /* song driver definition */
  23          
  24          
  25          /*_____ M A C R O S ________________________________________________________*/
  26          
  27          
  28          /*_____ D E F I N I T I O N ________________________________________________*/
  29          
  30          static  Byte    song_sound;                 /* save the selected sound */
  31          
  32          
  33          /*_____ D E C L A R A T I O N ______________________________________________*/
  34          
  35          static  void    song_audio_init (void);
  36          
  37          
  38          /*F**************************************************************************
  39          * NAME: song_snd_init
  40          *----------------------------------------------------------------------------
  41          * PARAMS:
  42          *
  43          * return:
  44          *----------------------------------------------------------------------------
  45          * PURPOSE: 
  46          *   Sound control initialization
  47          *----------------------------------------------------------------------------
  48          * EXAMPLE:
  49          *----------------------------------------------------------------------------
  50          * NOTE:
  51          *   Initializes the sound controls to their medium value
  52          *----------------------------------------------------------------------------
  53          * REQUIREMENTS:
  54          *****************************************************************************/
C51 COMPILER V6.20c  SONG_DRV                                                              07/10/2002 15:17:36 PAGE 2   

  55          void song_snd_init (void)
  56          {
  57   1        MP3VOL = VOLUME_MED;
  58   1        MP3VOR = VOLUME_MED;
  59   1        MP3BAS = BASS_MED;
  60   1        MP3MED = MEDIUM_MED;
  61   1        MP3TRE = TREBLE_MED;
  62   1      
  63   1        song_sound = SND_VOLUME;          /* volume control selected by default */
  64   1      }
  65          
  66          
  67          
  68          /*F**************************************************************************
  69          * NAME: song_snd_inc
  70          *----------------------------------------------------------------------------
  71          * PARAMS:
  72          *
  73          * return:
  74          *----------------------------------------------------------------------------
  75          * PURPOSE:
  76          *   Increment the selected sound control
  77          *----------------------------------------------------------------------------
  78          * EXAMPLE:
  79          *----------------------------------------------------------------------------
  80          * NOTE:
  81          *   The number of the current selected sound control is stored in the
  82          *   variable snd_select (0.Volume; 1.Bass; 2.Medium; 3. Trebble)
  83          *----------------------------------------------------------------------------
  84          * REQUIREMENTS:
  85          *****************************************************************************/
  86          void song_snd_inc (void)
  87          {
  88   1        switch (song_sound)
  89   1        {
  90   2          case SND_VOLUME:
  91   2          {
  92   3            if (MP3VOL != VOLUME_MAX)
  93   3            {
  94   4              MP3VOL++;
  95   4              MP3VOR = MP3VOL;
  96   4            }
  97   3            break;
  98   3          }
  99   2      
 100   2          case SND_BASS:
 101   2          {
 102   3            if (MP3BAS != BASS_MAX)
 103   3              MP3BAS++;
 104   3            break;
 105   3          }
 106   2      
 107   2          case SND_MEDIUM:
 108   2          {
 109   3            if (MP3MED != MEDIUM_MAX)
 110   3              MP3MED++;
 111   3            break;
 112   3          }
 113   2      
 114   2          case SND_TREBLE:
 115   2          {
 116   3            if (MP3TRE != TREBLE_MAX)
C51 COMPILER V6.20c  SONG_DRV                                                              07/10/2002 15:17:36 PAGE 3   

 117   3              MP3TRE++;
 118   3            break;
 119   3          }
 120   2        }
 121   1      }
 122          
 123          
 124          /*F**************************************************************************
 125          * NAME: song_snd_dec
 126          *----------------------------------------------------------------------------
 127          * PARAMS:
 128          *
 129          * return:
 130          *----------------------------------------------------------------------------
 131          * PURPOSE:
 132          *   Decrement the selected sound control
 133          *----------------------------------------------------------------------------
 134          * EXAMPLE:
 135          *----------------------------------------------------------------------------
 136          * NOTE:
 137          *   The number of the current selected sound control is stored in the
 138          *   variable snd_select (0.Volume; 1.Bass; 2.Medium; 3. Trebble)
 139          *----------------------------------------------------------------------------
 140          * REQUIREMENTS:
 141          *****************************************************************************/
 142          void song_snd_dec (void)
 143          {
 144   1        switch (song_sound)
 145   1        {
 146   2          case SND_VOLUME:
 147   2          {
 148   3            if (MP3VOL != VOLUME_MIN)
 149   3            {
 150   4              MP3VOL--;
 151   4              MP3VOR = MP3VOL;
 152   4            }
 153   3            break;
 154   3          }
 155   2      
 156   2          case SND_BASS:
 157   2          {
 158   3            if (MP3BAS != BASS_MIN)
 159   3              MP3BAS--;
 160   3            break;
 161   3          }
 162   2      
 163   2          case SND_MEDIUM:
 164   2          {
 165   3            if (MP3MED != MEDIUM_MIN)
 166   3              MP3MED--;
 167   3            break;
 168   3          }
 169   2      
 170   2          case SND_TREBLE:
 171   2          {
 172   3            if (MP3TRE != TREBLE_MIN)
 173   3              MP3TRE--;
 174   3            break;
 175   3          }
 176   2        }
 177   1      }
 178          
C51 COMPILER V6.20c  SONG_DRV                                                              07/10/2002 15:17:36 PAGE 4   

 179          
 180          /*F**************************************************************************
 181          * NAME: song_snd_select
 182          *----------------------------------------------------------------------------
 183          * PARAMS:
 184          *
 185          * return:
 186          *----------------------------------------------------------------------------
 187          * PURPOSE:
 188          *   Select next sound control
 189          *----------------------------------------------------------------------------
 190          * EXAMPLE:
 191          *----------------------------------------------------------------------------
 192          * NOTE:
 193          *----------------------------------------------------------------------------
 194          * REQUIREMENTS:
 195          *****************************************************************************/
 196          void song_snd_select (void)
 197          {
 198   1        song_sound = (song_sound + 1) % NB_SOUND;
 199   1      }
 200          
 201          
 202          /*F**************************************************************************
 203          * NAME: song_get_sound
 204          *----------------------------------------------------------------------------
 205          * PARAMS:
 206          *
 207          * return:
 208          *   sound selected: SND_VOLUME, SND_BASS, SND_MEDIUM, SND_TREBLE
 209          *----------------------------------------------------------------------------
 210          * PURPOSE: 
 211          *   Returns selected sound control
 212          *----------------------------------------------------------------------------
 213          * EXAMPLE:
 214          *----------------------------------------------------------------------------
 215          * NOTE:
 216          *----------------------------------------------------------------------------
 217          * REQUIREMENTS:
 218          *****************************************************************************/
 219          Byte song_get_sound (void)
 220          {
 221   1        return (song_sound);
 222   1      }
 223          

⌨️ 快捷键说明

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