MT_GetIRQState

■Description

The Interrupt status is acquired.

■Synopsis

MT_GetIRQState(fd, irqState)

■Argument

fd
[C/C++] int
[Python] ctypes.c_int
Please specify handle acquired by MT_Open function.
irqState
[C/C++] int *
[Python] ctypes.POINTER(ctypes.c_int)
You can specify a Pointer to a variable that stores the Interrupt state to be acquired.
    bit0: Notify shutdown       0:Disabled (default) 1:Enabled
    bit1: Notify RTC Interrupt  0:Disabled (default) 1:Enabled
    
The shutdown notification is reset by calling this function.
The RTC interrupt notification is reset by deinterrupting the RTC driver.

■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 = 0;
  int irqState;

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

  ret = MT_GetIRQState(fd, &irqState);
  if (ret != 0) {
      printf("MT_GetIRQState error\n");
  }
  else {
      printf("%02xh", irqState);
  }

  MT_Close(fd);
  
[Python]
  import ctypes
  import sys
  import mtdll_arm

  fd = mtdll_arm.MT_Open(None);
  if fd < 0:
      print("Faild to open i2c port");
      sys.exit()

  irqState = ctypes.c_int();
  ret = mtdll_arm.MT_GetIRQState(fd, irqState);
  if ret != 0:
      print("MT_GetIRQState error");
  else:
      print('{:02x}'.format(irqState.value));

  mtdll_arm.MT_Close(fd);
  



Function List