drv_gpio.h 663 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-08-15 Jonas first version
  9. */
  10. #ifndef __DRV_GPIO_H__
  11. #define __DRV_GPIO_H__
  12. #include <board.h>
  13. #include <rthw.h>
  14. #include <rtdevice.h>
  15. #define __HK32_PORT(port) GPIO##port##_BASE
  16. #define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__HK32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)
  17. /* HK32 GPIO driver */
  18. struct pin_irq_map
  19. {
  20. rt_uint16_t pinbit;
  21. rt_uint16_t lineno;
  22. IRQn_Type irqno;
  23. };
  24. int rt_hw_pin_init(void);
  25. #endif /* __DRV_GPIO_H__ */