win7 多点触摸USB的触摸屏

 

复制代码
USB.C
读取bCommon判断执行哪个动作
   if (bCommon & rbRSUINT)//0x02          // Handle Resume interrupt
   {
       Usb_Resume();
   }
   if (bCommon & rbRSTINT)          // Handle Reset interrupt
   {
       Usb_Reset();
   }
   if (bCommon & rbSUSINT)          // Handle Suspend interrupt
   {
       Usb_Suspend();
   }
   if (bIn & rbEP0)                 // Handle Setup packet received
   {                                // or packet transmitted if Endpoint 0
       Handle_Setup();               // is transmit mode
   }
   if (bIn & rbIN1)                 // Handle In Packet sent, put new data
   {                                // on endpoint 1 fifo
       Handle_In1();
   }
   if (bOut & rbOUT2)               // Handle Out packet received, take data
   {                                // off endpoint 2 fifo
       Handle_Out2();
   }

void Handle_Setup(),标准请求和类请求
               switch ( Setup.bmRequestType & DRT_MASK )     // Device Request Type
               {
                    case DRT_STD:                                   // Standard device request
                         Standard_Device_Request();
                         break;
                    case DRT_CLASS:                                   // class specific request
                         Class_Request();
                         break;

                    case DRT_VENDOR:                              // vendor request
                         Vendor_Request();
                         break;

                    default:
                         break;
               }
void Class_Request( void )类请求实现Get_Report,Set_Report
{
     if ( Setup.wIndex.i == DSC_INTERFACE_HID )          // interface index must match to the HID IF
     {
          switch( Setup.bRequest )                         // dispatch according to the bRequest
          {
               case HID_REQ_GET_REPORT:          Get_Report();          break;
               case HID_REQ_SET_REPORT:          Set_Report();          break;
复制代码

 

posted @   一名IT老农  阅读(1065)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
点击右上角即可分享
微信分享提示