tape-kernel 1.0
a modular modern independent kernel
Loading...
Searching...
No Matches
pit.c File Reference
#include "pit.h"
#include "../io/io.h"
Include dependency graph for pit.c:

Go to the source code of this file.

Macros

#define PIT_PORT   0x40
#define PIT_CMD_PORT   0x43
#define PIT_FREQUENCY   1193182

Functions

void __pinit (void)
 pinit initializes the programmable interval timer
void __delay (uint32_t ms)
 delay pauses execution for a number of milliseconds

Macro Definition Documentation

◆ PIT_CMD_PORT

#define PIT_CMD_PORT   0x43

Definition at line 5 of file pit.c.

Referenced by __delay(), and __pinit().

◆ PIT_FREQUENCY

#define PIT_FREQUENCY   1193182

Definition at line 6 of file pit.c.

Referenced by __pinit().

◆ PIT_PORT

#define PIT_PORT   0x40

Definition at line 4 of file pit.c.

Referenced by __delay(), and __pinit().

Function Documentation

◆ __delay()

void __delay ( uint32_t ms)

delay pauses execution for a number of milliseconds

delay is a function that busy-waits on the pit counter for the specified number of milliseconds

Parameters
ms,thenumber of milliseconds to wait

using delay is done with

#include "../lib/pit.h" //or just pit.h
delay(500); //wait half a second
#define delay
Definition pit.h:8
See also
pinit()

Definition at line 46 of file pit.c.

References inb, outb, PIT_CMD_PORT, and PIT_PORT.

◆ __pinit()

void __pinit ( void )

pinit initializes the programmable interval timer

pinit is a function that configures the pit to fire at 1000 hz providing 1ms resolution for timing purposes

using pinit is done with

#include "../lib/pit.h" //or just pit.h
#define pinit
Definition pit.h:7
See also
delay()

Definition at line 22 of file pit.c.

References outb, PIT_CMD_PORT, PIT_FREQUENCY, and PIT_PORT.