ReactOS  0.4.15-dev-5122-g72bdbdd
speaker.c File Reference
#include "precomp.h"
Include dependency graph for speaker.c:

Go to the source code of this file.

Functions

NTSTATUS SbDspEnableSpeaker (IN PUCHAR BasePort, IN ULONG Timeout)
 
NTSTATUS SbDspDisableSpeaker (IN PUCHAR BasePort, IN ULONG Timeout)
 
NTSTATUS SbDspIsSpeakerEnabled (IN PUCHAR BasePort, OUT PBOOLEAN IsEnabled, IN ULONG Timeout)
 

Function Documentation

◆ SbDspDisableSpeaker()

NTSTATUS SbDspDisableSpeaker ( IN PUCHAR  BasePort,
IN ULONG  Timeout 
)

Definition at line 27 of file speaker.c.

30 {
31  return SbDspWrite(BasePort, SB_DSP_SPEAKER_OFF, Timeout);
32 }
NTSTATUS SbDspWrite(IN PUCHAR BasePort, IN UCHAR DataByte, IN ULONG Timeout)
Definition: dsp_io.c:99
static ULONG Timeout
Definition: ping.c:61
#define SB_DSP_SPEAKER_OFF
Definition: sbdsp.h:76

◆ SbDspEnableSpeaker()

NTSTATUS SbDspEnableSpeaker ( IN PUCHAR  BasePort,
IN ULONG  Timeout 
)

Definition at line 19 of file speaker.c.

22 {
23  return SbDspWrite(BasePort, SB_DSP_SPEAKER_ON, Timeout);
24 }
NTSTATUS SbDspWrite(IN PUCHAR BasePort, IN UCHAR DataByte, IN ULONG Timeout)
Definition: dsp_io.c:99
#define SB_DSP_SPEAKER_ON
Definition: sbdsp.h:75
static ULONG Timeout
Definition: ping.c:61

◆ SbDspIsSpeakerEnabled()

NTSTATUS SbDspIsSpeakerEnabled ( IN PUCHAR  BasePort,
OUT PBOOLEAN  IsEnabled,
IN ULONG  Timeout 
)

Definition at line 38 of file speaker.c.

42 {
44  UCHAR SpeakerStatus = 0;
45 
46  if ( ! IsEnabled )
48 
49  /* Request the speaker status */
51  if ( Status != STATUS_SUCCESS )
52  return Status;
53 
54  /* Obtain the status */
55  Status = SbDspRead(BasePort, &SpeakerStatus, Timeout);
56  if ( Status != STATUS_SUCCESS )
57  return Status;
58 
59  DbgPrint("SBDSP - SpeakerStatus is %02x\n", SpeakerStatus);
60  *IsEnabled = (SpeakerStatus == 0xFF);
61 
62  return STATUS_SUCCESS;
63 }
NTSTATUS SbDspWrite(IN PUCHAR BasePort, IN UCHAR DataByte, IN ULONG Timeout)
Definition: dsp_io.c:99
#define DbgPrint
Definition: hal.h:12
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS SbDspRead(IN PUCHAR BasePort, OUT PUCHAR DataByte, IN ULONG Timeout)
Definition: dsp_io.c:120
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:476
Status
Definition: gdiplustypes.h:24
return pProvider IsEnabled(ProviderControl)
unsigned char UCHAR
Definition: xmlstorage.h:181
static ULONG Timeout
Definition: ping.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
#define SB_DSP_SPEAKER_STATUS
Definition: sbdsp.h:77