Guest User

Untitled

a guest
Jun 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "axgmb.h"
  4.  
  5. void callback(interrupt_handler pointer) {
  6. printf("*****[APP]%lx , %lxn", pointer.data, pointer.value);
  7. }
  8.  
  9. int main(void)
  10. {
  11. AXGMB_DIO_Open();
  12. AXGMB_DIO_interruptHandler(callback);
  13. sleep(1);
  14. AXGMB_DIO_Close();
  15. return ERR_Success;
  16. };
  17.  
  18. typedef struct interrupt_handler{
  19. unsigned long
  20. unsigned long
  21. unsigned long
  22. unsigned long
  23. }interrupt_handler;
  24.  
  25. mydll = windll.LoadLibrary("AGP2_API.dll")
  26.  
  27. @c.CFUNCTYPE(None, c.c_char_p)
  28. def callBackTest(a):
  29. print("Test call back "+str(a))
  30.  
  31. iRet=mydll.AXGMB_DIO_Open()
  32. mydll.AXGMB_DIO_interruptHandler(callBackTest)
  33. time.sleep(10)
  34. mydll.AXGMB_DIO_Close()
  35.  
  36. class testStruct(Structure):
  37. _fields_ = [('val1', c_longdouble),
  38. ('val2', c_longdouble),
  39. ('val3', c_longdouble),
  40. ('val4', c_longdouble)]
Add Comment
Please, Sign In to add comment