General Info

Interface: TimerController_i386
Files: timercontroller_i386.h
Last change: 30/07/2002
Author: Luiz Henrique Shigunov
Description
System Functions

0x00 - Alloc - Allocate a counter
0x01 - Free - Free a counter

0x02 - Setup - Setup a counter

Description

This page describes the TimerController_i386 interface which provides access to the timer controller.

The PIT is the component responsible for counters. PC/AT and compatibles have one and, some times, two PITs.

Each PIT has 3 counters (0-2). Each counter is independent from each other and can operate in 6 different modes. The most used modes in the PC/AT are mode 2 (rate generator) and mode 3 (square-wave generator).

In PC/AT counters are assigned this way:

CounterUsed by
0assigned to IRQ0
1memory refresh
2PC/AT sound

Counter 1 generates a square-wave responsible for memory refresh in some systems. Counter 2 is used in PC/AT to generate sounds, it's not a sound card!

Counters are always enabled. There's no way to disable them.

0x00 - Alloc

Syntax

int TimerController_i386_Alloc(SysModManager_Module *module, unsigned int timer);

Properties

Description

This functions allocates counter timer for module.

Return value

0x01 - Free

Syntax

int TimerController_i386_Free(SysModManager_Module *module, unsigned int timer);

Properties

Description

This function frees counter timer used by module.

Return value

0x02 - Setup

Syntax

int TimerController_i386_Setup(SysModManager_Module *module, unsigned int timer, unsigned int value, unsigned int config);

Properties

Description

This function setups counter timer used by module.

value is the value to be counted.

config value must be the sum of:

Return value