IBNOS
Macros | Functions
pit.h File Reference
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for pit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PIT_CHANNEL_BASE   0x40
 
#define PIT_CHANNEL0_PORT   (PIT_CHANNEL_BASE)
 
#define PIT_CHANNEL1_PORT   (PIT_CHANNEL_BASE+1)
 
#define PIT_CHANNEL2_PORT   (PIT_CHANNEL_BASE+2)
 
#define PIT_MODE_PORT   0x43
 
#define PIT_BINARY   0
 
#define PIT_BCD   1
 
#define PIT_INTERNAL   0
 
#define PIT_LSB   1
 
#define PIT_MSB   2
 
#define PIT_LSB_MSB   3
 
#define PIT_CONTROL_VALUE(FORMAT, MODE, REGISTER, CHANNEL)   ((CHANNEL) << 6 | (REGISTER) << 4 | (MODE) << 1 | FORMAT)
 
#define PIT_CHANNEL_COUNT   3
 
#define PIT_FREQUENCY   1193182
 
Timer Modes

#define PIT_MODE_INTERRUPT_ON_TERMINAL   0
 
#define PIT_MODE_ONE_SHOT   1
 
#define PIT_MODE_RATE_GENERATOR   2
 
#define PIT_MODE_SQUARE_WAVE_GENERATOR   3
 
#define PIT_MODE_SOFTWARE_STROBE   4
 
#define PIT_MODE_HARDWARE_STROBE   5
 

Functions

void pitSetValue (uint32_t channel, uint32_t mode, uint16_t value)
 Internal function to set a value of the PIT. More...
 
void pitSetFrequency (uint32_t channel, uint32_t frequency)
 Set frequency of the programmable interval timer. More...
 

Macro Definition Documentation

◆ PIT_BCD

#define PIT_BCD   1

Definition at line 61 of file pit.h.

◆ PIT_BINARY

#define PIT_BINARY   0

Definition at line 60 of file pit.h.

◆ PIT_CHANNEL0_PORT

#define PIT_CHANNEL0_PORT   (PIT_CHANNEL_BASE)

Definition at line 55 of file pit.h.

◆ PIT_CHANNEL1_PORT

#define PIT_CHANNEL1_PORT   (PIT_CHANNEL_BASE+1)

Definition at line 56 of file pit.h.

◆ PIT_CHANNEL2_PORT

#define PIT_CHANNEL2_PORT   (PIT_CHANNEL_BASE+2)

Definition at line 57 of file pit.h.

◆ PIT_CHANNEL_BASE

#define PIT_CHANNEL_BASE   0x40

Definition at line 54 of file pit.h.

◆ PIT_CHANNEL_COUNT

#define PIT_CHANNEL_COUNT   3

Definition at line 71 of file pit.h.

◆ PIT_CONTROL_VALUE

#define PIT_CONTROL_VALUE (   FORMAT,
  MODE,
  REGISTER,
  CHANNEL 
)    ((CHANNEL) << 6 | (REGISTER) << 4 | (MODE) << 1 | FORMAT)

Definition at line 68 of file pit.h.

◆ PIT_FREQUENCY

#define PIT_FREQUENCY   1193182

Definition at line 72 of file pit.h.

◆ PIT_INTERNAL

#define PIT_INTERNAL   0

Definition at line 63 of file pit.h.

◆ PIT_LSB

#define PIT_LSB   1

Definition at line 64 of file pit.h.

◆ PIT_LSB_MSB

#define PIT_LSB_MSB   3

Definition at line 66 of file pit.h.

◆ PIT_MODE_PORT

#define PIT_MODE_PORT   0x43

Definition at line 58 of file pit.h.

◆ PIT_MSB

#define PIT_MSB   2

Definition at line 65 of file pit.h.