drv_gpio.h 599 B

1234567891011121314151617181920212223242526272829303132
  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 "cyhal_irq_psoc.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. IRQn_Type irqno;
  22. };
  23. int rt_hw_pin_init(void);
  24. #endif /* __DRV_GPIO_H__ */