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;
STM32 GPIO口模式配置的更多相关文章
- STM32 GPIO口的配置和应用
STM32F103ZET6 一共有7组IO口(有FT的标识是可以识别5v的) 每组IO口有16个IO 一共16*7=112个IO 4种输入模式: (1) GPIO_Mode_AIN 模拟输入 (2) ...
- stm32寄存器版学习笔记01 GPIO口的配置(LED、按键)
STM32的I/O口可以由软件配置成如下8种模式:输入浮空.输入上拉.输入下拉.模拟输入.开漏输出.推挽输出.推挽式复用功能及开漏复用功能.每个I/O口由7个寄存器来控制:配置模式的端口配置寄存器CR ...
- STM32——GPIO口的八种工作模式
GPIO的输入工作模式1——输入浮空模式: GPIO_Mode_IN_FLOATING =0x04 工作原理:配置完相应寄存器为此工作模式后,高低电平信号通过1处的IO口输入进去,由于寄存器配置了的缘 ...
- stm8 I/O口模式配置
复位后的默认配置 :复位之后,所有的引脚都是悬浮输入模式. However, a few pins may have a different behavior. Refer to the datash ...
- (十)stm32 GPIO口复用,重映射 RCC_APB2Periph_AFIO
什么时候需要用到RCC_APB2Periph_AFIO--复用IO时钟的使用 需要用到外设的重映射功能时才需要使能AFIO的时钟 外部中断(EXTI)中与AFIO有关的寄存器是AFIO-EXTICR1 ...
- STM32f10xxx 之 GPIO口配置
背景 配置stm32f103使其完成PWM输出的过程中,在配置GPIO口的时候,按照习惯配置GPIO口的speed为50MHZ,突然就意识到,为什么大部分例程习惯配置为50MHZ,而不是其它值,即有了 ...
- STM32系列单片机IO口模式设置
STM32单片机的每组IO口都有4个32位配置寄存器用于配置GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR和GPIOx_PUPDR,2个32位数据寄存器用于配置输入和 ...
- Silicon C8051F340之GPIO口配置与使用
一.背景: 很久前用过C8051,现在有相关需求需要重新使用C8051,然后发现一年前开发的相关经验都忘得 基本上差不多了.连最基本的GPIO口配置还得重新来看手册,所以有此文,做个记录,以备下次快速 ...
- C6748的GPIO口配置使用
2018年1月17日更新: 这几天用了创龙的C6748的库,对于GPIO配置十分不爽,我移植了RK6748的库,用起来十分酸爽,把下面的文件加入到工程中,然后include头文件后就可以使用.非常好使 ...
随机推荐
- 理解JavaScript里this关键字
1.全局代码中的this:始终指向window 2.函数代码中的this: }; var bar = { x: , test: function () { alert(this === bar); a ...
- python3 使用openpyxl库读写excel(续)
官网:https://openpyxl.readthedocs.io/en/stable/
- 取消Eclipse SVN的自动链接方式
1. 选中指定的项目名(有文件夹样子的那个) 2. 右键,在在弹出菜单选择 Team 3. 然后再点击, Disconnect 即可.
- 【Python】得到当前日期时间
import time str=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) print(str)
- Java 之 Given final block not properly padded
获取Cipher对象的时候一定要写成 Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding"); 不要写成 Cipher ci ...
- GraphQL返回分页对象
private GraphQLOutputType testUserOutputType; private GraphQLOutputType pageType; private void initO ...
- JVM中类的卸载机制
类的生命周期 当Sample类被载入.连接和初始化后,它的生命周期就開始了. 当代表Sample类的Class对象不再被引用,即不可触及时,Class对象就会结束生命周期.Sample类在方法区内的数 ...
- git server
选择Git服务器部署策略 找了一圈,发现如下方法来架设Git服务器: Git Candy:http://github.com/Aimeast/GitCandy/ AE大神的作品, Git Candy© ...
- workflow中的‘非典型’自动触发器trigger_model
Openerp中workflow的设计机制 工作流程系统在OpenERP里是非常有用的机制,可以用于即时描述单据(模型)状态的演进过程.工作流实现了状态流转的可配置,通过迁移的 condition代替 ...
- 从官方的BZR源安装avant-window-navigator
资料来自: http://blog.163.com/azhai@126/blog/static/111056312008315842433/http://www.ibentu.org/2007/09/ ...