#include <const.h>
#include <arch/i386.h>
#include <kernel/clock.h>
#include <kernel/speaker.h>
Go to the source code of this file.
Functions | |||
void | sound (uint32_t frequency) | ||
Start a sound using the speaker.
| |||
void | nosound () | ||
Turn off the speaker. | |||
void | beep () | ||
Play a system beep. |
Definition in file speaker.c.
|
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 } |