MT_SetPowerOff

■Description

Controls the system power off.

■Synopsis

MT_SetPowerOff(fd, PowerOffTiming)

■Argument

[C/C++] int
[Python] ctypes.c_int
Please specify handle acquired by MT_Open function.
PowerOffTiming
[C/C++] int
[Python] ctypes.c_int
Set the timing of the Power off.
    0: Immediately
    1: After 5 second
    2: After 10 second
     .... 
    15: After 75 second
    

■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;
  int rasPowerOffTiming = 4;  /* turn off After 20 sec ( rasPowerOffTiming * 5 )  */

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

  ret = MT_SetPowerOff(fd, rasPowerOffTiming);
  if (ret != 0) {
    printf("MT_SetPowerOff error");
  }

  MT_Close(fd);
  
[Python]
  import mtdll_arm

  rasPowerOffTiming = 4;   # turn off After 20 sec ( rasPowerOffTiming * 5 )

  fd = mtdll_arm.MT_Open(None);

  ret = mtdll_arm.MT_SetPowerOff(fd, rasPowerOffTiming);
  if (ret != 0) {
      print("MT_SetPowerOff error [", '{:x}'.format(ret), "]");

  }

  mtdll_arm.MT_Close(fd);

  



Function List