USB开发--DEVICE_INFO

2019-03-23 18:34发布

程序如下:

typedef struct _DEVICE_INFO

{

  uint8_t USBbmRequestType;       /* bmRequestType */

  uint8_t USBbRequest;            /* bRequest */

  uint16_t_uint8_t USBwValues;         /* wValue */

  uint16_t_uint8_t USBwIndexs;         /* wIndex */

  uint16_t_uint8_t USBwLengths;        /* wLength */



  uint8_t ControlState;           /* of type CONTROL_STATE */

  uint8_t Current_Feature;

  uint8_t Current_Configuration;   /* Selected configuration */

  uint8_t Current_Interface;       /* Selected interface of current configuration */

  uint8_t Current_AlternateSetting;/* Selected Alternate Setting of current

                                     interface*/



  ENDPOINT_INFO Ctrl_Info;

}DEVICE_INFO;






uint8_t In0_Process(void)

{

  uint32_t ControlState = pInformation->ControlState;//请问大神:这里的ControlState是什么意思?该如何理解结构体DEVICE_INFO???请大神指教~~~



  if ((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA))

  {

    DataStageIn();

    /* ControlState may be changed outside the function */

    ControlState = pInformation->ControlState;

  }



  else if (ControlState == WAIT_STATUS_IN)

  {

    if ((pInformation->USBbRequest == SET_ADDRESS) &&

        (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)))

    {

      SetDeviceAddress(pInformation->USBwValue0);

      pUser_Standard_Requests->User_SetDeviceAddress();

    }

    (*pProperty->Process_Status_IN)();

    ControlState = STALLED;

  }



  else

  {

    ControlState = STALLED;

  }



  pInformation->ControlState = ControlState;



  return Post0_Process();

}





此帖出自小平头技术问答
0条回答

一周热门 更多>