The Programmable Interval Timer has two purposes: Generate interrupts, and control the PC speaker.

It has 3 channels:

Channel 0 can generate an interrupt, IRQ 0, at a defined frequency. We set it up in TimerInit(), and use it in SysTimerRead().

Channel 1 was used historically to refresh the DRAM, but now it is obsolete as the hardware does this itself.  Channel 1 is 
useless and might not even be implemented anymore on modern machines.

Channel 2's output is connected to the PC speaker.

The Command port is used to control each of these 3 channels. The relevant flags are defined.

See Sound() for how the PC speaker frequency is changed.