ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

sndblst.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <debug.h>
00004 #include <ntddk.h>
00005 
00006 #define SB_WAVE_IN_DEVICE_NAME  L"\\Device\\SBWaveIn"
00007 #define SB_WAVE_OUT_DEVICE_NAME L"\\Device\\SBWaveOut"
00008 /* TODO: MIDI */
00009 #define SB_AUX_DEVICE_NAME      L"\\Device\\SBAux"
00010 #define SB_MIXER_DEVICE_NAME    L"\\Device\\SBMixer"
00011 
00012 #define DEFAULT_PORT        0x220
00013 #define DEFAULT_IRQ         5
00014 #define DEFAULT_DMA         1
00015 #define DEFAULT_BUFFER_SIZE 65535
00016 
00017 #define SB_TIMEOUT          1000000
00018 
00019 #define SB_DSP_READY        0xaa
00020 
00021 enum
00022 {
00023     NotDetected,
00024     SoundBlaster,
00025     SoundBlasterPro,
00026     SoundBlaster2,
00027     SoundBlasterPro2,
00028     SoundBlasterProMCV,
00029     SoundBlaster16
00030 };
00031 
00032 enum
00033 {
00034     SB_RESET_PORT           = 0x06,
00035     SB_READ_DATA_PORT       = 0x0a,
00036     SB_WRITE_DATA_PORT      = 0x0c,
00037     SB_WRITE_STATUS_PORT    = 0x0c,
00038     SB_READ_STATUS_PORT     = 0x0e
00039 };
00040 
00041 enum
00042 {
00043     SbAutoInitDmaOutput     = 0x1c,
00044     SbAutoInitDmaInput      = 0x2c,
00045     SbSetOutputRate         = 0x41, /* DSP v4.xx */
00046     SbSetInputRate          = 0x42, /* DSP v4.xx */
00047     SbSetBlockSize          = 0x48, /* DSP v2.00 + */
00048     SbPauseDac              = 0x80,
00049     SbPauseDmaOutput        = 0xd0,
00050     SbEnableSpeaker         = 0xd1,
00051     SbDisableSpeaker        = 0xd3,
00052     SbGetSpeakerStatus      = 0xd8, /* DSP v2.00 + */
00053     SbGetDspVersion         = 0xe1
00054 };
00055 
00056 typedef struct _SOUND_BLASTER_PARAMETERS
00057 {
00058     PDRIVER_OBJECT driver;
00059     PWSTR registry_path;
00060     PKINTERRUPT interrupt;
00061     ULONG port;
00062     ULONG irq;
00063     ULONG dma;
00064     ULONG buffer_size;
00065     USHORT dsp_version;
00066 } SOUND_BLASTER_PARAMETERS, *PSOUND_BLASTER_PARAMETERS;
00067 
00068 
00069 typedef NTAPI NTSTATUS REGISTRY_CALLBACK_ROUTINE(PDRIVER_OBJECT DriverObject, PWSTR RegistryPath);
00070 typedef REGISTRY_CALLBACK_ROUTINE *PREGISTRY_CALLBACK_ROUTINE;
00071 
00072 
00073 /*
00074     Port I/O
00075 */
00076 
00077 #define SbWrite(sbdevice, subport, data) \
00078     WRITE_PORT_UCHAR((PUCHAR) sbdevice->port + subport, data)
00079 
00080 #define SbRead(sbdevice, subport) \
00081     READ_PORT_UCHAR((PUCHAR) sbdevice->port + subport)
00082 
00083 #define SbWriteReset(sbdevice, data) \
00084     SbWrite(sbdevice, SB_RESET_PORT, data)
00085 
00086 #define SbWriteDataWithoutWait(sbdevice, data) \
00087     SbWrite(sbdevice, SB_WRITE_DATA_PORT, data)
00088 
00089 #define SbReadDataWithoutWait(sbdevice) \
00090     SbRead(sbdevice, SB_READ_DATA_PORT)
00091 
00092 
00093 #define SbGetWriteStatus(sbdevice) \
00094     SbRead(sbdevice, SB_WRITE_STATUS_PORT)
00095 
00096 #define SbGetReadStatus(sbdevice) \
00097     SbRead(sbdevice, SB_READ_STATUS_PORT)
00098 
00099 
00100 
00101 BOOLEAN
00102 WaitForReady(
00103     PSOUND_BLASTER_PARAMETERS SBDevice,
00104     UCHAR Port);
00105 
00106 #define WaitToWrite(sbdevice) \
00107     WaitForReady(sbdevice, SB_WRITE_STATUS_PORT)
00108 
00109 #define WaitToRead(sbdevice) \
00110     WaitForReady(sbdevice, SB_READ_STATUS_PORT)
00111 
00112 BOOLEAN
00113 ResetSoundBlaster(
00114     PSOUND_BLASTER_PARAMETERS SBDevice);
00115 
00116 ULONG
00117 GetSoundBlasterModel(
00118     PSOUND_BLASTER_PARAMETERS SBDevice);
00119 
00120 BOOLEAN
00121 IsSampleRateCompatible(
00122     PSOUND_BLASTER_PARAMETERS SBDevice,
00123     ULONG SampleRate);
00124 
00125 BOOLEAN
00126 SetOutputSampleRate(
00127     PSOUND_BLASTER_PARAMETERS SBDevice,
00128     ULONG SampleRate);
00129 
00130 BOOLEAN
00131 EnableSpeaker(
00132     PSOUND_BLASTER_PARAMETERS SBDevice);
00133 
00134 BOOLEAN
00135 DisableSpeaker(
00136     PSOUND_BLASTER_PARAMETERS SBDevice);
00137 
00138 BOOLEAN
00139 StartSoundOutput(
00140     PSOUND_BLASTER_PARAMETERS SBDevice,
00141     ULONG BitDepth,
00142     ULONG Channels,
00143     ULONG BlockSize);
00144 
00145 
00146 /*
00147     interrupt.c
00148 */
00149 
00150 NTSTATUS
00151 EnableIrq(
00152     PDEVICE_OBJECT DeviceObject);

Generated on Fri May 25 2012 04:26:06 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.