Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

System Speaker
[Kernel]


Defines

#define SYSTEM_BEEP_FREQ   0x533
 Frequency of the system beep.

#define SYSTEM_BEEP_TIME   20
 The system beep duration (in ms).


Functions

void sound (uint32_t frequency)
 Start a sound using the speaker.
Parameters:
frequency  The frequency of the sound.


void nosound ()
 Turn off the speaker.

void beep ()
 Play a system beep.


Detailed Description

The system speaker driver.

Define Documentation

#define SYSTEM_BEEP_FREQ   0x533
 

Frequency of the system beep.

Definition at line 20 of file speaker.h.

#define SYSTEM_BEEP_TIME   20
 

The system beep duration (in ms).

Definition at line 22 of file speaker.h.


Function Documentation

void beep  
 

Play a system beep.

Definition at line 51 of file speaker.c.

00052 {
00053         sound(SYSTEM_BEEP_FREQ);
00054         delay(SYSTEM_BEEP_TIME);
00055         nosound();
00056 }

void nosound  
 

Turn off the speaker.

Definition at line 38 of file speaker.c.

00039 {
00040         dword IF;
00041 
00042         IF = GET_IF();
00043         SET_IF(0);
00044 
00045         outportb(0x61, inportb(0x61) & 0xFC);
00046 
00047         SET_IF(IF);
00048 }

void sound uint32_t    frequency
 

Start a sound using the speaker.

Parameters:
frequency  The frequency of the sound.

Definition at line 18 of file speaker.c.

00019 {
00020         dword x, IF;
00021 
00022         if ((frequency<19) || (frequency>22000)) return;
00023 
00024         x = TIMER_FREQ / frequency;
00025 
00026         IF = GET_IF();
00027         SET_IF(0);
00028 
00029         outportb(0x61, inportb(0x61) | 3);
00030         outportb(0x43, 0xB6);
00031         outportb(0x42, x & 0xFF);
00032         outportb(0x42, x >> 8);
00033 
00034         SET_IF(IF);
00035 }


Generated on Fri Feb 20 15:32:22 2004 for Minirighi by doxygen1.2.18