zoukankan      html  css  js  c++  java
  • STM32 GPIO口模式配置

    F103系列

    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;

    F407系列

    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;
    

      

    GPIO模式类型

    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 输出类型

    typedef enum
    { 
      GPIO_OType_PP = 0x00,
      GPIO_OType_OD = 0x01
    }GPIOOType_TypeDef;
    

      GPIO配置上拉,下拉

    typedef enum
    { 
      GPIO_PuPd_NOPULL = 0x00,
      GPIO_PuPd_UP     = 0x01,
      GPIO_PuPd_DOWN   = 0x02
    }GPIOPuPd_TypeDef;
    

      

  • 相关阅读:
    JAVA编程心得-JAVA实现CRC-CCITT(XMODEM)算法
    自学PHP 环境搭建
    Postfix+Amavisd-new+Spamassassin+ClamAV整合安装
    安装Apache Felix OSGI Framework小记
    C#多线程
    使用maven进行测试设置断点调试的方法
    2016第33周四
    Spring配置文件头及xsd文件版本
    2016第33周二
    web中的重定向与转发
  • 原文地址:https://www.cnblogs.com/prayer521/p/6639519.html
Copyright © 2011-2022 走看看