[stm32f407]GPIO配置方式

GPIO模式:

cpp 复制代码
    GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN;
    GPIO_InitStructure.GPIO_OType=GPIO_OType_PP;//是否需要
    GPIO_InitStructure.GPIO_Pin=GPIO_Pin_11;
    GPIO_InitStructure.GPIO_PuPd=GPIO_PuPd_UP;//上拉
    GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;

GPIO_Mode:

cpp 复制代码
typedef enum
{ 
  GPIO_Mode_IN   = 0x00, /*!< GPIO Input Mode */
  GPIO_Mode_OUT  = 0x01, /*!< GPIO Output Mode */
  GPIO_Mode_AF   = 0x02, /*!< GPIO Alternate function Mode */
  GPIO_Mode_AN   = 0x03  /*!< GPIO Analog Mode */
}GPIOMode_TypeDef;

GPIO_OType:

cpp 复制代码
typedef enum
{ 
  GPIO_OType_PP = 0x00,
  GPIO_OType_OD = 0x01
}GPIOOType_TypeDef;

GPIO_PuPd:

cpp 复制代码
typedef struct
{
  uint32_t GPIO_Pin;              /*!< Specifies the GPIO pins to be configured.
                                       This parameter can be any value of @ref GPIO_pins_define */

  GPIOMode_TypeDef GPIO_Mode;     /*!< Specifies the operating mode for the selected pins.
                                       This parameter can be a value of @ref GPIOMode_TypeDef */

  GPIOSpeed_TypeDef GPIO_Speed;   /*!< Specifies the speed for the selected pins.
                                       This parameter can be a value of @ref GPIOSpeed_TypeDef */

  GPIOOType_TypeDef GPIO_OType;   /*!< Specifies the operating output type for the selected pins.
                                       This parameter can be a value of @ref GPIOOType_TypeDef */

  GPIOPuPd_TypeDef GPIO_PuPd;     /*!< Specifies the operating Pull-up/Pull down for the selected pins.
                                       This parameter can be a value of @ref GPIOPuPd_TypeDef */
}GPIO_InitTypeDef;

待进一步解析

相关推荐
MaoXian_n26 分钟前
[IMX] 05.串口 - UART
汇编·arm开发·驱动开发·单片机·嵌入式硬件
Camellia03111 小时前
嵌入式学习--江协51单片机day8
嵌入式硬件·学习·51单片机
搬砖的小码农_Sky1 小时前
FPGA:高速接口JESD204B以及FPGA实现
嵌入式硬件·fpga开发·硬件架构·硬件工程
一只小灿灿2 小时前
基于 Keil 的 STM32 全模块开发
stm32·单片机·嵌入式硬件
樂禮2 小时前
嵌入式51单片机:C51
单片机·嵌入式硬件·51单片机
青牛科技-Allen3 小时前
TS01S:单通道差分灵敏度校准电容触摸传感器芯片
单片机·嵌入式硬件·物联网·pd快充·家电变频控制·工业电机驱动系统
平凡灵感码头3 小时前
AT 指令详解:基于 MCU 的通信控制实战指南AT 指令详解
单片机·嵌入式硬件
猪猪童鞋4 小时前
基于正点原子阿波罗F429开发板的LWIP应用(1)——网络ping通
单片机·嵌入式硬件
0xCC说逆向4 小时前
Windows逆向工程提升之二进制分析工具:HEX查看与对比技术
汇编·windows·单片机·嵌入式硬件·安全·pe结构·pe文件
长流小哥4 小时前
STM32实战指南:DHT11温湿度传感器驱动开发与避坑指南
stm32·单片机·嵌入式硬件·keil5