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  * 2021-08-15     Jonas        first version
9  */
10 
11 #ifndef __DRV_GPIO_H__
12 #define __DRV_GPIO_H__
13 
14 #include <board.h>
15 #include <rthw.h>
16 #include <rtdevice.h>
17 
18 #define __HK32_PORT(port)  GPIO##port##_BASE
19 
20 #define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__HK32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)
21 
22 /* HK32 GPIO driver */
23 
24 struct pin_irq_map
25 {
26     rt_uint16_t pinbit;
27     rt_uint16_t lineno;
28     IRQn_Type irqno;
29 };
30 
31 int rt_hw_pin_init(void);
32 
33 #endif /* __DRV_GPIO_H__ */
34 
35