drv_gpio.h 716 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. * Copyright (c) 2022, Xiaohua Semiconductor Co., Ltd.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Change Logs:
  8. * Date Author Notes
  9. * 2022-04-28 CDT first version
  10. */
  11. #ifndef __DRV_GPIO_H__
  12. #define __DRV_GPIO_H__
  13. #include <rtdevice.h>
  14. #include "drv_irq.h"
  15. #if defined(RT_USING_PIN)
  16. #define __HC_PORT(port) GPIO_PORT_##port
  17. #define GET_PIN(PORT, PIN) (rt_base_t)(((rt_uint16_t)__HC_PORT(PORT) * 16) + PIN)
  18. struct hc32_pin_irq_map
  19. {
  20. rt_uint16_t pinbit;
  21. func_ptr_t irq_callback;
  22. struct hc32_irq_config irq_config;
  23. };
  24. #endif
  25. #endif /* __DRV_GPIO_H__ */