drv_gpio.h 676 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2020-2022, CQ 100ask Development Team
  3. *
  4. * Change Logs:
  5. * Date Author Notes
  6. * 2022-05-29 Alen first version
  7. */
  8. #ifndef __DRV_GPIO_H__
  9. #define __DRV_GPIO_H__
  10. #include <drv_common.h>
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define __MM32_PORT(port) GPIO##port##_BASE
  15. #define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__MM32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)
  16. struct pin_irq_map
  17. {
  18. rt_uint16_t pinbit;
  19. IRQn_Type irqno;
  20. rt_uint32_t extiline;
  21. SYSCFG_EXTILine_Type syscfg_extiline;
  22. };
  23. int rt_hw_pin_init(void);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif /* __DRV_GPIO_H__ */