drv_gpio.h 650 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2006-2022, 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 "cy_retarget_io.h"
  16. #include "cyhal_gpio.h"
  17. #include "cyhal_irq_psoc.h"
  18. #define GPIO_INTERRUPT_PRIORITY (7u)
  19. #define GET_PIN(PORTx,PIN) ((((uint8_t)(PORTx)) << 3U) + ((uint8_t)(PIN)))
  20. struct pin_irq_map
  21. {
  22. rt_uint16_t pin;
  23. IRQn_Type irqno;
  24. };
  25. int rt_hw_pin_init(void);
  26. #endif /* __DRV_GPIO_H__ */