ReactOS 0.4.15-dev-7931-gfd331f1
sndblst.h
Go to the documentation of this file.
1#pragma once
2
3#include <debug.h>
4#include <ntddk.h>
5
6#define SB_WAVE_IN_DEVICE_NAME L"\\Device\\SBWaveIn"
7#define SB_WAVE_OUT_DEVICE_NAME L"\\Device\\SBWaveOut"
8/* TODO: MIDI */
9#define SB_AUX_DEVICE_NAME L"\\Device\\SBAux"
10#define SB_MIXER_DEVICE_NAME L"\\Device\\SBMixer"
11
12#define DEFAULT_PORT 0x220
13#define DEFAULT_IRQ 5
14#define DEFAULT_DMA 1
15#define DEFAULT_BUFFER_SIZE 65535
16
17#define SB_TIMEOUT 1000000
18
19#define SB_DSP_READY 0xaa
20
21enum
22{
30};
31
32enum
33{
39};
40
41enum
42{
45 SbSetOutputRate = 0x41, /* DSP v4.xx */
46 SbSetInputRate = 0x42, /* DSP v4.xx */
47 SbSetBlockSize = 0x48, /* DSP v2.00 + */
48 SbPauseDac = 0x80,
52 SbGetSpeakerStatus = 0xd8, /* DSP v2.00 + */
53 SbGetDspVersion = 0xe1
54};
55
57{
67
68
71
72
73/*
74 Port I/O
75*/
76
77#define SbWrite(sbdevice, subport, data) \
78 WRITE_PORT_UCHAR((PUCHAR) sbdevice->port + subport, data)
79
80#define SbRead(sbdevice, subport) \
81 READ_PORT_UCHAR((PUCHAR) sbdevice->port + subport)
82
83#define SbWriteReset(sbdevice, data) \
84 SbWrite(sbdevice, SB_RESET_PORT, data)
85
86#define SbWriteDataWithoutWait(sbdevice, data) \
87 SbWrite(sbdevice, SB_WRITE_DATA_PORT, data)
88
89#define SbReadDataWithoutWait(sbdevice) \
90 SbRead(sbdevice, SB_READ_DATA_PORT)
91
92
93#define SbGetWriteStatus(sbdevice) \
94 SbRead(sbdevice, SB_WRITE_STATUS_PORT)
95
96#define SbGetReadStatus(sbdevice) \
97 SbRead(sbdevice, SB_READ_STATUS_PORT)
98
99
100
104 UCHAR Port);
105
106#define WaitToWrite(sbdevice) \
107 WaitForReady(sbdevice, SB_WRITE_STATUS_PORT)
108
109#define WaitToRead(sbdevice) \
110 WaitForReady(sbdevice, SB_READ_STATUS_PORT)
111
115
116ULONG
119
123 ULONG SampleRate);
124
128 ULONG SampleRate);
129
133
137
141 ULONG BitDepth,
142 ULONG Channels,
143 ULONG BlockSize);
144
145
146/*
147 interrupt.c
148*/
149
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
CPPORT Port[4]
Definition: headless.c:35
unsigned short USHORT
Definition: pedump.c:61
BOOLEAN ResetSoundBlaster(PSOUND_BLASTER_PARAMETERS SBDevice)
Definition: control.c:59
NTAPI NTSTATUS REGISTRY_CALLBACK_ROUTINE(PDRIVER_OBJECT DriverObject, PWSTR RegistryPath)
Definition: sndblst.h:69
BOOLEAN WaitForReady(PSOUND_BLASTER_PARAMETERS SBDevice, UCHAR Port)
Definition: control.c:12
NTSTATUS EnableIrq(PDEVICE_OBJECT DeviceObject)
Definition: interrupt.c:27
@ SB_READ_STATUS_PORT
Definition: sndblst.h:38
@ SB_WRITE_DATA_PORT
Definition: sndblst.h:36
@ SB_READ_DATA_PORT
Definition: sndblst.h:35
@ SB_WRITE_STATUS_PORT
Definition: sndblst.h:37
@ SB_RESET_PORT
Definition: sndblst.h:34
BOOLEAN SetOutputSampleRate(PSOUND_BLASTER_PARAMETERS SBDevice, ULONG SampleRate)
Definition: control.c:143
@ NotDetected
Definition: sndblst.h:23
@ SoundBlaster
Definition: sndblst.h:24
@ SoundBlasterPro2
Definition: sndblst.h:27
@ SoundBlasterProMCV
Definition: sndblst.h:28
@ SoundBlaster2
Definition: sndblst.h:26
@ SoundBlaster16
Definition: sndblst.h:29
@ SoundBlasterPro
Definition: sndblst.h:25
ULONG GetSoundBlasterModel(PSOUND_BLASTER_PARAMETERS SBDevice)
Definition: control.c:95
struct _SOUND_BLASTER_PARAMETERS SOUND_BLASTER_PARAMETERS
struct _SOUND_BLASTER_PARAMETERS * PSOUND_BLASTER_PARAMETERS
@ SbSetInputRate
Definition: sndblst.h:46
@ SbGetSpeakerStatus
Definition: sndblst.h:52
@ SbAutoInitDmaInput
Definition: sndblst.h:44
@ SbAutoInitDmaOutput
Definition: sndblst.h:43
@ SbGetDspVersion
Definition: sndblst.h:53
@ SbEnableSpeaker
Definition: sndblst.h:50
@ SbPauseDac
Definition: sndblst.h:48
@ SbSetBlockSize
Definition: sndblst.h:47
@ SbSetOutputRate
Definition: sndblst.h:45
@ SbDisableSpeaker
Definition: sndblst.h:51
@ SbPauseDmaOutput
Definition: sndblst.h:49
BOOLEAN IsSampleRateCompatible(PSOUND_BLASTER_PARAMETERS SBDevice, ULONG SampleRate)
Definition: control.c:134
BOOLEAN EnableSpeaker(PSOUND_BLASTER_PARAMETERS SBDevice)
Definition: control.c:158
BOOLEAN StartSoundOutput(PSOUND_BLASTER_PARAMETERS SBDevice, ULONG BitDepth, ULONG Channels, ULONG BlockSize)
Definition: control.c:176
BOOLEAN DisableSpeaker(PSOUND_BLASTER_PARAMETERS SBDevice)
Definition: control.c:167
REGISTRY_CALLBACK_ROUTINE * PREGISTRY_CALLBACK_ROUTINE
Definition: sndblst.h:70
PKINTERRUPT interrupt
Definition: sndblst.h:60
PDRIVER_OBJECT driver
Definition: sndblst.h:58
uint16_t * PWSTR
Definition: typedefs.h:56
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
unsigned char UCHAR
Definition: xmlstorage.h:181