ApertureOS
pit.h
Go to the documentation of this file.
1 #ifndef _PIT_H_
2 #define _PIT_H_
3 
4 #include "types.h"
5 
6 #define PIT_CH0_DATA 0x40
7 #define PIT_CH2_DATA 0x42
8 #define PIT_CMD 0x43
9 
10 #define PIT_CH0 0x0
11 #define PIT_CH2 0x2
12 
13 #define PIT_ACCESS_LATCH 0x0
14 #define PIT_ACCESS_LO_BYTE 0x1
15 #define PIT_ACCESS_HI_BYTE 0x2
16 
17 #define PIT_MODE_INTERRUPT 0
18 #define PIT_MODE_ONESHOT 1
19 #define PIT_MODE_RATE 2
20 #define PIT_MODE_SQUARE_WAVE 3
21 #define PIT_MODE_SOFT_STROBE 4
22 #define PIT_MODE_HARD_STROBE 5
23 
24 #define PIT_VAL_16BIT 0
25 #define PIT_VAL_BCD 1
26 
27 #define PIT_FREQUENCY_HZ 19886
28 //#define PIT_FREQUENCY_HZ 50
29 
30 void PIT_Initialize();
31 
32 //Prevent public access to this function
33 //void PIT_SetFrequency(uint8_t channel, uint8_t access,uint8_t mode, uint8_t valType, uint32_t frequency);
34 uint32_t PIT_GetFrequency();
35 void PIT_Sleep(uint32_t interval);
36 
37 void PIT_SetEnableMode(bool enabled);
38 
39 #endif /* end of include guard: _PIT_H_ */
void PIT_SetEnableMode(bool enabled)
Definition: pit.c:99
void PIT_Sleep(uint32_t interval)
Definition: pit.c:54
uint32_t PIT_GetFrequency()
void PIT_Initialize()
Definition: pit.c:105