gpio.h 922 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * @file gpio.h
  3. * @author chenjun (chenjun@radareye.com.cn)
  4. * @brief
  5. * @version 0.1
  6. * @date 2022-04-06
  7. *
  8. * @copyright Copyright (c) 2022
  9. *
  10. */
  11. #ifndef __GPIO_H__
  12. #define __GPIO_H__
  13. #include "n32g45x.h"
  14. /*RF复位信号引脚*/
  15. #define RF_RST_PIN (GPIO_PIN_0)
  16. #define RF_RST_PORT (GPIOB)
  17. //RF复位
  18. #define RF_RESET() // GPIO_SetBits(RF_RST_PORT, RF_RST_PIN)
  19. //RF使能
  20. #define RF_ENABLE() // GPIO_ResetBits(RF_RST_PORT, RF_RST_PIN)
  21. /*LED指示灯脚 */
  22. #define LED0_PIN (GPIO_PIN_0)
  23. #define LED0_PORT (GPIOA)
  24. #define LED1_PIN (GPIO_PIN_15)
  25. #define LED1_PORT (GPIOB)
  26. /*LED ctrl define
  27. * 高电平--OFF
  28. * 低电平--ON
  29. */
  30. #define LED0_OFF() GPIO_SetBits(LED0_PORT, LED0_PIN)
  31. #define LED0_ON() GPIO_ResetBits(LED0_PORT, LED0_PIN)
  32. #define LED1_OFF() //GPIO_SetBits(LED1_PORT, LED1_PIN)
  33. #define LED1_ON() //GPIO_ResetBits(LED1_PORT, LED1_PIN)
  34. void gpio_init(void);
  35. #endif /*__GPIO_H__*/