stm32f10x_gpio.h源文件供自己参考

/**


  • @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.
    

  • @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))

/**

  • @}
    */

/** @defgroup GPIO_Port_Sources

  • @{
    */

#define GPIO_PortSourceGPIOA ((uint8_t)0x00)
#define GPIO_PortSourceGPIOB ((uint8_t)0x01)
#define GPIO_PortSourceGPIOC ((uint8_t)0x02)
#define GPIO_PortSourceGPIOD ((uint8_t)0x03)
#define GPIO_PortSourceGPIOE ((uint8_t)0x04)
#define GPIO_PortSourceGPIOF ((uint8_t)0x05)
#define GPIO_PortSourceGPIOG ((uint8_t)0x06)
#define IS_GPIO_EVENTOUT_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == GPIO_PortSourceGPIOA) ||
((PORTSOURCE) == GPIO_PortSourceGPIOB) ||
((PORTSOURCE) == GPIO_PortSourceGPIOC) ||
((PORTSOURCE) == GPIO_PortSourceGPIOD) ||
((PORTSOURCE) == GPIO_PortSourceGPIOE))

#define IS_GPIO_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == GPIO_PortSourceGPIOA) ||
((PORTSOURCE) == GPIO_PortSourceGPIOB) ||
((PORTSOURCE) == GPIO_PortSourceGPIOC) ||
((PORTSOURCE) == GPIO_PortSourceGPIOD) ||
((PORTSOURCE) == GPIO_PortSourceGPIOE) ||
((PORTSOURCE) == GPIO_PortSourceGPIOF) ||
((PORTSOURCE) == GPIO_PortSourceGPIOG))

/**

  • @}
    */

/** @defgroup GPIO_Pin_sources

  • @{
    */

#define GPIO_PinSource0 ((uint8_t)0x00)
#define GPIO_PinSource1 ((uint8_t)0x01)
#define GPIO_PinSource2 ((uint8_t)0x02)
#define GPIO_PinSource3 ((uint8_t)0x03)
#define GPIO_PinSource4 ((uint8_t)0x04)
#define GPIO_PinSource5 ((uint8_t)0x05)
#define GPIO_PinSource6 ((uint8_t)0x06)
#define GPIO_PinSource7 ((uint8_t)0x07)
#define GPIO_PinSource8 ((uint8_t)0x08)
#define GPIO_PinSource9 ((uint8_t)0x09)
#define GPIO_PinSource10 ((uint8_t)0x0A)
#define GPIO_PinSource11 ((uint8_t)0x0B)
#define GPIO_PinSource12 ((uint8_t)0x0C)
#define GPIO_PinSource13 ((uint8_t)0x0D)
#define GPIO_PinSource14 ((uint8_t)0x0E)
#define GPIO_PinSource15 ((uint8_t)0x0F)

#define IS_GPIO_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == GPIO_PinSource0) ||
((PINSOURCE) == GPIO_PinSource1) ||
((PINSOURCE) == GPIO_PinSource2) ||
((PINSOURCE) == GPIO_PinSource3) ||
((PINSOURCE) == GPIO_PinSource4) ||
((PINSOURCE) == GPIO_PinSource5) ||
((PINSOURCE) == GPIO_PinSource6) ||
((PINSOURCE) == GPIO_PinSource7) ||
((PINSOURCE) == GPIO_PinSource8) ||
((PINSOURCE) == GPIO_PinSource9) ||
((PINSOURCE) == GPIO_PinSource10) ||
((PINSOURCE) == GPIO_PinSource11) ||
((PINSOURCE) == GPIO_PinSource12) ||
((PINSOURCE) == GPIO_PinSource13) ||
((PINSOURCE) == GPIO_PinSource14) ||
((PINSOURCE) == GPIO_PinSource15))

/**

  • @}
    */

/** @defgroup Ethernet_Media_Interface

  • @{
    */
    #define GPIO_ETH_MediaInterface_MII ((u32)0x00000000)
    #define GPIO_ETH_MediaInterface_RMII ((u32)0x00000001)

#define IS_GPIO_ETH_MEDIA_INTERFACE(INTERFACE) (((INTERFACE) == GPIO_ETH_MediaInterface_MII) ||
((INTERFACE) == GPIO_ETH_MediaInterface_RMII))

/**

  • @}
    /
    /
    *
  • @}
    */

/** @defgroup GPIO_Exported_Macros

  • @{
    */

/**

  • @}
    */

/** @defgroup GPIO_Exported_Functions

  • @{
    */

