X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ftimer.h;h=1ca31e208c37b06acdb9698e1c7d0e530f7aecfd;hb=38a008b8d1a3a20c401397b4e132fb578e5f0c10;hp=065fdcfde102c2cb39afd2c18a2405b998fa9701;hpb=993155fee2327f1f3cda285c9548bbb09688a3f3;p=rpikern diff --git a/src/timer.h b/src/timer.h index 065fdcf..1ca31e2 100644 --- a/src/timer.h +++ b/src/timer.h @@ -1,30 +1,8 @@ #ifndef TIMER_H_ #define TIMER_H_ -#include "config.h" +extern volatile unsigned long num_ticks; -#define TM_BASE (IO_BASE | 0xb000) - -#define TM_REG(x) (*(volatile uint32_t*)(TIMER_BASE | (x))) -#define TM_LOAD TM_REG(0x400) -#define TM_VALUE TM_REG(0x404) -#define TM_CTL TM_REG(0x408) -#define TM_ICLR TM_REG(0x40c) -#define TM_IRAW TM_REG(0x410) -#define TM_IMSK TM_REG(0x414) -#define TM_RELOAD TM_REG(0x418) -#define TM_PREDIV TM_REG(0x41c) -#define TM_COUNT TM_REG(0x420) - -#define TMCTL_23BIT 0x000002 -#define TMCTL_DIV16 0x000004 -#define TMCTL_DIV256 0x000008 -#define TMCTL_DIV1 0x00000c -#define TMCTL_IEN 0x000020 -#define TMCTL_EN 0x000080 -#define TMCTL_DBGHALT 0x000100 -#define TMCTL_CNTEN 0x000200 - -#define TMCTL_PRESCALER(x) (((uint32_t)(x) & 0xff) << 16) +void timer_init(void); #endif /* TIMER_H_ */