gpio.h 1000 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __GPIO_AS_H
  2. #define __GPIO_AS_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /* 包含头文件-----------------------------------------------------------------*/
  7. #include "stm32f10x.h"
  8. /* 宏定义---------------------------------------------------------------------*/
  9. /*
  10. PA15,PB3,PB4,PB5是JTAG引脚,作为通用IO时需调用引脚重映射函数失能JTAG
  11. GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
  12. PC13,PC14,PC15非必要不使用
  13. */
  14. /* 类型定义-------------------------------------------------------------------*/
  15. typedef enum {
  16. LED_RUN,
  17. TEST_IN,
  18. BT_RST,
  19. BT_PWR
  20. } gpiox_enum_t;
  21. /* 全局变量-------------------------------------------------------------------*/
  22. /* 函数原型-------------------------------------------------------------------*/
  23. void gpio_config(void);
  24. void gpio_set(uint8_t gpiox);
  25. void gpio_reset(uint8_t gpiox);
  26. void gpio_toggle(uint8_t gpiox);
  27. uint8_t gpio_read(uint8_t gpiox);
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif /* gpio.h */