Altera_Forum
Honored Contributor
15 years agoPointer to timer registers
The following line creates a pointer to a structure used to access a timer:
struct TIMER_REGS *TIMER = (struct TIMER_REGS *)(TIMER_BASE | 0x80000000); This works when my timer's base address is 0x00000020 If I change the base address to 0x00000000, it does not work -- meaning code interfacing the structure is not interfacing the timer registers. I "borowed" this code after finding it in an internet search and I am not understanding the last part. Why is an offset (if that is what it is) being added to the base address? What is the underlying mechanic? Thanks for your help, Mike