Pregunta

I am using python to develop GUI which will communicate with PIC24 board through USB. For that i am using mpusbapi dll file, provided by Microchip. How can i call function in python of mpusbapi dll ?

Here are the functions in mpusbapi.h file

DWORD (*MPUSBGetDLLVersion)(void);

DWORD (*MPUSBGetDeviceCount)(PCHAR pVID_PID);

HANDLE (*MPUSBOpen)(DWORD instance,         // Input
                 PCHAR pVID_PID,            // Input
                 PCHAR pEP,                 // Input
                 DWORD dwDir,               // Input
                 DWORD dwReserved);         // Input <Future Use>

DWORD (*MPUSBRead)(HANDLE handle,           // Input
                PVOID pData,                // Output
                DWORD dwLen,                // Input
                PDWORD pLength,             // Output
                DWORD dwMilliseconds);      // Input

DWORD (*MPUSBWrite)(HANDLE handle,          // Input
                 PVOID pData,               // Input
                 DWORD dwLen,               // Input
                 PDWORD pLength,            // Output
                 DWORD dwMilliseconds);     // Input

DWORD (*MPUSBReadInt)(HANDLE handle,        // Input
                   PVOID pData,             // Output
                   DWORD dwLen,             // Input
                   PDWORD pLength,          // Output
                   DWORD dwMilliseconds);   // Input

BOOL (*MPUSBClose)(HANDLE handle);
¿Fue útil?

Solución

Work your way through the ctypes tutorial and generate an interface by hand then you can load and run it as a shared library or use SWING to generate the interface and do the same.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top