Hi,
Here's the code I use:
volatile char *WDOGctrl;
volatile char *WDOGfeed;
WDOGctrl=(char *) mmap(0,4096, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd,
0x23800000);
if (WDOGctrl==MAP_FAILED) { perror("mmap 1"); return 0; }
WDOGfeed=(char *) mmap(0,4096, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd,
0x23C00000);
if (WDOGctrl==MAP_FAILED) { perror("mmap 2"); return 0; }
// Set watchdog off...
WDOGfeed[0]=0x05;
WDOGctrl[0]=0x00;
// Set watchdog to 8 seconds...
WDOGfeed[0]=0x05;
WDOGctrl[0]=0x07;
// Release memory before exiting program.
munmap((void *)0x23800000,getpagesize());
munmap((void *)0x23C00000,getpagesize());
Hope this helps,
PJE
--- In "arm.veeraiyan" <> wrote:
>
> Hi i am new to ARM
> i am using TS-300 board with linux-2.4
>
> i want access watchdog timer like setting timer counter to some value to
> reset the system after some seconds through c programming.......
>
>
> can any body help me how to do that........
>
>
> Thanks in advance
>
> veeraiyan.c
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|