diff options
Diffstat (limited to 'lib/reg')
-rw-r--r-- | lib/reg/pit.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/reg/pit.h b/lib/reg/pit.h new file mode 100644 index 0000000..90587f6 --- /dev/null +++ b/lib/reg/pit.h @@ -0,0 +1,26 @@ +#ifndef LIB_REG_PIT_H +#define LIB_REG_PIT_H + +#include "regdefs.h" + +#define PIT_MCR REG_32(0x40037000) // PIT Module Control Register +#define MCR_MDIS 1 +#define MCR_FRZ 0 + +#define PIT_LDVAL(n) REG_32(0x40037100 + 16 * (n)) // Timer Load Value Register +#define LDVAL_TSV 0 // Timer Start Value +#define LDVAL_TSV_M (uint32_t)BITS(32) + +#define PIT_CVAL(n) REG_32(0x40037104 + 16 * (n)) // Current Timer Value Register +#define CVAL_TVL 0 // Current Timer Value +#define CVAL_TVL_M (uint32_t)BITS(32) + +#define PIT_TCTRL(n) REG_32(0x40037108 + 16 * (n)) // Timer Control Register +#define TCTRL_CHN 2 // Chain Mode +#define TCTRL_TIE 1 // Timer Interrupt Enable +#define TCTRL_TEN 0 // Timer Enable + +#define PIT_TFLG(n) REG_32(0x4003710C + 16 * (n)) // Timer Flag Register +#define TFLG_TIF 0 // Timer Interrupt Flag + +#endif /* LIB_REG_PIT_H */ |