drv_gpio.h 761 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. * 2019-07-29 zdzn first version
  9. */
  10. #ifndef __DRV_GPIO_H__
  11. #define __DRV_GPIO_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include "interrupt.h"
  15. #include "board.h"
  16. #define GPIO_IRQ_NUM 3
  17. #define IRQ_GPIO0 49
  18. #define IRQ_GPIO1 50
  19. #define IRQ_GPIO2 51
  20. #define IRQ_GPIO3 52
  21. struct gpio_irq_def
  22. {
  23. void *irq_arg[32];
  24. void (*irq_cb[32])(void *param);
  25. rt_uint8_t irq_type[32];
  26. };
  27. enum gpio_irq_clock
  28. {
  29. GPIO_IRQ_LOSC_32KHZ = 0,
  30. GPIO_IRQ_HOSC_24MHZ
  31. };
  32. int rt_hw_gpio_init(void);
  33. #endif /* __DRV_GPIO_H__ */