Barrelfish
Macros | Functions
pit.h File Reference

x86 legacy timer driver (PIT). More...

Macros

#define PIT_TIMER0_PERIOD_NS   838
 Period of LPC timer 0 counter, in nanoseconds.
 

Functions

void pit_timer0_set (uint16_t count, bool periodic, bool only_lsb)
 Set hardware timer mode and count value. More...
 
uint16_t pit_timer0_read (void)
 Read current value of timer. More...
 

Detailed Description

x86 legacy timer driver (PIT).

Function Documentation

uint16_t pit_timer0_read ( void  )

Read current value of timer.

Returns
the current value of timer 0
void pit_timer0_set ( uint16_t  count,
bool  periodic,
bool  only_lsb 
)

Set hardware timer mode and count value.

Sets timer 0 as either a rate generator (mode 2) or one-shot timer (mode 0) and sets its value. This function currently does not deal with any other timers.

Parameters
countCount for oneshot timer, rate for ticker
periodicTrue for a periodic timer, false for oneshot