PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
#include "devices/speaker.h"
#include "devices/pit.h"
#include "threads/io.h"
#include "threads/interrupt.h"
#include "devices/timer.h"
Go to the source code of this file.
Macros | |
#define | SPEAKER_PORT_GATE 0x61 |
Speaker port enable I/O register. More... | |
#define | SPEAKER_GATE_ENABLE 0x03 |
Speaker port enable bits. More... | |
Functions | |
void | speaker_on (int frequency) |
Sets the PC speaker to emit a tone at the given FREQUENCY, in Hz. More... | |
void | speaker_off (void) |
Turn off the PC speaker, by disconnecting the timer channel's output from the speaker. More... | |
void | speaker_beep (void) |
Briefly beep the PC speaker. More... | |
#define SPEAKER_PORT_GATE 0x61 |
void speaker_beep | ( | void | ) |
Briefly beep the PC speaker.
Definition at line 48 of file speaker.c.
References intr_get_level(), INTR_ON, speaker_off(), speaker_on(), and timer_msleep().
Referenced by vga_putc().
void speaker_off | ( | void | ) |
Turn off the PC speaker, by disconnecting the timer channel's output from the speaker.
Definition at line 39 of file speaker.c.
References inb(), intr_disable(), intr_set_level(), outb(), SPEAKER_GATE_ENABLE, and SPEAKER_PORT_GATE.
Referenced by speaker_beep(), and speaker_on().
void speaker_on | ( | int | frequency | ) |
Sets the PC speaker to emit a tone at the given FREQUENCY, in Hz.
Definition at line 16 of file speaker.c.
References inb(), intr_disable(), intr_set_level(), outb(), pit_configure_channel(), SPEAKER_GATE_ENABLE, speaker_off(), and SPEAKER_PORT_GATE.
Referenced by speaker_beep().