我使用ch347在模式1下設置中斷時候帶回調函數(shù)失敗,不帶回調函數(shù)成功。使用官方demo也是設置失敗。讀取中斷狀態(tài)也是失敗。下面是代碼
#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); }
熱門產(chǎn)品 :
CH339: 7端口多功能USB HUB控制器芯片