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.
| |||
void | nosound () | ||
Turn off the speaker. | |||
void | beep () | ||
Play a system beep. |
|
Frequency of the system beep.
|
|
The system beep duration (in ms).
|
|
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 } |
|
Turn off the speaker.
Definition at line 38 of file speaker.c.
|
|
Start a sound using the speaker.
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 } |