drv_gpio.h 865 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: Apache-2.0 */
  2. /*
  3. * Copyright (c) 2006-2018, RT-Thread Development Team
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Change Logs:
  8. * Date Author Notes
  9. * 2017-11-24 勤为本 first version
  10. * 2018-05-11 zhuangwei add gpio interrupt ops
  11. */
  12. #ifndef __DRV_GPIO_H__
  13. #define __DRV_GPIO_H__
  14. #include <rthw.h>
  15. struct gpio_irq_def
  16. {
  17. void *irq_arg[32];
  18. void (*irq_cb[32])(void *param);
  19. rt_uint8_t irq_type[32];
  20. rt_uint8_t state[32];
  21. };
  22. struct loongson_gpio {
  23. rt_uint64_t GPIO0_OEN;
  24. rt_uint64_t GPIO1_OEN; /* Reserved */
  25. rt_uint64_t GPIO0_O;
  26. rt_uint64_t GPIO1_O; /* Reserved */
  27. rt_uint64_t GPIO0_I;
  28. rt_uint64_t GPIO1_I; /* Reserved */
  29. rt_uint64_t GPIO0_INTEN;
  30. rt_uint64_t GPIO1_INTEN; /* Reserved */
  31. };
  32. int loongson_pin_init(void);
  33. #endif