[C/C++]
typedef struct _WDTVAL {
unsigned char ucTimeOut;
long lTickCount
} WDTVAL, *PWDTVAL;
[Python]
class WDTVAL(ctypes.Structure):
_fields_ = ("ucTimeOut", c_ubyte), ("lTickCount", c_int)
| Member variable | Setting information |
|---|---|
| ucTimeOut (Timeout value) |
Sets the time-up time of the watchdog timer. The setting range is from 1 to 255 (seconds). |
| lTickCount (Tick count value) |
Set the tick count value. |
int fd;
int ret;
WDTVAL wdt;
wdt.ucTimeOut = 120;
wdt.lTickCount = 10;
if ( (fd = MT_Open(NULL) ) < 0) {
printf("Faild to open i2c port\n");
return 1;
}
ret = MT_SetWDT(fd, &wdt);
if (ret != 0) {
printf("MT_SetWDT error");
}
MT_Close(fd);
import mtdll_arm
wdt = WDTVAL();
wdt.ucTimeOut = 120;
wdt.lTickCount = 10;
fd = mtdll_arm.MT_Open(None);
ret = mtdll_arm.MT_SetWDT(fd, wdt);
if ret != 0:
print("MT_SetWDT error");
mtdll_arm.MT_Close(fd);