drv_gpio.h 1.1 KB

123456789101112131415161718192021222324252627
  1. #ifndef __DRV_GPIO_H
  2. #define __DRV_GPIO_H
  3. #include "stm32f4xx.h"
  4. #define DRV_GPIO_BEEP_PORT GPIOF
  5. #define DRV_GPIO_BEEP_PIN GPIO_Pin_8
  6. #define DRV_GPIO_LED0_PORT GPIOF
  7. #define DRV_GPIO_LED0_PIN GPIO_Pin_9
  8. #define DRV_GPIO_LED1_PORT GPIOF
  9. #define DRV_GPIO_LED1_PIN GPIO_Pin_10
  10. #define DRV_GPIO_KEY_UP_PORT GPIOA
  11. #define DRV_GPIO_KEY_UP_PIN GPIO_Pin_0
  12. #define DRV_GPIO_KEY0_PORT GPIOE
  13. #define DRV_GPIO_KEY0_PIN GPIO_Pin_4
  14. #define DRV_GPIO_KEY1_PORT GPIOE
  15. #define DRV_GPIO_KEY1_PIN GPIO_Pin_3
  16. #define DRV_GPIO_KEY2_PORT GPIOE
  17. #define DRV_GPIO_KEY2_PIN GPIO_Pin_2
  18. #define DRV_GPIO_LED0(on_off) ((on_off == 0) ? (GPIO_ResetBits(DRV_GPIO_LED0_PORT, DRV_GPIO_LED0_PIN)) : (GPIO_SetBits(DRV_GPIO_LED0_PORT, DRV_GPIO_LED0_PIN)))
  19. #define DRV_GPIO_LED1(on_off) ((on_off == 0) ? (GPIO_ResetBits(DRV_GPIO_LED1_PORT, DRV_GPIO_LED1_PIN)) : (GPIO_SetBits(DRV_GPIO_LED1_PORT, DRV_GPIO_LED1_PIN)))
  20. #define DRV_GPIO_BEEP(beep_status) ((beep_status == 0) ? (GPIO_ResetBits(DRV_GPIO_BEEP_PORT, DRV_GPIO_BEEP_PIN)) : (GPIO_SetBits(DRV_GPIO_BEEP_PORT, DRV_GPIO_BEEP_PIN)))
  21. void drv_gpio_init(void);
  22. #endif // __DRV_GPIO_H