下面继续探究gd32f10x_conf.h的内容,gd32f10x_conf.h的内容如下
#ifndef __GD32F10X_CONF_H
#define __GD32F10X_CONF_H
/* Includes ------------------------------------------------------------------*/
#include "gd32f10x_adc.h"
#include "gd32f10x_bkp.h"
#include "gd32f10x_can.h"
#include "gd32f10x_crc.h"
#include "gd32f10x_dac.h"
#include "gd32f10x_dma.h"
#include "gd32f10x_eth.h"
#include "gd32f10x_exmc.h"
#include "gd32f10x_exti.h"
#include "gd32f10x_fmc.h"
#include "gd32f10x_gpio.h"
#include "gd32f10x_i2c.h"
#include "gd32f10x_iwdg.h"
#include "gd32f10x_mcudbg.h"
#include "gd32f10x_misc.h"
#include "gd32f10x_pwr.h"
#include "gd32f10x_rcc.h"
#include "gd32f10x_rtc.h"
#include "gd32f10x_sdio.h"
#include "gd32f10x_spi.h"
#include "gd32f10x_timer.h"
#include "gd32f10x_usart.h"
#include "gd32f10x_wwdg.h"
#endif /* __GD32F10X_CONF_H */
我们可以通过修改这里面包含的外设的头文件,来达到引用外设库函数的作用,但是在大多数情况下,不是所有的外设都需要引用的,我们可以屏蔽他。然后在需要使用某个外设的时候,再引用之。例如,如要用到外部中断,我们引用下面四个头文件即可,其他的可以屏蔽
#ifndef __GD32F10X_CONF_H
#define __GD32F10X_CONF_H
/* Includes ------------------------------------------------------------------*/
//#include "gd32f10x_adc.h"
//#include "gd32f10x_bkp.h"
//#include "gd32f10x_can.h"
//#include "gd32f10x_crc.h"
//#include "gd32f10x_dac.h"
//#include "gd32f10x_dma.h"
//#include "gd32f10x_eth.h"
//#include "gd32f10x_exmc.h"
#include "gd32f10x_exti.h"
//#include "gd32f10x_fmc.h"
#include "gd32f10x_gpio.h"
//#include "gd32f10x_i2c.h"
//#include "gd32f10x_iwdg.h"
//#include "gd32f10x_mcudbg.h"
#include "gd32f10x_misc.h"
//#include "gd32f10x_pwr.h"
#include "gd32f10x_rcc.h"
//#include "gd32f10x_rtc.h"
//#include "gd32f10x_sdio.h"
//#include "gd32f10x_spi.h"
//#include "gd32f10x_timer.h"
//#include "gd32f10x_usart.h"
//#include "gd32f10x_wwdg.h"
#endif /* __GD32F10X_CONF_H */
|