dk3200_sound_demo.c

来自「增强型单片机UPSD33XX系列芯片做音频发生器例程。内含KEIL源码和PLD源」· C语言 代码 · 共 163 行

C
163
字号
 /* `=========================================================================`

                    ***************************************
                  ****   *                           *   ****
                            Title: DK3200_SOUND_DEMO
                         File name: DK3200_Sound_demo.c
                        Project name: DK3200_SOUND_DEMO
                  ***                                    ****
                    ****************** * ******************
                  ****                                   ****
                              Author: Petr PFEIFER
                           MPG Prague, Czech Republic
                  ****   *                           *   ****
                    ***************************************

                 $Version:  0.074   Build: 2004-04-12,11:35:36

 
 
 
                                  Description:
                                  ============
                            uPSD Sound Studio - Demo

                                     Notes:
                                     ======
                  Program Size: data=28.0 xdata=256 code=1057



                           ..........................
                          .                          .
                          .      ******************  .
                          .     **PPPPPPPPPPPPPPPP   .
                          .     *PPPP*******PP****   .
                          .    **PPP********PP***    .
                          .    ***PPP******PP****    .
                          .   *****PPP****PP****     .
                          .   *****PPP****PP****     .
                          .  PPPPPPPP****PP****  (R) .
                          .                          .
                           ..........................


                                  =-=-=-=-=-=
                           =-=-=-=-=-=-=-=-=-=-=-=-=
                =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

                     Copyright (c) 2004 ST Microelectronics

             This code/file is provided as is and has no warranty,
     implied or otherwise.  You are free to use/modify any of the provided
    code at your own risk in your applications with the expressed limitation
        of liability (see below) so long as your product using the code
                 contains at least one uPSD products (device).

                            LIMITATION OF LIABILITY:
                            ========================
              NEITHER STMicroelectronics NOR ITS VENDORS OR AGENTS
      SHALL BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA,
       INTERRUPTION OF BUSINESS, NOR FOR INDIRECT, SPECIAL, INCIDENTAL OR
       CONSEQUENTIAL DAMAGES OF ANY KIND WHETHER UNDER THIS AGREEMENT OR
         OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

                =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                           =-=-=-=-=-=-=-=-=-=-=-=-=
                                  =-=-=-=-=-=

                   For current information on uPSD products,
                please consult our pages on the World Wide Web:

                                 www.st.com/psm

                            - - - - - - - - - - - -

                     STMicroelectronics GROUP OF COMPANIES
    Australia - Brazil - China - Czech Republic - Finland - France - Germany
   Hong Kong - India - Italy - Japan - Malaysia - Malta - Morocco - Singapore
             Spain - Sweden - Switzerland - United Kingdom - U.S.A.

                               http://www.st.com


 `========================================================================` */



#pragma SYMBOLS
#pragma NOAREGS

#include "upsd_hardware.h"                // environment hardware specific defines
#include "upsd3200.h"           // special function register declarations for UPSD
#include "uPSD_Sound_Studio.h"               //uPSD Sound Studio - declarations



// MAIN Demo Program

void main (void)
/******************************************************************************
 Function   : void main ()
 Parameters : (void)
 Description:
 ******************************************************************************/
 {


  WDKEY = 0x55;                              // disable the watchdog


  uPSDSoundStudio_Init();


  uPSDSoundStudio_PlayItem(11);
  uPSDSoundStudio_Silence(2000);

  uPSDSoundStudio_PlayItem(0 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(0 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(4 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(2 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(0 +1);

  uPSDSoundStudio_Silence(500);
  uPSDSoundStudio_PlayItem(2 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(2 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(2 +1);

  uPSDSoundStudio_Silence(500);
  uPSDSoundStudio_PlayItem(3 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(3 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(6 +1);

  uPSDSoundStudio_Silence(500);
  uPSDSoundStudio_PlayItem(1 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(1 +1);
  uPSDSoundStudio_Silence(100);
  uPSDSoundStudio_PlayItem(1 +1);
  uPSDSoundStudio_Silence(2000);

  uPSDSoundStudio_PlayItem(12);
  uPSDSoundStudio_PlayItem(13);
  uPSDSoundStudio_NoSound();

  while(1);

 }


/* *************************************************************************
  ***                                                                      ***
  **                         *** End of File ***                            **
  ***                                                                      ***
   *************************************************************************  */

⌨️ 快捷键说明

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