summaryrefslogtreecommitdiff
path: root/bsp/nuvoton/libraries/m460/rtt_port/drv_gpio.h
blob: 3a55396adb3ccbde713bc33dea76dfc6de59a2c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**************************************************************************//**
*
* @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date            Author           Notes
* 2022-4-27       Wayne            First version
*
******************************************************************************/

#ifndef __DRV_GPIO_H__
#define __DRV_GPIO_H__

typedef enum
{
    NU_PA,
    NU_PB,
    NU_PC,
    NU_PD,
    NU_PE,
    NU_PF,
    NU_PG,
    NU_PH,
    NU_PI,
    NU_PJ,
    NU_PORT_CNT,
} nu_gpio_port;

#define NU_GET_PININDEX(port, pin)        ((port)*16+(pin))
#define NU_GET_PINS(rt_pin_index)         ((rt_pin_index) & 0x0000000F)
#define NU_GET_PORT(rt_pin_index)         (((rt_pin_index)>>4) & 0x0000000F)
#define NU_GET_PIN_MASK(nu_gpio_pin)      (1 << (nu_gpio_pin))

#endif //__DRV_GPIO_H__