📄 stm32f10x_gpio.h
字号:
#ifndef __STM32F10x_GPIO_H__
#define __STM32F10x_GPIO_H__
//-----------------------------------------------------------------------------
//GPIOA
//-----------------------------------------------------------------------------
#define GPIOA_CRL (*((volatile unsigned long*)0x40010800))
#define GPIOA_CRH (*((volatile unsigned long*)0x40010804))
#define GPIOA_IDR (*((volatile unsigned long*)0x40010808))
#define GPIOA_ODR (*((volatile unsigned long*)0x4001080c))
#define GPIOA_BSRR (*((volatile unsigned long*)0x40010810))
#define GPIOA_BRR (*((volatile unsigned long*)0x40010814))
#define GPIOA_LCKR (*((volatile unsigned long*)0x40010818))
//-----------------------------------------------------------------------------
#define GPIOA_CRL_BITS ((volatile unsigned long*)(0x42000000+(0x00010800<<5)))
#define GPIOA_CRH_BITS ((volatile unsigned long*)(0x42000000+(0x00010804<<5)))
#define GPIOA_IDR_BITS ((volatile unsigned long*)(0x42000000+(0x00010808<<5)))
#define GPIOA_ODR_BITS ((volatile unsigned long*)(0x42000000+(0x0001080C<<5)))
#define GPIOA_BSRR_BITS ((volatile unsigned long*)(0x42000000+(0x00010810<<5)))
#define GPIOA_BRR_BITS ((volatile unsigned long*)(0x42000000+(0x00010814<<5)))
#define GPIOA_LCKR_BITS ((volatile unsigned long*)(0x42000000+(0x00010818<<5)))
//-----------------------------------------------------------------------------
//GPIOB
//-----------------------------------------------------------------------------
#define GPIOB_CRL (*((volatile unsigned long*)0x40010C00))
#define GPIOB_CRH (*((volatile unsigned long*)0x40010C04))
#define GPIOB_IDR (*((volatile unsigned long*)0x40010C08))
#define GPIOB_ODR (*((volatile unsigned long*)0x40010C0C))
#define GPIOB_BSRR (*((volatile unsigned long*)0x40010C10))
#define GPIOB_BRR (*((volatile unsigned long*)0x40010C14))
#define GPIOB_LCKR (*((volatile unsigned long*)0x40010C18))
//-----------------------------------------------------------------------------
#define GPIOB_CRL_BITS ((volatile unsigned long*)(0x42000000+(0x00010C00<<5)))
#define GPIOB_CRH_BITS ((volatile unsigned long*)(0x42000000+(0x00010C04<<5)))
#define GPIOB_IDR_BITS ((volatile unsigned long*)(0x42000000+(0x00010C08<<5)))
#define GPIOB_ODR_BITS ((volatile unsigned long*)(0x42000000+(0x00010C0C<<5)))
#define GPIOB_BSRR_BITS ((volatile unsigned long*)(0x42000000+(0x00010C10<<5)))
#define GPIOB_BRR_BITS ((volatile unsigned long*)(0x42000000+(0x00010C14<<5)))
#define GPIOB_LCKR_BITS ((volatile unsigned long*)(0x42000000+(0x00010C18<<5)))
//-----------------------------------------------------------------------------
//GPIOC
//-----------------------------------------------------------------------------
#define GPIOC_CRL (*((volatile unsigned long*)0x40011000))
#define GPIOC_CRH (*((volatile unsigned long*)0x40011004))
#define GPIOC_IDR (*((volatile unsigned long*)0x40011008))
#define GPIOC_ODR (*((volatile unsigned long*)0x4001100C))
#define GPIOC_BSRR (*((volatile unsigned long*)0x40011010))
#define GPIOC_BRR (*((volatile unsigned long*)0x40011014))
#define GPIOC_LCKR (*((volatile unsigned long*)0x40011018))
//-----------------------------------------------------------------------------
#define GPIOC_CRL_BITS ((volatile unsigned long*)(0x42000000+(0x00011000<<5)))
#define GPIOC_CRH_BITS ((volatile unsigned long*)(0x42000000+(0x00011004<<5)))
#define GPIOC_IDR_BITS ((volatile unsigned long*)(0x42000000+(0x00011008<<5)))
#define GPIOC_ODR_BITS ((volatile unsigned long*)(0x42000000+(0x0001100C<<5)))
#define GPIOC_BSRR_BITS ((volatile unsigned long*)(0x42000000+(0x00011010<<5)))
#define GPIOC_BRR_BITS ((volatile unsigned long*)(0x42000000+(0x00011014<<5)))
#define GPIOC_LCKR_BITS ((volatile unsigned long*)(0x42000000+(0x00011018<<5)))
//-----------------------------------------------------------------------------
//GPIOD
//-----------------------------------------------------------------------------
#define GPIOD_CRL (*((volatile unsigned long*)0x40011400))
#define GPIOD_CRH (*((volatile unsigned long*)0x40011404))
#define GPIOD_IDR (*((volatile unsigned long*)0x40011408))
#define GPIOD_ODR (*((volatile unsigned long*)0x4001140C))
#define GPIOD_BSRR (*((volatile unsigned long*)0x40011410))
#define GPIOD_BRR (*((volatile unsigned long*)0x40011414))
#define GPIOD_LCKR (*((volatile unsigned long*)0x40011418))
//-----------------------------------------------------------------------------
#define GPIOD_CRL_BITS ((volatile unsigned long*)(0x42000000+(0x00011400<<5)))
#define GPIOD_CRH_BITS ((volatile unsigned long*)(0x42000000+(0x00011404<<5)))
#define GPIOD_IDR_BITS ((volatile unsigned long*)(0x42000000+(0x00011408<<5)))
#define GPIOD_ODR_BITS ((volatile unsigned long*)(0x42000000+(0x0001140C<<5)))
#define GPIOD_BSRR_BITS ((volatile unsigned long*)(0x42000000+(0x00011410<<5)))
#define GPIOD_BRR_BITS ((volatile unsigned long*)(0x42000000+(0x00011414<<5)))
#define GPIOD_LCKR_BITS ((volatile unsigned long*)(0x42000000+(0x00011418<<5)))
//-----------------------------------------------------------------------------
//GPIOE
//-----------------------------------------------------------------------------
#define GPIOE_CRL (*((volatile unsigned long*)0x40011800))
#define GPIOE_CRH (*((volatile unsigned long*)0x40011804))
#define GPIOE_IDR (*((volatile unsigned long*)0x40011808))
#define GPIOE_ODR (*((volatile unsigned long*)0x4001180C))
#define GPIOE_BSRR (*((volatile unsigned long*)0x40011810))
#define GPIOE_BRR (*((volatile unsigned long*)0x40011814))
#define GPIOE_LCKR (*((volatile unsigned long*)0x40011818))
//-----------------------------------------------------------------------------
#define GPIOE_CRL_BITS ((volatile unsigned long*)(0x42000000+(0x00011800<<5)))
#define GPIOE_CRH_BITS ((volatile unsigned long*)(0x42000000+(0x00011804<<5)))
#define GPIOE_IDR_BITS ((volatile unsigned long*)(0x42000000+(0x00011808<<5)))
#define GPIOE_ODR_BITS ((volatile unsigned long*)(0x42000000+(0x0001180C<<5)))
#define GPIOE_BSRR_BITS ((volatile unsigned long*)(0x42000000+(0x00011810<<5)))
#define GPIOE_BRR_BITS ((volatile unsigned long*)(0x42000000+(0x00011814<<5)))
#define GPIOE_LCKR_BITS ((volatile unsigned long*)(0x42000000+(0x00011818<<5)))
//-----------------------------------------------------------------------------
//CRH
//-----------------------------------------------------------------------------
#define CNF15_1 31
#define CNF15_0 30
#define MODE15_1 29
#define MODE15_0 28
#define CNF14_1 27
#define CNF14_0 26
#define MODE14_1 25
#define MODE14_0 24
#define CNF13_1 23
#define CNF13_0 22
#define MODE13_1 21
#define MODE13_0 20
#define CNF12_1 19
#define CNF12_0 18
#define MODE12_1 17
#define MODE12_0 16
#define CNF11_1 15
#define CNF11_0 14
#define MODE11_1 13
#define MODE11_0 12
#define CNF10_1 11
#define CNF10_0 10
#define MODE10_1 9
#define MODE10_0 8
#define CNF9_1 7
#define CNF9_0 6
#define MODE9_1 5
#define MODE9_0 4
#define CNF8_1 3
#define CNF8_0 2
#define MODE8_1 1
#define MODE8_0 0
//-----------------------------------------------------------------------------
//CRL
//-----------------------------------------------------------------------------
#define CNF7_1 31
#define CNF7_0 30
#define MODE7_1 29
#define MODE7_0 28
#define CNF6_1 27
#define CNF6_0 26
#define MODE6_1 25
#define MODE6_0 24
#define CNF5_1 23
#define CNF5_0 22
#define MODE5_1 21
#define MODE5_0 20
#define CNF4_1 19
#define CNF4_0 18
#define MODE4_1 17
#define MODE4_0 16
#define CNF3_1 15
#define CNF3_0 14
#define MODE3_1 13
#define MODE3_0 12
#define CNF2_1 11
#define CNF2_0 10
#define MODE2_1 9
#define MODE2_0 8
#define CNF1_1 7
#define CNF1_0 6
#define MODE1_1 5
#define MODE1_0 4
#define CNF0_1 3
#define CNF0_0 2
#define MODE0_1 1
#define MODE0_0 0
//-----------------------------------------------------------------------------
//BRR
//-----------------------------------------------------------------------------
#define BR15 31
#define BR14 30
#define BR13 29
#define BR12 28
#define BR11 27
#define BR10 26
#define BR9 25
#define BR8 24
#define BR7 23
#define BR6 22
#define BR5 21
#define BR4 20
#define BR3 19
#define BR2 18
#define BR1 17
#define BR0 16
//-----------------------------------------------------------------------------
//BSRR
//-----------------------------------------------------------------------------
#define BS15 15
#define BS14 14
#define BS13 13
#define BS12 12
#define BS11 11
#define BS10 10
#define BS9 9
#define BS8 8
#define BS7 7
#define BS6 6
#define BS5 5
#define BS4 4
#define BS3 3
#define BS2 2
#define BS1 1
#define BS0 0
//-----------------------------------------------------------------------------
#define ODR15 15
#define ODR14 14
#define ODR13 13
#define ODR12 12
#define ODR11 11
#define ODR10 10
#define ODR9 9
#define ODR8 8
#define ODR7 7
#define ODR6 6
#define ODR5 5
#define ODR4 4
#define ODR3 3
#define ODR2 2
#define ODR1 1
#define ODR0 0
//-----------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -