1 /* 2 * Copyright (c) 2020 Nuvoton Technology Corporation. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef _NUVOTON_NPCX_SOC_GPIO_H_ 8 #define _NUVOTON_NPCX_SOC_GPIO_H_ 9 10 #include <zephyr/device.h> 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /* Pin number for each GPIO device */ 17 #define NPCX_GPIO_PORT_PIN_NUM 8U 18 19 /** 20 * @brief Get GPIO device instance by port index 21 * 22 * @param port GPIO device index 23 * 24 * @retval Pointer to structure device 25 * @retval NULL Invalid parameter of GPIO port index 26 */ 27 const struct device *npcx_get_gpio_dev(int port); 28 29 /** 30 * @brief Enable the connection between io pads and GPIO instance 31 * 32 * @param dev Pointer to device structure for the gpio driver instance. 33 * @param pin Pin number. 34 */ 35 void npcx_gpio_enable_io_pads(const struct device *dev, int pin); 36 37 /** 38 * @brief Disable the connection between io pads and GPIO instance 39 * 40 * @param dev Pointer to device structure for the gpio driver instance. 41 * @param pin Pin number. 42 */ 43 void npcx_gpio_disable_io_pads(const struct device *dev, int pin); 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif /* _NUVOTON_NPCX_SOC_GPIO_H_ */ 50