1
0

drv_gpio.h 670 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-08-20 Abbcc first version
  9. */
  10. #ifndef __DRV_GPIO_H__
  11. #define __DRV_GPIO_H__
  12. #include <drv_common.h>
  13. #include <board.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #define __APM32_PORT(port) GPIO##port##_BASE
  18. #define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__APM32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)
  19. struct pin_irq_map
  20. {
  21. rt_uint16_t pinbit;
  22. IRQn_Type irqno;
  23. };
  24. int rt_hw_pin_init(void);
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif /* __DRV_GPIO_H__ */