8#define SPEAKER_PORT_GATE 0x61
11#define SPEAKER_GATE_ENABLE 0x03
18 if (frequency >= 20 && frequency <= 20000)
enum intr_level intr_disable(void)
Disables interrupts and returns the previous interrupt status.
enum intr_level intr_get_level(void)
Returns the current interrupt status.
enum intr_level intr_set_level(enum intr_level level)
Enables or disables interrupts as specified by LEVEL and returns the previous interrupt status.
intr_level
Interrupts on or off?
@ INTR_ON
Interrupts enabled.
static uint8_t inb(uint16_t port)
Reads and returns a byte from PORT.
static void outb(uint16_t port, uint8_t data)
Writes byte DATA to PORT.
void pit_configure_channel(int channel, int mode, int frequency)
Configure the given CHANNEL in the PIT.
void speaker_off(void)
Turn off the PC speaker, by disconnecting the timer channel's output from the speaker.
void speaker_beep(void)
Briefly beep the PC speaker.
#define SPEAKER_PORT_GATE
Speaker port enable I/O register.
void speaker_on(int frequency)
Sets the PC speaker to emit a tone at the given FREQUENCY, in Hz.
#define SPEAKER_GATE_ENABLE
Speaker port enable bits.
void timer_msleep(int64_t ms)
Sleeps for approximately MS milliseconds.