久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

標(biāo)題: 要學(xué)好C語(yǔ)言你還得看STM32提供的庫(kù) [打印本頁(yè)]

作者: 電子黑    時(shí)間: 2016-6-29 01:25
標(biāo)題: 要學(xué)好C語(yǔ)言你還得看STM32提供的庫(kù)
這倆typedef struct徹底顛覆了我對(duì)C語(yǔ)言知識(shí)。typedef struct _USER_STANDARD_REQUESTS
{
  void (*User_GetConfiguration)(void);       /* Get Configuration */
  void (*User_SetConfiguration)(void);       /* Set Configuration */
  void (*User_GetInterface)(void);           /* Get Interface */
  void (*User_SetInterface)(void);           /* Set Interface */
  void (*User_GetStatus)(void);              /* Get Status */
  void (*User_ClearFeature)(void);           /* Clear Feature */
  void (*User_SetEndPointFeature)(void);     /* Set Endpoint Feature */
  void (*User_SetDeviceFeature)(void);       /* Set Device Feature */
  void (*User_SetDeviceAddress)(void);       /* Set Device Address */
}
USER_STANDARD_REQUESTS;
typedef struct _DEVICE_PROP
{
  void (*Init)(void);        /* Initialize the device */
  void (*Reset)(void);       /* Reset routine of this device */
  /* Device dependent process after the status stage */
  void (*Process_Status_IN)(void);
  void (*Process_Status_OUT)(void);
  /* Procedure of process on setup stage of a class specified request with data stage */
  /* All class specified requests with data stage are processed in Class_Data_Setup
   Class_Data_Setup()
    responses to check all special requests and fills ENDPOINT_INFO
    according to the request
    If IN tokens are expected, then wLength & wOffset will be filled
    with the total transferring bytes and the starting position
    If OUT tokens are expected, then rLength & rOffset will be filled
    with the total expected bytes and the starting position in the buffer
    If the request is valid, Class_Data_Setup returns SUCCESS, else UNSUPPORT
   CAUTION:
    Since GET_CONFIGURATION & GET_INTERFACE are highly related to
    the individual classes, they will be checked and processed here.
  */
  RESULT (*Class_Data_Setup)(uint8_t RequestNo);
  /* Procedure of process on setup stage of a class specified request without data stage */
  /* All class specified requests without data stage are processed in Class_NoData_Setup
   Class_NoData_Setup
    responses to check all special requests and perform the request
   CAUTION:
    Since SET_CONFIGURATION & SET_INTERFACE are highly related to
    the individual classes, they will be checked and processed here.
  */
  RESULT (*Class_NoData_Setup)(uint8_t RequestNo);
  /*Class_Get_Interface_Setting
   This function is used by the file usb_core.c to test if the selected Interface
   and Alternate Setting (uint8_t Interface, uint8_t AlternateSetting) are supported by
   the application.
   This function is writing by user. It should return "SUCCESS" if the Interface
   and Alternate Setting are supported by the application or "UNSUPPORT" if they
   are not supported. */
  RESULT  (*Class_Get_Interface_Setting)(uint8_t Interface, uint8_t AlternateSetting);
  uint8_t* (*GetDeviceDescriptor)(uint16_t Length);
  uint8_t* (*GetConfigDescriptor)(uint16_t Length);
  uint8_t* (*GetStringDescriptor)(uint16_t Length);
  uint8_t* RxEP_buffer;
  uint8_t MaxPacketSize;
}DEVICE_PROP;
應(yīng)用分析:struct是一個(gè)結(jié)構(gòu)體,可以用來(lái)構(gòu)造數(shù)據(jù)類型。所以可以得知這兩個(gè)struct里面的數(shù)據(jù)不是函數(shù),而是函數(shù)指針,即它是一個(gè)指針,指向一個(gè)函數(shù)。RESULT,uint8_t*,void是函數(shù)的返回值類型。







歡迎光臨 (http://www.zg4o1577.cn/bbs/) Powered by Discuz! X3.1
主站蜘蛛池模板: 久久毛片| 精品一区二区三区在线观看 | 3p视频在线观看 | 日韩a在线 | 99精品免费久久久久久久久日本 | 久久aⅴ乱码一区二区三区 亚洲欧美综合精品另类天天更新 | 国产一二三区免费视频 | 国产在线一区二区 | 国产高清免费 | 久久午夜精品福利一区二区 | 亚洲国产精品久久人人爱 | 亚洲精品乱码久久久久久按摩观 | 91天堂网 | 欧美在线亚洲 | 99久久精品国产一区二区三区 | 一区二区三区四区在线视频 | 成人在线一区二区 | 亚洲第一在线 | 国产成人一区二 | 国产高清在线精品一区二区三区 | 日本午夜精品一区二区三区 | 久草在线中文888 | 一区二区三区四区国产 | 综合九九 | 亚洲视频二区 | 精品区 | 一区二区国产在线 | 中文字幕一区二区三区在线乱码 | 亚洲午夜视频在线观看 | 一区二区三区国产 | 91玖玖| 久色网| 在线看黄免费 | 日韩一区精品 | 欧美8一10sex性hd | 久久久一区二区三区四区 | 精品久久久久久亚洲综合网 | 国产精品久久久久久52avav | 欧美黄色大片在线观看 | 日韩在线视频播放 | 亚洲一区二区三区在线 |