1 /* 2 * Copyright (c) 2006-2023, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2020-08-20 Abbcc first version 9 */ 10 11 #ifndef __DRV_GPIO_H__ 12 #define __DRV_GPIO_H__ 13 14 #include <drv_common.h> 15 #include <board.h> 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #define __APM32_PORT(port) GPIO##port##_BASE 22 23 #define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__APM32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN) 24 25 struct pin_irq_map 26 { 27 rt_uint16_t pinbit; 28 IRQn_Type irqno; 29 }; 30 31 int rt_hw_pin_init(void); 32 33 #ifdef __cplusplus 34 } 35 #endif 36 37 #endif /* __DRV_GPIO_H__ */ 38 39