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

📄 spu_control.h

📁 凌阳SPCE3200多媒体开发板自带源程序。共安排了32个子目录
💻 H
📖 第 1 页 / 共 2 页
字号:
// Function:     SetMidiVolume();
// Parameters:   Volume: MIDI Global Volume to set. Range from 0 to 127.
// Returns:      None.
// Description:  Adjust MIDI playing back volume
// Notes:
//*************************************************************************************************
extern void SetMidiVolume(U16 iVolume);

//*************************************************************************************************
// Function:     TM_PlayPCM();
// Parameters:   Address:  DRM file address.
//               Pan:      Balance value PAN
//               Velocity: Amplitude of playing channel from 0 to maximum 127
// Returns:      unsigned int: Allocated channel number for this DRM file
// Description:  PAN - PAN is the value of balance, when PAN equals zero that the playing sound
//               will only effect left speaker and on the contrary while PAN equals 127 then only
//               right speaker will be effected. The MIDDLE is at 63 or 64;
//               DRM - DRM is a file type of Sunplus polyphony system; It can support 8 bits PCM data,
//               16 bits PCM or 4 bits ADPCM data modes
// Notes:
//*************************************************************************************************
extern void TM_PlayPCM(U8 * Address, U16 Pan, U16 Velocity);

//*************************************************************************************************
// Function:     TM_PlayPCM_FixCH();
// Parameters:   Address:  DRM file address.
//               Pan:      Balance value PAN
//               Velocity: Amplitude of playing channel from 0 to maximum 127
// Returns:      (Optional)unsigned int: Allocated channel number for this DRM file.
// Description:  PAN - PAN is the value of balance, when PAN equals zero that the playing sound
//               will only effect left speaker and on the contrary while PAN equals 127 then only
//               right speaker will be effected. The MIDDLE is at 63 or 64;
//               DRM - DRM is a file type of Sunplus polyphony system; It can support 8 bits PCM data,
//               16 bits PCM or 4 bits ADPCM data modes
// Notes:
//*************************************************************************************************
extern void TM_PlayPCM_FixCH(U16 ChannelNo, U8 * Address, U16 Pan, U16 Velocity);

//*************************************************************************************************
// Function:     TM_StopPCM();
// Parameters:   ChannelNumber: The channel number from 0 to 23
// Returns:      None.
// Description:  Stop the specified channel
// Notes:
//*************************************************************************************************
extern void TM_StopPCM( U16 iChannelNo);

//*************************************************************************************************
// Function:     TM_PlayTone();
// Parameters:   PlayPitch: Pitch number of playing note
//               Address:   ALP file address.
//               Pan:       Balance value PAN
//               Velocity:  Amplitude of playing channel from 0 to maximum 127
// Returns:      (Optional)INT16U: Playing channel number for this ALP file.
// Description:  Play a specified ALP file with variable Pitches and also PAN and velocity
// Notes:        PAN - PAN is the value of balance, when PAN equals zero that the playing sound
//               will only effect left speaker and on the contrary while PAN equals 127 then only
//               right speaker will be effected. The MIDDLE is at 63 or 64;
//               ALP - ALP is a file type of Sunplus polyphony system; It can support 8 bits PCM data,
//               16 bits PCM or 4 bits ADPCM data modes and envelop data included.
//*************************************************************************************************
extern void TM_PlayTone(U16 PlayPitch, U8 * Address, U16 Pan, U16 Velocity);
 
//*************************************************************************************************
// Function:     TM_PlayTone_FixCH();
// Parameters:   iChannelNo : Specified channel for playing note
//               PlayPitch - Pitch number of playing note
//               Address:   ALP file address.
//               iPan - Balance value PAN
//               iVelocity - Amplitude of playing channel from 0 to maximum 127
// Returns:      Playing channel number for this ALP file
// Description:  Play a specified ALP file with variable Pitches and also PAN and velocity with specified channel.
// Notes:        PAN - PAN is the value of balance, when PAN equals zero that the playing sound
//                  will only effect left speaker and on the contrary while PAN equals 127 then only
//                  right speaker will be effected. The MIDDLE is at 63 or 64;
//               ALP - ALP is a file type of Sunplus polyphony system; It can support 8 bits PCM data,
//                  16 bits PCM or 4 bits ADPCM data modes and envelop data included
//*************************************************************************************************
extern void TM_PlayTone_FixCH(U16 ChannelNumber, U16 PlayPitch, U8 * Address, U16 Pan, U16 Velocity);