void GPIO_DeInit(GPIO_TypeDef* GPIOx);
void GPIO_AFIODeInit(void);
void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct);
void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct);
uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx);
uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx);
void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal);
void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal);
void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
void GPIO_EventOutputConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource);
void GPIO_EventOutputCmd(FunctionalState NewState);
void GPIO_PinRemapConfig(uint32_t GPIO_Remap, FunctionalState NewState);
void GPIO_EXTILineConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource);
void GPIO_ETH_MediaInterfaceConfig(uint32_t GPIO_ETH_MediaInterface);

#ifdef __cplusplus
}
#endif

#endif /* __STM32F10x_GPIO_H /
/
*

  • @}
    */

/**

  • @}
    */

/**

  • @}
    */

/******************* © COPYRIGHT 2011 STMicroelectronics *END OF FILE/

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 这三个文件都与 STM32F10x 系列单片机的中断相关。 - stm32f10x_conf.h:该文件定义了 STM32F10x 系列单片机的中断优先级分组和中断向量表基地址等配置。需要根据具体的项目需求进行配置。 - stm32f10x_it.c:该文件是中断服务程序(Interrupt Service Routine,ISR)的源文件,其中包含了各个中断的具体处理函数。需要根据具体的中断类型在该文件中定义对应的 ISR。 - stm32f10x_it.h:该文件是中断服务程序的头文件,其中声明了各个 ISR 的函数原型。需要在 stm32f10x_it.c 文件中包含该头文件。 总之,这三个文件是 STM32F10x 系列单片机中断处理的关键文件,需要仔细配置和实现。 ### 回答2: stm32f10x_conf.h、stm32f10x_it.c和stm32f10x_it.h都是针对ST公司的STM32F10x系列微控制器的配置和中断处理的文件。 首先,stm32f10x_conf.h是一个配置文件,用于配置STM32F10x系列微控制器硬件资源的初始化设置。该文件中包含了各种宏定义和配置选项,以便用户可以根据需要进行硬件资源的配置。例如,该文件可以配置GPIO引脚的初始化设置、USART串口通信的波特率等。 其次,stm32f10x_it.c是一个中断处理文件,用于处理STM32F10x系列微控制器的中断事件。该文件中包含了各种中断服务函数(Interrupt Service Routine,简称ISR),当出现相应的中断事件时,相应的ISR将会被自动调用。用户可以根据自己的需求,在stm32f10x_it.c文件中编写相应的ISR,以执行所需的任务。例如,当出现USART接收中断时,用户可以编写相应的ISR用于处理接收到的数据。 最后,stm32f10x_it.h是一个中断处理的头文件,用于声明STM32F10x系列微控制器中使用的中断函数。用户可以根据自己的需求,在该文件中进行中断函数的声明。通常情况下,该文件会包含stm32f10x_conf.h文件,以便获取相关配置信息。 综上所述,stm32f10x_conf.h、stm32f10x_it.c和stm32f10x_it.h是针对STM32F10x系列微控制器的配置和中断处理的文件,用于配置硬件资源的初始化和处理中断事件。通过这些文件的使用,可以有效地管理STM32F10x系列微控制器的硬件资源并实现相应的功能。 ### 回答3: stm32f10x_conf.h是STM32F10x系列的配置文件,这个文件定义了STM32F10x器件的所有寄存器和外设的基本配置信息。在该文件中,我们可以根据需要选择要使用的外设和配置其相关参数,例如时钟配置、中断向量表配置等。通过修改这个文件中的宏定义和其他配置选项,我们可以对STM32F10x进行定制化的配置。 stm32f10x_it.c和stm32f10x_it.h是处理中断的文件。stm32f10x_it.c文件包含了处理各种中断的函数,而stm32f10x_it.h文件则是它的头文件,用于声明这些中断函数。这些文件是由STM32标准外设库提的,它们定义了中断函数的框架,并提了中断处理的一些常用函数和数据结构。 在使用STM32F10x系列的MCU进行开发时,我们通常需要根据需求来处理一些特定的中断,例如定时器中断、串口中断等。我们可以在stm32f10x_it.c中编写这些中断函数的具体实现,并在stm32f10x_it.h中进行声明。然后,在主程序中,我们可以根据需要直接调用这些中断函数。 这些文件的提给我们开发STM32F10x系列的MCU带来了很大的便利性。通过配置stm32f10x_conf.h文件,我们可以轻松地选择和配置所需的外设,并在stm32f10x_it.c文件中编写和处理中断函数,实现各种功能的逻辑。 总之,stm32f10x_conf.h、stm32f10x_it.c和stm32f10x_it.h是STM32F10x系列MCU开发中的重要文件,它们提了配置外设和处理中断的框架和函数,方便开发者进行STM32F10x系列MCU的开发工作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值