1 /*
2  * Copyright (c) 2020-2022, CQ 100ask Development Team
3  *
4  * Change Logs:
5  *   Date           Author          Notes
6  * 2022-05-29        Alen       first version
7  */
8 
9 #ifndef __DRV_GPIO_H__
10 #define __DRV_GPIO_H__
11 
12 #include <drv_common.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #define __MM32_PORT(port)  GPIO##port##_BASE
19 
20 #define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__MM32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)
21 
22 struct pin_irq_map
23 {
24     rt_uint16_t pinbit;
25     IRQn_Type irqno;
26     rt_uint32_t extiline;
27     SYSCFG_EXTILine_Type syscfg_extiline;
28 };
29 
30 int rt_hw_pin_init(void);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 #endif /* __DRV_GPIO_H__ */
37 
38