Newer
Older
Scratch / lockwasher / src / sys / isa / pit.c
@Christopher W. Olsen Christopher W. Olsen on 25 Oct 2019 478 bytes Scratch
#include <isa/pit.h>
#include <sys/io.h>

/************************************************************************

Function: void initPIT()
Description: This Function Will Initialize The Programmable Timer
Notes:

************************************************************************/
void initPIT(int timerHz) {
  outportByteP(0x43,0x3C);
  outportByteP(0x40,((1193180/timerHz) & 0x00FF));
  outportByte(0x40,(((1193180/timerHz) >> 8) & 0x00FF));
  //Return
  return;
  }