//*************************************************************************************************
// Function:     GetSPUStatus();
// Parameters:   None.
// Returns:      SPU status word
//                      Bit0 : 1 - MIDI is playing; 0 - MIDI stop
//                      Bit1 : Reserved
//                      Bit2 : Reserved
//                      Bit3 : Reserved
//                      Bit4 : Reserved
//                      Bit5 : Reserved
//                      Bit6 : Reserved
//                      Bit7 : Reserved
//                      Bit8 : 1 - MIDI ends event call back function has been initiated; 0 - None
//                      Bit9 : 1 - Play the specified MIDI repeatedly; 0 - Play specified MIDI once
//                      Bit10: 1 - MIDI pause on ; 0 - None    
//                      Bit11 .. 15 - Reserved  
//
//               Defined constant label in ASM
//                      STS_MIDI_PLAY               0x0001
//                      STS_MIDI_CALLBACK           0x0100
//                      STS_MIDI_REPEAT_ON          0x0200
//                      STS_MIDI_PAUSE_ON           0x0400  
// Description:  Get SPU status word
// Notes:        
//*************************************************************************************************
extern U16 GetSPUStatus();

//*************************************************************************************************
// Function:     GetChannelStatus();
// Parameters:   None.
// Returns:      unsigned int: Status register word
// Description:  Get the register word of channel status for Ch0 - Ch15
// Notes:        Each bit in the return status register stand for one channel
//      		 -------------------------------------------------------------------------------------
//      		 ch23(B7) | ch22(B6) | ch21(B5) | ch20(B4) | ch19(B3) | ch18(B2) | ch17(B1) | ch16(B0)
//      		 -------------------------------------------------------------------------------------
//               --------------------------------------------------------------------------
//               ch15(B15) | ch14(B14) | ch13(B13) | ........ | ch2(B2) | ch1(B1) | ch0(B0)
//               --------------------------------------------------------------------------
//				 For all bits in register word : 1 - busy ; 0 - idle
//*************************************************************************************************
extern U32 GetChannelStatus();

//*************************************************************************************************
// Function:     IsChannelStop();
// Parameters:   iChannelNo: The channel number from 0 to 23
// Returns:      INT16U:	1 - The channel is idle or stopped
//			 	 			0 - The channel is busy
// Description:  Check if the specified channel is stopped or idle 
// Notes:        
//*************************************************************************************************
extern U16 IsChannelStop( U16 iChannelNo);	

//*************************************************************************************************
// Function:     SetMidiChVol();
// Parameters:   iChannelNo: SPG220 is 0~23; SPG240 is 0~15; SPG260 is 0~7; SPG280 is 0~5
// 				 iVolume: 0~0x7F; 0x7F is max volume
// Returns:      None.
// Description:  To set specific midi channel volume
// Notes:        this function sets only the volume of a specific midi channel(), it is
//				 also guide by the main midi volume.	
//*************************************************************************************************
//extern	void SetMidiChVol(U16 iChannelNo, U16 iVolume);
extern void SetMidiChannelVolume(U16 ChannelNo, U16 Volume);	// modified by Bruce, 2006/02/21

//*************************************************************************************************
// Function:     ResetMidiChVol();
// Parameters:   
// Returns:      
// Description:  To reset specific midi channel volumes
// Notes:        this function resets all midi channel volumes to normal(0x7F).
//*************************************************************************************************
//extern	void ResetMidiChVol();
extern void ResetMidiChannelVolume();	// modified by Bruce, 2006/02/21


/* //Added by Bruce, 2006/02/21
//*************************************************************************************************
// Function:     InitMidiStopCallBackFunc();
// Parameters:   MIDIEndCallBackFunction_Pointer_type* :	Pointer of Call back routine
// Returns:      None
// Description:  Setup and intitial the call back function of SPU driver while playing MIDI ends
// Notes:		 NOTICE, this function only support function prototype 'void FunctionName(void)'
//*************************************************************************************************
extern void InitMidiStopCallBackFunc(MIDIEndCallBackFunction_Pointer_type * Function);


//*************************************************************************************************
// Function:     InitMidiStopCallBackFunc();
// Parameters:   None
// Returns:      None
// Description:  Stop the call back function of SPU driver when playing MIDI ends
// Notes:
//*************************************************************************************************
extern void DisableMidiStopCallBackFunc(void);


//*************************************************************************************************
// Function:     SPU_IRQ_Service();
// Parameters:   None.
// Returns:      None.
// Description:  SPU IRQ Service. Entry subroutine of SPU Driver.
// Notes:        See SPU IRQ Vector for the Entry.
//				 This function will do nothing if the SPU is not in MIDI play Mode.
//*************************************************************************************************
extern void SPU_IRQ_Service(void);
 */

#endif

⌨️ 快捷键说明

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