drv_gpio.h 665 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2006-2024 RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-07-1 Rbb666 first version
  9. */
  10. #ifndef __DRV_GPIO_H__
  11. #define __DRV_GPIO_H__
  12. #include <rthw.h>
  13. #include <rtdevice.h>
  14. #include "drv_common.h"
  15. #include "cyhal_irq_impl.h"
  16. #define GPIO_INTERRUPT_PRIORITY (7u)
  17. #define GET_PIN(PORTx,PIN) ((((uint8_t)(PORTx)) << 3U) + ((uint8_t)(PIN)))
  18. struct pin_irq_map
  19. {
  20. rt_uint16_t port;
  21. #if defined(SOC_SERIES_IFX_XMC)
  22. rt_uint32_t irqno;
  23. #else
  24. IRQn_Type irqno;
  25. #endif
  26. };
  27. int rt_hw_pin_init(void);
  28. #endif /* __DRV_GPIO_H__ */