我使用ch347在模式1下设置中断时候带回调函数失败,不带回调函数成功。使用官方demo也是设置失败。读取中断状态也是失败。下面是代码
#include #include "Windows.h" #include "CH347DLL.H" mDeviceInforS DevInfor = { 0 }; VOID CALLBACK fun(PUCHAR iStatus) { }; int main() { std::cout << "Hello World!\n"; HANDLE ch=CH347OpenDevice(0); CH347GetDeviceInfor(0, &DevInfor); CH347GPIO_Set(0, (0x01<<6), 0x00, 0x00); //CH347SetIntRoutine(0, 6, 2, 0xff, 0x03, fun); if (CH347SetIntRoutine(0, 6, 02, 0x08, 0x03, fun)) { std::cout << "set int OK\n"; } else { std::cout << "set int Error\n"; } PUCHAR status=0; if (CH347ReadInter(0, status)) { std::cout << "read int ok\n"; } else { std::cout << "read int erro\n"; } CH347CloseDevice(0); }
热门产品 :
CH394: 以太网协议栈芯片