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);
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);