Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include "axgmb.h"
- void callback(interrupt_handler pointer) {
- printf("*****[APP]%lx , %lxn", pointer.data, pointer.value);
- }
- int main(void)
- {
- AXGMB_DIO_Open();
- AXGMB_DIO_interruptHandler(callback);
- sleep(1);
- AXGMB_DIO_Close();
- return ERR_Success;
- };
- typedef struct interrupt_handler{
- unsigned long
- unsigned long
- unsigned long
- unsigned long
- }interrupt_handler;
- mydll = windll.LoadLibrary("AGP2_API.dll")
- @c.CFUNCTYPE(None, c.c_char_p)
- def callBackTest(a):
- print("Test call back "+str(a))
- iRet=mydll.AXGMB_DIO_Open()
- mydll.AXGMB_DIO_interruptHandler(callBackTest)
- time.sleep(10)
- mydll.AXGMB_DIO_Close()
- class testStruct(Structure):
- _fields_ = [('val1', c_longdouble),
- ('val2', c_longdouble),
- ('val3', c_longdouble),
- ('val4', c_longdouble)]
Add Comment
Please, Sign In to add comment