#include "stdafx.h" #include <iostream> using namespace std; typedef unsigned char uint8_t; /* Following USB Device status */ typedef enum { USBD_OK = 0U, USBD_BUSY, USBD_FAIL, } USBD_StatusTypeDef; /* Following USB Device Speed */ typedef enum { USBD_SPEED_HIGH = 0, USBD_SPEED_FULL = 1, USBD_SPEED_LOW = 2, }USBD_SpeedTypeDef; /** * @brief PCD State structure definition */ typedef enum { HAL_PCD_STATE_RESET = 0x00, HAL_PCD_STATE_READY = 0x01, HAL_PCD_STATE_ERROR = 0x02, HAL_PCD_STATE_BUSY = 0x03, HAL_PCD_STATE_TIMEOUT = 0x04 } PCD_StateTypeDef; typedef enum { USB_DEVICE_MODE = 0 } USB_ModeTypeDef; #define USBD_VID 0x1155 #define USBD_PID_FS 0x0644 #define LOBYTE(x) ((uint8_t)((x) & 0x00FFU)) #define HIBYTE(x) ((uint8_t)(((x) & 0xFF00U) >> 8U)) int main() { USBD_SpeedTypeDef usbdok = USBD_SPEED_LOW; // LOBYTE(USBD_VID), // HIBYTE(USBD_VID), // LOBYTE(USBD_PID_FS), // HIBYTE(USBD_PID_FS), printf("%x\n",HIBYTE(USBD_VID)); printf("%x",LOBYTE(USBD_VID)); system("PAUSE"); return 0; }
标签:typedef,HAL,VID,vid,16,pid,STATE,USBD,PCD From: https://www.cnblogs.com/hshy/p/16846482.html