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

📄 wavepdd.c

📁 Xcale270Bsp包,wince平台
💻 C
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++

$Workfile: WAVEPDD.C $

$Date: 3/24/03 6:45p $

Abstract:  
      The PDD (Platform Dependent Driver) is responsible for
      communicating with the audio circuit to start and stop playback
      and/or recording and initialize and deinitialize the circuits. The
	  API between the PDD and the MDD is called the DDSI (see "Key Routines"
	  for more info).

Warning:
      This driver is specifically written for the UCB 1400 Audio Codec.  It is
	  not a general AC 97 CODEC device driver.  

Key Routines: 

  PDD_AudioGetInterruptType -- This routine is part of the Interrupt Service Thread managed
    by the wave MDD.  Here interrupts are processed and DMA buffers are returned to the driver.
    That is, the DMA buffers are protected to keep the DMAC from reading or writing the buffers
	while the driver is processing them.  If the DMAC attempts to work on a buffer that is has
	not been posted by the driver an Interrupt will occur indicating write overflow or read
	under flow.  The DMAC engine will stall until the buffer is ready.  The status of reads or 
	writes is returned to the MDD.

  private_WaveInStart, private_WaveOutStart -- These routines setup the DMAC for receive or
    transmit.  They copy data from application buffers (sent from or to the OS) to DMA buffers.
	The inital DMA buffers are then "posted" or setup for the DMAC engine to read or write.  
	
  private_WaveInContinue, private_WaveOutContinue -- These routines continue processing
    input or output by moving data from or to application buffers from or to the DMAC buffers.  
	Buffers are "posted" (marked for handling) by these routines.  If the DMAC engine attempts
	to read a buffer before it is posted, it will generate an interrupt and stall.  If the DMAC
	has stalled this routine will restart DMA.  (See also PDD_AudioGetInterruptType, 
	private_AudioFillBuffer, and private_AudioGetBuffer).

  private_AudioFillBuffer,private_AudioGetBuffer -- These routines perform the actual copy and 
    formatting of application sound data.  They copy the data from or to the DMAC buffers from 
	or to the application buffers.  The data is also converted from the format of the audio 
	Codec (stereo 16 bit) to the format	requested by the application (such as monoral 8 bit).

  private_WaveInStop, private_WaveOutStop -- These routines stop the processing of audio buffers
    by indicating that no more data is available and setting the DMAC registers to stop xmit or 
	recv of application data.  

  PDD_WaveProc -- This routine actually processes the messages of the Device Driver Service
    Interface (DDSI).  The MDD sends these messages to the PDD for handling.  

  PDD_AudioMessage -- This routine exposes a private interface to applications.

Key Structures:


Function Hierarchy:

     PDD_AudioGetInterruptType      xx
     PDD_AudioMessage				xx
     PDD_AudioInitialize            xx 
         AudioPowerOn()             xx 
         AudioOutMute();            xx    
     PDD_AudioDeinitialize          xx 
         PddpAudioDeallocateVm();   xx 
     PDD_AudioPowerHandler          xx 
     PDD_WaveProc                   xx
         WPDM_OPEN,					xx
			private_WaveOpen		xx
         WPDM_CLOSE					xx					
         WPDM_START					xx                 
             private_WaveInStart    xx
			   private_AudioGetBuffer xx 
             private_WaveOutStart   xx 
               private_AudioFillBuffer !!
         WPDM_RESTART				xx  
             private_WaveOutRestart xx 
         WPDM_STOP                  xx 
             private_WaveInStop     xx
             private_WaveOutStop    xx 
         WPDM_CONTINUE              xx
             private_WaveInContinue xx 
             private_WaveOutContinue xx 
         WPDM_ENDOFDATA             xx 
             private_WaveOutEndOfData xx
         WPDM_STANDBY                xx
             private_WaveStandby     --
         WPDM_PAUSE                  xx
             private_WaveOutPause    xx
         WPDM_GETDEVCAPS             xx
             private_WaveGetDevCaps  xx
         WPDM_GETVOLUME              
         WPDM_SETVOLUME              

Notes:



--*/

static const char __copyright[]= "Copyright 

⌨️ 快捷键说明

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