drv_gpio.h 595 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-02-22 airm2m first version
  9. */
  10. #ifndef __DRV_GPIO_H__
  11. #define __DRV_GPIO_H__
  12. #include <drv_common.h>
  13. #include <board.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #define __AIR32_PORT(port) GPIO##port##_BASE
  18. #define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__AIR32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)
  19. int rt_hw_pin_init(void);
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif /* __DRV_GPIO_H__ */