1 /**************************************************************************//**
2 *
3 * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Change Logs:
8 * Date            Author           Notes
9 * 2021-8-17       Wayne            First version
10 *
11 ******************************************************************************/
12 
13 #ifndef __DRV_GPIO_H__
14 #define __DRV_GPIO_H__
15 
16 typedef enum
17 {
18     NU_PA,
19     NU_PB,
20     NU_PC,
21     NU_PD,
22     NU_PE,
23     NU_PF,
24     NU_PG,
25     NU_PH,
26     NU_PI,
27     NU_PJ,
28     NU_PK,
29     NU_PL,
30     NU_PM,
31     NU_PN,
32     NU_PORT_CNT,
33 } nu_gpio_port;
34 
35 #define NU_GET_PININDEX(port, pin)        (((port)<<4) + (pin))
36 #define NU_GET_PINS(rt_pin_index)         ((rt_pin_index) & 0x0000000F)
37 #define NU_GET_PORT(rt_pin_index)         (((rt_pin_index)>>4) & 0x0000000F)
38 #define NU_GET_PIN_MASK(nu_gpio_pin)      (1 << (nu_gpio_pin))
39 
40 #endif //__DRV_GPIO_H__
41