GPIO Init structure definition

来源:互联网 发布:php 截断上传 编辑:程序博客网 时间:2024/05/29 13:31

/**   * @brief  GPIO Init structure definition    */typedef struct{  uint16_t GPIO_Pin;             /*!< Specifies the GPIO pins to be configured.                                      This parameter can be any value of @ref GPIO_pins_define */  GPIOSpeed_TypeDef GPIO_Speed;  /*!< Specifies the speed for the selected pins.                                      This parameter can be a value of @ref GPIOSpeed_TypeDef */  GPIOMode_TypeDef GPIO_Mode;    /*!< Specifies the operating mode for the selected pins.                                      This parameter can be a value of @ref GPIOMode_TypeDef */}GPIO_InitTypeDef;


typedef enum{ GPIO_Mode_AIN = 0x0,//模拟输入  GPIO_Mode_IN_FLOATING = 0x04,//浮空输入  GPIO_Mode_IPD = 0x28,//下拉输入  GPIO_Mode_IPU = 0x48,//上拉输入  GPIO_Mode_Out_OD = 0x14,//开漏输出  GPIO_Mode_Out_PP = 0x10,//推挽输出  GPIO_Mode_AF_OD = 0x1C,//复用开漏输出  GPIO_Mode_AF_PP = 0x18//复用推挽输出}GPIOMode_TypeDef;

/** 
  * @brief  Output Maximum frequency selection  
  */


typedef enum

  GPIO_Speed_10MHz = 1,
  GPIO_Speed_2MHz, 
  GPIO_Speed_50MHz
}GPIOSpeed_TypeDef;

原创粉丝点击