| 전자부품 데이터시트 검색엔진 |
|
UM0851 데이터시트(PDF) 214 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 데이터시트(HTML) 214 Page - STMicroelectronics |
|
214 / 245 page ![]() Miscellaneous device drivers UM0851 214/245 Doc ID 16604 Rev 2 fd = open(wdt_dev, O_RDWR); if (fd < 0) { printf("Error in opening device\n"); } Configuring WDT IOCTL calls can be used to program and configure watchdog timer. The following code snippet demonstrates the use of these ioctls. int ret = 0; int timeleft=0; struct watchdog_info ident; int timeout = 45; /* in seconds */ /* to find out supported options in watchdog */ ret = ioctl(fd, WDIOC_GETSUPPORT, &ident); /* to set time out */ ioctl(fd, WDIOC_SETTIMEOUT, &timeout); /* to find out how much time is left before reset */ ret = ioctl(fd, WDIOC_GETTIMEOUT, &timeleft); /* Refresh watchdog timer at every 10 secs to prevent reset */ while (1) { ioctl(fd, WDIOC,KEEPALIVE, 0); sleep(10); } The following table lists the standard ioctl calls supported by the SPEAr watchdog driver. Watchdog deamon The watchdog is a daemon. It opens /dev/watchdog, and keeps writing to it often enough to keep the kernel from resetting, at least once per minute. Each write delays the reboot time another minute. After a minute the watchdog hardware generates a reset. The watchdog can be stopped without causing a reboot if the device /dev/watchdog is closed correctly, unless your kernel is compiled with the CONFIG_WATCHDOG_NOWAYOUT option enabled. Table 56. Watchdog IOCTLs IOCTLs Purpose WDIOC_GETSUPPORT The fields returned in the ident structure are: identity: A string identifying the watchdog driver firmware_version: the firmware version of the card if available. options: A flags describing what the device supports. WDIOC_KEEPALIVE This ioctl does exactly the same thing as a write to the watchdog device and hence refreshes the timer WDIOC_SETTIMEOUT Set time out in seconds, after which reset would be generated (if wdt is not refreshed) WDIOC_GETTIMEOUT Query the current timeout |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |