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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 4060|回復: 0
打印 上一主題 下一主題
收起左側

要學好C語言你還得看STM32提供的庫

[復制鏈接]
跳轉到指定樓層
樓主
ID:128229 發表于 2016-6-29 01:25 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
這倆typedef struct徹底顛覆了我對C語言知識。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;
應用分析:struct是一個結構體,可以用來構造數據類型。所以可以得知這兩個struct里面的數據不是函數,而是函數指針,即它是一個指針,指向一個函數。RESULT,uint8_t*,void是函數的返回值類型。


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 国产激情视频在线观看 | 男女视频在线免费观看 | 国产精品成人国产乱一区 | 成人国产精品 | 亚洲欧美激情精品一区二区 | 国产精品自产拍在线观看蜜 | 视频一区在线 | 国产成人一区二区三区久久久 | 亚洲精品一区二区 | 免费久久久 | 亚洲欧美成人 | www97影院| 国产一区二区三区亚洲 | 精品欧美乱码久久久久久 | 337p日韩| 久久久久国 | 999久久久| 精品欧美一区二区三区 | 国产东北一级毛片 | 色频| 亚洲第一av | 久久国产精品免费视频 | 久久综合久久久 | 99精品久久久 | 国产高清亚洲 | 在线视频一区二区三区 | 在线看中文字幕 | 成人一级视频在线观看 | 国产高清在线 | 亚洲天堂一区 | 欧美高清视频一区 | www.亚洲精品 | www.日韩| 亚洲一在线 | 久久精品一二三影院 | 国产精品久久精品 | 日日夜夜精品免费视频 | 日韩中文在线 | 亚洲人成人一区二区在线观看 | 久久中文免费视频 | 精品国产乱码久久久久久1区2区 |