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 * 2020-2-7 YCHuang12 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_PORT_CNT, 26 } nu_gpio_port; 27 28 #define NU_GET_PININDEX(port, pin) ((port)*16+(pin)) 29 #define NU_GET_PINS(rt_pin_index) ((rt_pin_index) & 0x0000000F) 30 #define NU_GET_PORT(rt_pin_index) (((rt_pin_index)>>4) & 0x0000000F) 31 #define NU_GET_PIN_MASK(nu_gpio_pin) (1 << (nu_gpio_pin)) 32 33 #endif //__DRV_GPIO_H__ 34