MT_SetWDTMode

■Description

Set up the time-up mode of the watchdog timer.

■Synopsis

MT_SetWDTMode(fd, ucMode)

■Argument

fd
[C/C++] int
[Python] ctypes.c_int
Please specify handle acquired by MT_Open function.
ucMode
[C/C++] unsigned char
[Python] ctypes.c_ubyte
The following modes can be specified.
    WDT_SCI : Power is forced off and it turns on after a while.
    WDT_POH : Perform DO (High) output.
    WDT_POL : Perform DO (Low) output.
    

■RETURN VALUE

[C/C++] int
[Python] ctypes.c_int
If the function succeeds, NO_ERROR is returned.
If the function fails, DRIVER_FAIL is returned.
The other errors : Error code details

■Sample Program Code

[C/C++]
  int fd;
  int ret;
  unsigned char wdtMode;

  wdtMode = WDT_POH;  /* Output to DO(high) */

  if ( (fd = MT_Open(NULL) ) < 0) {
    printf("Faild to open i2c port\n");
    return 1;
  }

  ret = MT_SetWDTMode(fd, wdtMode);
  if (ret != 0) {
      printf("MT_SetWDT error");
  }

  MT_Close(fd);
  
[Python]
  import mtdll_arm

  wdtMode = mtdll_arm.WDT_POH;   # Output to DO(high)

  fd = mtdll_arm.MT_Open(None);

  ret = mtdll_arm.MT_SetWDTMode(fd, wdtMode);
  if ret != 0:
      print("MT_SetWDTMode error");

  mtdll_arm.MT_Close(fd);
  



Function List