PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
#include "devices/pit.h"
#include <debug.h>
#include <stdint.h>
#include "threads/interrupt.h"
#include "threads/io.h"
Go to the source code of this file.
Macros | |
#define | PIT_PORT_CONTROL 0x43 |
Interface to 8254 Programmable Interrupt Timer (PIT). More... | |
#define | PIT_PORT_COUNTER(CHANNEL) (0x40 + (CHANNEL)) |
Counter port. More... | |
#define | PIT_HZ 1193180 |
PIT cycles per second. More... | |
Functions | |
void | pit_configure_channel (int channel, int mode, int frequency) |
Configure the given CHANNEL in the PIT. More... | |
#define PIT_PORT_CONTROL 0x43 |
#define PIT_PORT_COUNTER | ( | CHANNEL | ) | (0x40 + (CHANNEL)) |
void pit_configure_channel | ( | int | channel, |
int | mode, | ||
int | frequency | ||
) |
Configure the given CHANNEL in the PIT.
In a PC, the PIT's three output channels are hooked up like this:
MODE specifies the form of output:
FREQUENCY is the number of periods per second, in Hz.
Definition at line 46 of file pit.c.
References ASSERT, intr_disable(), intr_set_level(), mode, outb(), PIT_HZ, PIT_PORT_CONTROL, and PIT_PORT_COUNTER.
Referenced by speaker_on(), and timer_init().