15#ifndef ROS_SOUND_SBDSP_H
16#define ROS_SOUND_SBDSP_H
25#define SOUND_BLASTER_1_0 L"Sound Blaster 1.0"
26#define SOUND_BLASTER_1_5 L"Sound Blaster 1.5"
27#define SOUND_BLASTER_2_0 L"Sound Blaster 2.0"
28#define SOUND_BLASTER_PRO L"Sound Blaster Pro"
29#define SOUND_BLASTER_16 L"Sound Blaster 16"
35#define READ_SB_FM1_STATUS(bp) READ_PORT_UCHAR((PUCHAR) bp)
36#define WRITE_SB_FM1_REGISTER(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp, x)
37#define WRITE_SB_FM1_DATA(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x01, x)
39#define READ_SB_AFM_STATUS(bp) READ_PORT_UCHAR((PUCHAR) bp+0x02)
40#define WRITE_SB_AFM_REGISTER(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x02, x)
41#define WRITE_SB_AFM_DATA(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x03, x)
43#define WRITE_SB_MIXER_REGISTER(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x04, x)
44#define READ_SB_MIXER_DATA(bp) READ_PORT_UCHAR((PUCHAR) bp+0x05)
45#define WRITE_SB_MIXER_DATA(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x05, x)
47#define WRITE_SB_DSP_RESET(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x06, x)
49#define READ_SB_FM2_STATUS(bp) READ_PORT_UCHAR((PUCHAR) bp+0x08)
50#define WRITE_SB_FM2_REGISTER(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x08, x)
51#define WRITE_SB_FM2_DATA(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x09, x)
53#define READ_SB_DSP_DATA(bp) READ_PORT_UCHAR((PUCHAR) bp+0x0A)
54#define WRITE_SB_DSP_DATA(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x0C, x)
55#define WRITE_SB_DSP_COMMAND(bp, x) WRITE_PORT_UCHAR((PUCHAR) bp+0x0C, x)
58#define SB_DSP_CLEAR_TO_SEND(bp) \
59 ( ! (READ_PORT_UCHAR((PUCHAR) bp+0x0C) & 0x80 ) )
62#define SB_DSP_DATA_AVAILABLE(bp) \
63 ( READ_PORT_UCHAR((PUCHAR) bp+0x0E) & 0x80 )
66#define SB_DSP_READY 0xAA
72#define SB_DSP_OUTPUT_RATE 0x41
73#define SB_DSP_INPUT_RATE 0x42
74#define SB_DSP_BLOCK_SIZE 0x48
75#define SB_DSP_SPEAKER_ON 0xD1
76#define SB_DSP_SPEAKER_OFF 0xD3
77#define SB_DSP_SPEAKER_STATUS 0xD8
78#define SB_DSP_VERSION 0xE1
83#define SB_MIX_VOC_LEVEL 0x04
84#define SB_MIX_LEGACY_MIC_LEVEL 0x0A
85#define SB_MIX_MASTER_LEVEL 0x22
86#define SB_MIX_FM_LEVEL 0x26
87#define SB_MIX_CD_LEVEL 0x28
88#define SB_MIX_LINE_LEVEL 0x2E
93#define SB_MIX_RESET 0x00
94#define SB_MIX_MASTER_LEFT_LEVEL 0x30
95#define SB_MIX_MASTER_RIGHT_LEVEL 0x31
96#define SB_MIX_VOC_LEFT_LEVEL 0x32
97#define SB_MIX_VOC_RIGHT_LEVEL 0x33
98#define SB_MIX_MIDI_LEFT_LEVEL 0x34
99#define SB_MIX_MIDI_RIGHT_LEVEL 0x35
100#define SB_MIX_CD_LEFT_LEVEL 0x36
101#define SB_MIX_CD_RIGHT_LEVEL 0x37
102#define SB_MIX_LINE_LEFT_LEVEL 0x38
103#define SB_MIX_LINE_RIGHT_LEVEL 0x39
104#define SB_MIX_MIC_LEVEL 0x3A
105#define SB_MIX_PC_SPEAKER_LEVEL 0x3B
106#define SB_MIX_OUTPUT_SWITCHES 0x3C
107#define SB_MIX_INPUT_LEFT_SWITCHES 0x3D
108#define SB_MIX_INPUT_RIGHT_SWITCHES 0x3E
109#define SB_MIX_INPUT_LEFT_GAIN 0x3F
110#define SB_MIX_INPUT_RIGHT_GAIN 0x40
111#define SB_MIX_OUTPUT_LEFT_GAIN 0x41
112#define SB_MIX_OUTPUT_RIGHT_GAIN 0x42
113#define SB_MIX_AGC 0x43
114#define SB_MIX_TREBLE_LEFT_LEVEL 0x44
115#define SB_MIX_TREBLE_RIGHT_LEVEL 0x45
116#define SB_MIX_BASS_LEFT_LEVEL 0x46
117#define SB_MIX_BASS_RIGHT_LEVEL 0x47
123#define SB_MIX_MIDI_LEFT_SWITCH 0x01
124#define SB_MIX_MIDI_RIGHT_SWITCH 0x02
125#define SB_MIX_LINE_LEFT_SWITCH 0x04
126#define SB_MIX_LINE_RIGHT_SWITCH 0x08
127#define SB_MIX_CD_LEFT_SWITCH 0x10
128#define SB_MIX_CD_RIGHT_SWITCH 0x20
129#define SB_MIX_MIC_SWITCH 0x40
return pProvider IsEnabled(ProviderControl)
BOOLEAN SbDspIsValidOutputRate(IN UCHAR MajorVersion, IN UCHAR MinorVersion, IN USHORT Rate, IN BOOLEAN Stereo)
BOOLEAN SbMixerIsAGCEnabled(IN PUCHAR BasePort)
NTSTATUS SbDspReset(IN PUCHAR BasePort, IN ULONG Timeout)
NTSTATUS SbMixerUnpackLevelData(IN UCHAR Line, IN UCHAR PackedLevel, OUT PUCHAR Level)
NTSTATUS SbDspEnableSpeaker(IN PUCHAR BasePort, IN ULONG Timeout)
VOID SbMixerEnableAGC(IN PUCHAR BasePort)
NTSTATUS SbDspDisableSpeaker(IN PUCHAR BasePort, IN ULONG Timeout)
NTSTATUS SbDspWaitToRead(IN PUCHAR BasePort, IN ULONG Timeout)
NTSTATUS SbDsp4SetOutputRate(IN PUCHAR BasePort, IN USHORT Rate, IN ULONG Timeout)
NTSTATUS SbDspWaitToWrite(IN PUCHAR BasePort, IN ULONG Timeout)
NTSTATUS SbDspWrite(IN PUCHAR BasePort, IN UCHAR DataByte, IN ULONG Timeout)
NTSTATUS SbDspRead(IN PUCHAR BasePort, OUT PUCHAR DataByte, IN ULONG Timeout)
NTSTATUS SbDspIsSpeakerEnabled(IN PUCHAR BasePort, OUT PBOOLEAN IsEnabled, IN ULONG Timeout)
NTSTATUS SbMixerSetLevel(IN PUCHAR BasePort, IN UCHAR Line, IN UCHAR Level)
NTSTATUS SbMixerPackLevelData(IN UCHAR Line, IN UCHAR Level, OUT PUCHAR PackedLevel)
BOOLEAN SbDspIsValidInputRate(IN UCHAR MajorVersion, IN UCHAR MinorVersion, IN USHORT Rate, IN BOOLEAN Stereo)
VOID SbMixerReset(IN PUCHAR BasePort)
NTSTATUS SbDsp4SetInputRate(IN PUCHAR BasePort, IN USHORT Rate, IN ULONG Timeout)
NTSTATUS SbMixerGetLevel(IN PUCHAR BasePort, IN UCHAR Line, OUT PUCHAR Level)
VOID SbMixerDisableAGC(IN PUCHAR BasePort)
NTSTATUS SbDspGetVersion(IN PUCHAR BasePort, OUT PUCHAR MajorVersion, OUT PUCHAR MinorVersion, IN ULONG Timeout)
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level