历史上的今天
今天是:2025年02月04日(星期二)
2021年02月04日 | stm32f10x_gpio.h源文件供自己参考
2021-02-04 来源:eefocus
/**
@file stm32f10x_gpio.h
@author MCD Application Team
@version V3.5.0
@date 11-March-2011
@brief This file contains all the functions prototypes for the GPIO
firmware library.
1
@attention
THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
© COPYRIGHT 2011 STMicroelectronics
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F10x_GPIO_H
#define __STM32F10x_GPIO_H
#ifdef __cplusplus
extern “C” {
#endif
/* Includes ------------------------------------------------------------------*/
#include “stm32f10x.h”
/** @addtogroup STM32F10x_StdPeriph_Driver
@{
*/
/** @addtogroup GPIO
@{
*/
/** @defgroup GPIO_Exported_Types
@{
*/
#define IS_GPIO_ALL_PERIPH(PERIPH) (((PERIPH) == GPIOA) ||
((PERIPH) == GPIOB) ||
((PERIPH) == GPIOC) ||
((PERIPH) == GPIOD) ||
((PERIPH) == GPIOE) ||
((PERIPH) == GPIOF) ||
((PERIPH) == GPIOG))
/**
@brief Output Maximum frequency selection
*/
typedef enum
{
GPIO_Speed_10MHz = 1,
GPIO_Speed_2MHz,
GPIO_Speed_50MHz
}GPIOSpeed_TypeDef;
#define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_Speed_10MHz) || ((SPEED) == GPIO_Speed_2MHz) ||
((SPEED) == GPIO_Speed_50MHz))
/**
@brief Configuration Mode enumeration
*/
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;
#define IS_GPIO_MODE(MODE) (((MODE) == GPIO_Mode_AIN) || ((MODE) == GPIO_Mode_IN_FLOATING) ||
((MODE) == GPIO_Mode_IPD) || ((MODE) == GPIO_Mode_IPU) ||
((MODE) == GPIO_Mode_Out_OD) || ((MODE) == GPIO_Mode_Out_PP) ||
((MODE) == GPIO_Mode_AF_OD) || ((MODE) == GPIO_Mode_AF_PP))
/**
@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;
/**
@brief Bit_SET and Bit_RESET enumeration
*/
typedef enum
{ Bit_RESET = 0,
Bit_SET
}BitAction;
#define IS_GPIO_BIT_ACTION(ACTION) (((ACTION) == Bit_RESET) || ((ACTION) == Bit_SET))
/**
@}
*/
/** @defgroup GPIO_Exported_Constants
@{
*/
/** @defgroup GPIO_pins_define
@{
*/
#define GPIO_Pin_0 ((uint16_t)0x0001) /*!< Pin 0 selected /
#define GPIO_Pin_1 ((uint16_t)0x0002) /!< Pin 1 selected /
#define GPIO_Pin_2 ((uint16_t)0x0004) /!< Pin 2 selected /
#define GPIO_Pin_3 ((uint16_t)0x0008) /!< Pin 3 selected /
#define GPIO_Pin_4 ((uint16_t)0x0010) /!< Pin 4 selected /
#define GPIO_Pin_5 ((uint16_t)0x0020) /!< Pin 5 selected /
#define GPIO_Pin_6 ((uint16_t)0x0040) /!< Pin 6 selected /
#define GPIO_Pin_7 ((uint16_t)0x0080) /!< Pin 7 selected /
#define GPIO_Pin_8 ((uint16_t)0x0100) /!< Pin 8 selected /
#define GPIO_Pin_9 ((uint16_t)0x0200) /!< Pin 9 selected /
#define GPIO_Pin_10 ((uint16_t)0x0400) /!< Pin 10 selected /
#define GPIO_Pin_11 ((uint16_t)0x0800) /!< Pin 11 selected /
#define GPIO_Pin_12 ((uint16_t)0x1000) /!< Pin 12 selected /
#define GPIO_Pin_13 ((uint16_t)0x2000) /!< Pin 13 selected /
#define GPIO_Pin_14 ((uint16_t)0x4000) /!< Pin 14 selected /
#define GPIO_Pin_15 ((uint16_t)0x8000) /!< Pin 15 selected /
#define GPIO_Pin_All ((uint16_t)0xFFFF) /!< All pins selected */
#define IS_GPIO_PIN(PIN) ((((PIN) & (uint16_t)0x00) == 0x00) && ((PIN) != (uint16_t)0x00))
#define IS_GET_GPIO_PIN(PIN) (((PIN) == GPIO_Pin_0) ||
((PIN) == GPIO_Pin_1) ||
((PIN) == GPIO_Pin_2) ||
((PIN) == GPIO_Pin_3) ||
((PIN) == GPIO_Pin_4) ||
((PIN) == GPIO_Pin_5) ||
((PIN) == GPIO_Pin_6) ||
((PIN) == GPIO_Pin_7) ||
((PIN) == GPIO_Pin_8) ||
((PIN) == GPIO_Pin_9) ||
((PIN) == GPIO_Pin_10) ||
((PIN) == GPIO_Pin_11) ||
((PIN) == GPIO_Pin_12) ||
((PIN) == GPIO_Pin_13) ||
((PIN) == GPIO_Pin_14) ||
((PIN) == GPIO_Pin_15))
/**
@}
*/
/** @defgroup GPIO_Remap_define
@{
*/
#define GPIO_Remap_SPI1 ((uint32_t)0x00000001) /*!< SPI1 Alternate Function mapping /
#define GPIO_Remap_I2C1 ((uint32_t)0x00000002) /!< I2C1 Alternate Function mapping /
#define GPIO_Remap_USART1 ((uint32_t)0x00000004) /!< USART1 Alternate Function mapping /
#define GPIO_Remap_USART2 ((uint32_t)0x00000008) /!< USART2 Alternate Function mapping /
#define GPIO_PartialRemap_USART3 ((uint32_t)0x00140010) /!< USART3 Partial Alternate Function mapping /
#define GPIO_FullRemap_USART3 ((uint32_t)0x00140030) /!< USART3 Full Alternate Function mapping /
#define GPIO_PartialRemap_TIM1 ((uint32_t)0x00160040) /!< TIM1 Partial Alternate Function mapping /
#define GPIO_FullRemap_TIM1 ((uint32_t)0x001600C0) /!< TIM1 Full Alternate Function mapping /
#define GPIO_PartialRemap1_TIM2 ((uint32_t)0x00180100) /!< TIM2 Partial1 Alternate Function mapping /
#define GPIO_PartialRemap2_TIM2 ((uint32_t)0x00180200) /!< TIM2 Partial2 Alternate Function mapping /
#define GPIO_FullRemap_TIM2 ((uint32_t)0x00180300) /!< TIM2 Full Alternate Function mapping /
#define GPIO_PartialRemap_TIM3 ((uint32_t)0x001A0800) /!< TIM3 Partial Alternate Function mapping /
#define GPIO_FullRemap_TIM3 ((uint32_t)0x001A0C00) /!< TIM3 Full Alternate Function mapping /
#define GPIO_Remap_TIM4 ((uint32_t)0x00001000) /!< TIM4 Alternate Function mapping /
#define GPIO_Remap1_CAN1 ((uint32_t)0x001D4000) /!< CAN1 Alternate Function mapping /
#define GPIO_Remap2_CAN1 ((uint32_t)0x001D6000) /!< CAN1 Alternate Function mapping /
#define GPIO_Remap_PD01 ((uint32_t)0x00008000) /!< PD01 Alternate Function mapping /
#define GPIO_Remap_TIM5CH4_LSI ((uint32_t)0x00200001) /!< LSI connected to TIM5 Channel4 input capture for calibration /
#define GPIO_Remap_ADC1_ETRGINJ ((uint32_t)0x00200002) /!< ADC1 External Trigger Injected Conversion remapping /
#define GPIO_Remap_ADC1_ETRGREG ((uint32_t)0x00200004) /!< ADC1 External Trigger Regular Conversion remapping /
#define GPIO_Remap_ADC2_ETRGINJ ((uint32_t)0x00200008) /!< ADC2 External Trigger Injected Conversion remapping /
#define GPIO_Remap_ADC2_ETRGREG ((uint32_t)0x00200010) /!< ADC2 External Trigger Regular Conversion remapping /
#define GPIO_Remap_ETH ((uint32_t)0x00200020) /!< Ethernet remapping (only for Connectivity line devices) /
#define GPIO_Remap_CAN2 ((uint32_t)0x00200040) /!< CAN2 remapping (only for Connectivity line devices) /
#define GPIO_Remap_SWJ_NoJTRST ((uint32_t)0x00300100) /!< Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST /
#define GPIO_Remap_SWJ_JTAGDisable ((uint32_t)0x00300200) /!< JTAG-DP Disabled and SW-DP Enabled /
#define GPIO_Remap_SWJ_Disable ((uint32_t)0x00300400) /!< Full SWJ Disabled (JTAG-DP + SW-DP) /
#define GPIO_Remap_SPI3 ((uint32_t)0x00201100) /!< SPI3/I2S3 Alternate Function mapping (only for Connectivity line devices) /
#define GPIO_Remap_TIM2ITR1_PTP_SOF ((uint32_t)0x00202000) /!< Ethernet PTP output or USB OTG SOF (Start of Frame) connected
to TIM2 Internal Trigger 1 for calibration
(only for Connectivity line devices) /
#define GPIO_Remap_PTP_PPS ((uint32_t)0x00204000) /!< Ethernet MAC PPS_PTS output on PB05 (only for Connectivity line devices) */
#define GPIO_Remap_TIM15 ((uint32_t)0x80000001) /*!< TIM15 Alternate Function mapping (only for Value line devices) /
#define GPIO_Remap_TIM16 ((uint32_t)0x80000002) /!< TIM16 Alternate Function mapping (only for Value line devices) /
#define GPIO_Remap_TIM17 ((uint32_t)0x80000004) /!< TIM17 Alternate Function mapping (only for Value line devices) /
#define GPIO_Remap_CEC ((uint32_t)0x80000008) /!< CEC Alternate Function mapping (only for Value line devices) /
#define GPIO_Remap_TIM1_DMA ((uint32_t)0x80000010) /!< TIM1 DMA requests mapping (only for Value line devices) */
#define GPIO_Remap_TIM9 ((uint32_t)0x80000020) /*!< TIM9 Alternate Function mapping (only for XL-density devices) /
#define GPIO_Remap_TIM10 ((uint32_t)0x80000040) /!< TIM10 Alternate Function mapping (only for XL-density devices) /
#define GPIO_Remap_TIM11 ((uint32_t)0x80000080) /!< TIM11 Alternate Function mapping (only for XL-density devices) /
#define GPIO_Remap_TIM13 ((uint32_t)0x80000100) /!< TIM13 Alternate Function mapping (only for High density Value line and XL-density devices) /
#define GPIO_Remap_TIM14 ((uint32_t)0x80000200) /!< TIM14 Alternate Function mapping (only for High density Value line and XL-density devices) /
#define GPIO_Remap_FSMC_NADV ((uint32_t)0x80000400) /!< FSMC_NADV Alternate Function mapping (only for High density Value line and XL-density devices) */
#define GPIO_Remap_TIM67_DAC_DMA ((uint32_t)0x80000800) /*!< TIM6/TIM7 and DAC DMA requests remapping (only for High density Value line devices) /
#define GPIO_Remap_TIM12 ((uint32_t)0x80001000) /!< TIM12 Alternate Function mapping (only for High density Value line devices) /
#define GPIO_Remap_MISC ((uint32_t)0x80002000) /!< Miscellaneous Remap (DMA2 Channel5 Position and DAC Trigger remapping,
only for High density Value line devices) */
#define IS_GPIO_REMAP(REMAP) (((REMAP) == GPIO_Remap_SPI1) || ((REMAP) == GPIO_Remap_I2C1) ||
((REMAP) == GPIO_Remap_USART1) || ((REMAP) == GPIO_Remap_USART2) ||
((REMAP) == GPIO_PartialRemap_USART3) || ((REMAP) == GPIO_FullRemap_USART3) ||
((REMAP) == GPIO_PartialRemap_TIM1) || ((REMAP) == GPIO_FullRemap_TIM1) ||
((REMAP) == GPIO_PartialRemap1_TIM2) || ((REMAP) == GPIO_PartialRemap2_TIM2) ||
((REMAP) == GPIO_FullRemap_TIM2) || ((REMAP) == GPIO_PartialRemap_TIM3) ||
((REMAP) == GPIO_FullRemap_TIM3) || ((REMAP) == GPIO_Remap_TIM4) ||
((REMAP) == GPIO_Remap1_CAN1) || ((REMAP) == GPIO_Remap2_CAN1) ||
((REMAP) == GPIO_Remap_PD01) || ((REMAP) == GPIO_Remap_TIM5CH4_LSI) ||
((REMAP) == GPIO_Remap_ADC1_ETRGINJ) ||((REMAP) == GPIO_Remap_ADC1_ETRGREG) ||
((REMAP) == GPIO_Remap_ADC2_ETRGINJ) ||((REMAP) == GPIO_Remap_ADC2_ETRGREG) ||
((REMAP) == GPIO_Remap_ETH) ||((REMAP) == GPIO_Remap_CAN2) ||
((REMAP) == GPIO_Remap_SWJ_NoJTRST) || ((REMAP) == GPIO_Remap_SWJ_JTAGDisable) ||
((REMAP) == GPIO_Remap_SWJ_Disable)|| ((REMAP) == GPIO_Remap_SPI3) ||
((REMAP) == GPIO_Remap_TIM2ITR1_PTP_SOF) || ((REMAP) == GPIO_Remap_PTP_PPS) ||
((REMAP) == GPIO_Remap_TIM15) || ((REMAP) == GPIO_Remap_TIM16) ||
((REMAP) == GPIO_Remap_TIM17) || ((REMAP) == GPIO_Remap_CEC) ||
((REMAP) == GPIO_Remap_TIM1_DMA) || ((REMAP) == GPIO_Remap_TIM9) ||
((REMAP) == GPIO_Remap_TIM10) || ((REMAP) == GPIO_Remap_TIM11) ||
((REMAP) == GPIO_Remap_TIM13) || ((REMAP) == GPIO_Remap_TIM14) ||
((REMAP) == GPIO_Remap_FSMC_NADV) || ((REMAP) == GPIO_Remap_TIM67_DAC_DMA) ||
((REMAP) == GPIO_Remap_TIM12) || ((REMAP) == GPIO_Remap_MISC))
下一篇:STM32F429——GPIO
史海拾趣
|
我们现有关于PADS /Altium Designer 电路设计的图书选题,诚找有写书意向的作者合作。要求作者有一些实战经验和写作资源,有一定的业余时间、能够保证写作进度。有意者请直接发信 联系方式:haohong99@163.com、478057587(QQ)。欢迎有实践开发 ...… 查看全部问答> |
|
我使用tps54550电源芯片产生 3.3V电压。芯片PH端输出的波形正确,可是经过滤波后,输出电压很低只有0.005V。我按照datasheet使用6.8uH和100uF电容做滤波。各位大侠帮帮忙吧...… 查看全部问答> |
|
我今天怎么回复不了我自己的帖子,我的问题解决了本来想说明下情况,是如何解决的,然后结贴,结果我一回复就说我\"回复太快!如果你是恶意刷楼,将会受到严厉惩罚!\"我没有刷楼啊,到了下午再试试还是不行,这个怎么回事,网站有问题了?也不知道我这个 ...… 查看全部问答> |
|
公司提供4.3-10.4寸系列真彩液晶终端,单片机,PLC,ARM串口直接控制,采用M600通用液晶显示驱动。 TFT驱动模组M600,这款模块的优势非常大,驱动模组提供的是RS232串口方式,通过协议来控制屏的显示,内置128M flash ...… 查看全部问答> |
|
Wince启动后,色彩不对,偏色严重。但是在用Windows Media Player播放视频文件的时候,画面清晰的很。不过WMP的界面仍然偏色。请教各位可遇到这种情况,是哪方面原因造成的。… 查看全部问答> |
|
本帖最后由 dontium 于 2015-1-23 13:32 编辑 同事花了半个月,就做了一款开关电源,还说技术保密。说实话做开关电源有技术难度吗? … 查看全部问答> |
|
最近弄了一个串口通信,使用的是M16单片机,但是死活设置熔断丝,却只能使用M16内部的1M时钟,才能串口通信正常(波特率寄存器设置没错)。设置外部时钟和内部的2M,4M,8M,都不能使串口通信正常,不知道怎么回事。下面是我设置内部8M的熔断丝的图片 ...… 查看全部问答> |




