drv_gpio.h 783 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-06-27 BalanceTWK first version
  9. */
  10. #ifndef __DRV_GPIO__H__
  11. #define __DRV_GPIO__H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include "board.h"
  15. /* GD32VF GPIO driver */
  16. struct pin_index
  17. {
  18. int index;
  19. uint32_t gpio_periph;
  20. uint32_t pin;
  21. };
  22. #define __GD32VF_PIN(index, gpio, gpio_index) \
  23. { \
  24. index, GPIO##gpio, GPIO_PIN_##gpio_index \
  25. }
  26. struct pin_irq_map
  27. {
  28. rt_uint16_t pinbit;
  29. IRQn_Type irqno;
  30. };
  31. int rt_hw_gpio_init(void);
  32. #endif /* __DRV_GPIO__H__ */
  33. /******************* end of file *******************/