11bd4fe43Sopenharmony_ci/**
21bd4fe43Sopenharmony_ci * @file hi_gpio.h
31bd4fe43Sopenharmony_ci *
41bd4fe43Sopenharmony_ci * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
51bd4fe43Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
61bd4fe43Sopenharmony_ci * you may not use this file except in compliance with the License.
71bd4fe43Sopenharmony_ci * You may obtain a copy of the License at
81bd4fe43Sopenharmony_ci *
91bd4fe43Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
101bd4fe43Sopenharmony_ci *
111bd4fe43Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
121bd4fe43Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
131bd4fe43Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
141bd4fe43Sopenharmony_ci * See the License for the specific language governing permissions and
151bd4fe43Sopenharmony_ci * limitations under the License.
161bd4fe43Sopenharmony_ci */
171bd4fe43Sopenharmony_ci
181bd4fe43Sopenharmony_ci/**
191bd4fe43Sopenharmony_ci* @defgroup iot_gpio GPIO
201bd4fe43Sopenharmony_ci* @ingroup drivers
211bd4fe43Sopenharmony_ci*/
221bd4fe43Sopenharmony_ci#ifndef __HI_GPIO_H__
231bd4fe43Sopenharmony_ci#define __HI_GPIO_H__
241bd4fe43Sopenharmony_ci
251bd4fe43Sopenharmony_ci
261bd4fe43Sopenharmony_ci#include <hi_types_base.h>
271bd4fe43Sopenharmony_ci
281bd4fe43Sopenharmony_ci/**
291bd4fe43Sopenharmony_ci* @ingroup iot_gpio
301bd4fe43Sopenharmony_ci*
311bd4fe43Sopenharmony_ci* GPIO ID.
321bd4fe43Sopenharmony_ci*/
331bd4fe43Sopenharmony_citypedef enum {
341bd4fe43Sopenharmony_ci    HI_GPIO_IDX_0,     /**< GPIO0*/
351bd4fe43Sopenharmony_ci    HI_GPIO_IDX_1,     /**< GPIO1*/
361bd4fe43Sopenharmony_ci    HI_GPIO_IDX_2,     /**< GPIO2*/
371bd4fe43Sopenharmony_ci    HI_GPIO_IDX_3,     /**< GPIO3*/
381bd4fe43Sopenharmony_ci    HI_GPIO_IDX_4,     /**< GPIO4*/
391bd4fe43Sopenharmony_ci    HI_GPIO_IDX_5,     /**< GPIO5*/
401bd4fe43Sopenharmony_ci    HI_GPIO_IDX_6,     /**< GPIO6*/
411bd4fe43Sopenharmony_ci    HI_GPIO_IDX_7,     /**< GPIO7*/
421bd4fe43Sopenharmony_ci    HI_GPIO_IDX_8,     /**< GPIO8*/
431bd4fe43Sopenharmony_ci    HI_GPIO_IDX_9,     /**< GPIO9*/
441bd4fe43Sopenharmony_ci    HI_GPIO_IDX_10,    /**< GPIO10*/
451bd4fe43Sopenharmony_ci    HI_GPIO_IDX_11,    /**< GPIO11*/
461bd4fe43Sopenharmony_ci    HI_GPIO_IDX_12,    /**< GPIO12*/
471bd4fe43Sopenharmony_ci    HI_GPIO_IDX_13,    /**< GPIO13*/
481bd4fe43Sopenharmony_ci    HI_GPIO_IDX_14,    /**< GPIO14*/
491bd4fe43Sopenharmony_ci    HI_GPIO_IDX_MAX,   /**< Maximum value, which cannot be used.CNcomment:最大值,不可输入使用CNend*/
501bd4fe43Sopenharmony_ci} hi_gpio_idx;
511bd4fe43Sopenharmony_ci
521bd4fe43Sopenharmony_ci
531bd4fe43Sopenharmony_ci/**
541bd4fe43Sopenharmony_ci* @ingroup iot_gpio
551bd4fe43Sopenharmony_ci*
561bd4fe43Sopenharmony_ci* I/O level. CNcomment:GPIO电平状态。CNend
571bd4fe43Sopenharmony_ci*/
581bd4fe43Sopenharmony_citypedef enum {
591bd4fe43Sopenharmony_ci    HI_GPIO_VALUE0 = 0,      /**< Low level.CNcomment:低电平CNend*/
601bd4fe43Sopenharmony_ci    HI_GPIO_VALUE1           /**< High level.CNcomment:高电平CNend*/
611bd4fe43Sopenharmony_ci} hi_gpio_value;
621bd4fe43Sopenharmony_ci
631bd4fe43Sopenharmony_ci/**
641bd4fe43Sopenharmony_ci* @ingroup iot_gpio
651bd4fe43Sopenharmony_ci*
661bd4fe43Sopenharmony_ci* I/O direction. CNcomment:GPIO方向。CNend
671bd4fe43Sopenharmony_ci*/
681bd4fe43Sopenharmony_citypedef enum {
691bd4fe43Sopenharmony_ci    HI_GPIO_DIR_IN = 0,       /**< Input.CNcomment:输入方向CNend*/
701bd4fe43Sopenharmony_ci    HI_GPIO_DIR_OUT           /**< Output.CNcomment:输出方向CNend*/
711bd4fe43Sopenharmony_ci} hi_gpio_dir;
721bd4fe43Sopenharmony_ci
731bd4fe43Sopenharmony_ci/**
741bd4fe43Sopenharmony_ci* @ingroup iot_gpio
751bd4fe43Sopenharmony_ci*
761bd4fe43Sopenharmony_ci* I/O interrupt trigger mode. This bit is used with HI_GPIO_INT_POLARITY.
771bd4fe43Sopenharmony_ciCNcomment:GPIO中断触发方式,与hi_gpio_int_polarity配合使用。CNend
781bd4fe43Sopenharmony_ci*/
791bd4fe43Sopenharmony_citypedef enum {
801bd4fe43Sopenharmony_ci    HI_INT_TYPE_LEVEL = 0, /**< The interrupt is triggered in level-sensitive mode. CNcomment:电平触发中断CNend */
811bd4fe43Sopenharmony_ci    HI_INT_TYPE_EDGE   /**< Interrupt triggered at the rising edge or falling edge.CNcomment:边沿触发中断CNend */
821bd4fe43Sopenharmony_ci} hi_gpio_int_type;
831bd4fe43Sopenharmony_ci
841bd4fe43Sopenharmony_ci/**
851bd4fe43Sopenharmony_ci* @ingroup iot_gpio
861bd4fe43Sopenharmony_ci*
871bd4fe43Sopenharmony_ci* I/O interrupt polarity. This pin is used with HI_GPIO_INT.
881bd4fe43Sopenharmony_ciCNcomment:IO中断极性,与hi_gpio_int_type配合使用。CNend
891bd4fe43Sopenharmony_ci*/
901bd4fe43Sopenharmony_citypedef enum {
911bd4fe43Sopenharmony_ci    HI_GPIO_EDGE_FALL_LEVEL_LOW = 0,  /**< Interrupt triggered at low level or falling edge.
921bd4fe43Sopenharmony_ci                                         CNcomment:低电平或下降沿触发中断CNend */
931bd4fe43Sopenharmony_ci    HI_GPIO_EDGE_RISE_LEVEL_HIGH      /**< Interrupt triggered at high level or rising edge.
941bd4fe43Sopenharmony_ci                                         CNcomment:高电平或上升沿触发中断CNend */
951bd4fe43Sopenharmony_ci} hi_gpio_int_polarity;
961bd4fe43Sopenharmony_ci
971bd4fe43Sopenharmony_ci
981bd4fe43Sopenharmony_ci/**
991bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
1001bd4fe43Sopenharmony_ci* @brief  Callback function when GPIO interruption happens.CNcomment:GPIO中断回调函数。CNend
1011bd4fe43Sopenharmony_ci*
1021bd4fe43Sopenharmony_ci* @par 描述:
1031bd4fe43Sopenharmony_ci*           Callback function when GPIO interruption happens.CNcomment:GPIO中断回调函数。CNend
1041bd4fe43Sopenharmony_ci*
1051bd4fe43Sopenharmony_ci* @attention None
1061bd4fe43Sopenharmony_ci*
1071bd4fe43Sopenharmony_ci* @param  arg     [IN] type #hi_void *,arg of interrupt callback function. CNcomment:中断回调函数入参。CNend
1081bd4fe43Sopenharmony_ci*
1091bd4fe43Sopenharmony_ci* @retval None
1101bd4fe43Sopenharmony_ci* @par 依赖:
1111bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
1121bd4fe43Sopenharmony_ci* @see  None
1131bd4fe43Sopenharmony_ci*/
1141bd4fe43Sopenharmony_citypedef hi_void (*gpio_isr_callback) (hi_void *arg);
1151bd4fe43Sopenharmony_ci
1161bd4fe43Sopenharmony_ci/**
1171bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
1181bd4fe43Sopenharmony_ci* @brief  Initializes GPIO module.CNcomment:GPIO模块初始化。CNend
1191bd4fe43Sopenharmony_ci*
1201bd4fe43Sopenharmony_ci* @par 描述:
1211bd4fe43Sopenharmony_ci*           Initializes GPIO module.CNcomment:GPIO模块初始化。CNend
1221bd4fe43Sopenharmony_ci*
1231bd4fe43Sopenharmony_ci* @attention
1241bd4fe43Sopenharmony_ci* @li This API needs to be invoked during initialization to enable the GPIO interrupt so that the I/O interrupt
1251bd4fe43Sopenharmony_ci*     can be responded.CNcomment:需要在初始化阶段调用该接口使能GPIO中断,使得IO中断可以得到响应。CNend
1261bd4fe43Sopenharmony_ci* @li This interface cannot be invoked repeatedly. It can be invoked only once in the initialization phase.
1271bd4fe43Sopenharmony_ciCNcomment:该接口不支持重复调用,只能在初始化阶段调用一次。CNend
1281bd4fe43Sopenharmony_ci*
1291bd4fe43Sopenharmony_ci* @param  None
1301bd4fe43Sopenharmony_ci*
1311bd4fe43Sopenharmony_ci* @retval #0       Success.
1321bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
1331bd4fe43Sopenharmony_ci* @par 依赖:
1341bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
1351bd4fe43Sopenharmony_ci* @see  None
1361bd4fe43Sopenharmony_ci*/
1371bd4fe43Sopenharmony_cihi_u32 hi_gpio_init(hi_void);
1381bd4fe43Sopenharmony_ci
1391bd4fe43Sopenharmony_ci/**
1401bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
1411bd4fe43Sopenharmony_ci* @brief  Deinitializes GPIO module. CNcomment:GPIO模块去初始化。CNend
1421bd4fe43Sopenharmony_ci*
1431bd4fe43Sopenharmony_ci* @par 描述:
1441bd4fe43Sopenharmony_ci*           Deinitializes GPIO module. CNcomment:GPIO模块去初始化。CNend
1451bd4fe43Sopenharmony_ci*
1461bd4fe43Sopenharmony_ci* @attention
1471bd4fe43Sopenharmony_ci* @li This interface is used to disable the GPIO interrupt. After the GPIO interrupt is called, the GPIO interrupt
1481bd4fe43Sopenharmony_ci*     cannot be responded.CNcomment:该接口功能为去使能GPIO中断,调用后GPIO中断将得不到响应。CNend
1491bd4fe43Sopenharmony_ci*
1501bd4fe43Sopenharmony_ci* @param  None
1511bd4fe43Sopenharmony_ci*
1521bd4fe43Sopenharmony_ci* @retval #0       Success.
1531bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
1541bd4fe43Sopenharmony_ci* @par 依赖:
1551bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
1561bd4fe43Sopenharmony_ci* @see  None
1571bd4fe43Sopenharmony_ci*/
1581bd4fe43Sopenharmony_cihi_u32 hi_gpio_deinit(hi_void);
1591bd4fe43Sopenharmony_ci
1601bd4fe43Sopenharmony_ci/**
1611bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
1621bd4fe43Sopenharmony_ci* @brief  Sets the direction of a single I/O pin.CNcomment:设置某个GPIO管脚方向。CNend
1631bd4fe43Sopenharmony_ci*
1641bd4fe43Sopenharmony_ci* @par 描述:
1651bd4fe43Sopenharmony_ci*           Sets the direction of a single I/O pin.CNcomment:设置某个GPIO管脚方向。CNend
1661bd4fe43Sopenharmony_ci*
1671bd4fe43Sopenharmony_ci* @attention None
1681bd4fe43Sopenharmony_ci* @param  id [IN]    type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
1691bd4fe43Sopenharmony_ci* @param  dir   [IN] type #hi_gpio_dir,I/O direction.CNcomment:GPIO方向。CNend
1701bd4fe43Sopenharmony_ci*
1711bd4fe43Sopenharmony_ci* @retval #0       Success.
1721bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
1731bd4fe43Sopenharmony_ci* @par 依赖:
1741bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
1751bd4fe43Sopenharmony_ci* @see  hi_gpio_get_dir
1761bd4fe43Sopenharmony_ci*/
1771bd4fe43Sopenharmony_cihi_u32 hi_gpio_set_dir(hi_gpio_idx id, hi_gpio_dir dir);
1781bd4fe43Sopenharmony_ci
1791bd4fe43Sopenharmony_ci/**
1801bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
1811bd4fe43Sopenharmony_ci* @brief  Gets the direction of a single I/O pin.CNcomment:获取某个GPIO管脚方向。CNend
1821bd4fe43Sopenharmony_ci*
1831bd4fe43Sopenharmony_ci* @par 描述:
1841bd4fe43Sopenharmony_ci*           Gets the direction of a single I/O pin.CNcomment:获取某个GPIO管脚方向。CNend
1851bd4fe43Sopenharmony_ci*
1861bd4fe43Sopenharmony_ci* @attention None
1871bd4fe43Sopenharmony_ci* @param  id    [IN]  type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
1881bd4fe43Sopenharmony_ci* @param  dir   [OUT] type #hi_gpio_dir*,I/O direction.CNcomment:GPIO方向。CNend
1891bd4fe43Sopenharmony_ci*
1901bd4fe43Sopenharmony_ci* @retval #0       Success.
1911bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
1921bd4fe43Sopenharmony_ci* @par 依赖:
1931bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
1941bd4fe43Sopenharmony_ci* @see  hi_gpio_set_dir
1951bd4fe43Sopenharmony_ci*/
1961bd4fe43Sopenharmony_cihi_u32 hi_gpio_get_dir(hi_gpio_idx id, hi_gpio_dir *dir);
1971bd4fe43Sopenharmony_ci
1981bd4fe43Sopenharmony_ci/**
1991bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
2001bd4fe43Sopenharmony_ci* @brief  Sets the output level of a single I/O pin.CNcomment:设置单个GPIO管脚输出电平状态。CNend
2011bd4fe43Sopenharmony_ci*
2021bd4fe43Sopenharmony_ci* @par 描述:
2031bd4fe43Sopenharmony_ci*           Sets the output level of a single I/O pin.CNcomment:设置单个GPIO管脚输出电平状态。CNend
2041bd4fe43Sopenharmony_ci*
2051bd4fe43Sopenharmony_ci* @attention None
2061bd4fe43Sopenharmony_ci*
2071bd4fe43Sopenharmony_ci* @param  id [IN]    type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
2081bd4fe43Sopenharmony_ci* @param  val [IN] type #hi_gpio_value,output value. CNcomment:输出值。CNend
2091bd4fe43Sopenharmony_ci*                 @li 0:low level.CNcomment:低电平。CNend
2101bd4fe43Sopenharmony_ci*                 @li 1:high level.CNcomment:高电平。CNend
2111bd4fe43Sopenharmony_ci*
2121bd4fe43Sopenharmony_ci* @retval #0       Success.
2131bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
2141bd4fe43Sopenharmony_ci* @par 依赖:
2151bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
2161bd4fe43Sopenharmony_ci* @see  hi_gpio_get_input_val。
2171bd4fe43Sopenharmony_ci*/
2181bd4fe43Sopenharmony_cihi_u32 hi_gpio_set_ouput_val(hi_gpio_idx id, hi_gpio_value val);
2191bd4fe43Sopenharmony_ci
2201bd4fe43Sopenharmony_ci/**
2211bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
2221bd4fe43Sopenharmony_ci* @brief  Obtains the output level of a single I/O pin.CNcomment:获取某个IO管脚输出电平状态。CNend
2231bd4fe43Sopenharmony_ci*
2241bd4fe43Sopenharmony_ci* @par 描述:
2251bd4fe43Sopenharmony_ci*           Obtains the output level of a single I/O pin.CNcomment:获取某个IO管脚输出电平状态。CNend
2261bd4fe43Sopenharmony_ci*
2271bd4fe43Sopenharmony_ci* @attention None
2281bd4fe43Sopenharmony_ci* @param  id  [IN]  type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
2291bd4fe43Sopenharmony_ci* @param  val [OUT] type #hi_gpio_value*,Output value.CNcomment:输出值。CNend
2301bd4fe43Sopenharmony_ci*                 @li 0:low level.CNcomment:低电平。CNend
2311bd4fe43Sopenharmony_ci*                 @li 1:high level.CNcomment:高电平。CNend
2321bd4fe43Sopenharmony_ci*
2331bd4fe43Sopenharmony_ci* @retval #0       Success.
2341bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
2351bd4fe43Sopenharmony_ci* @par 依赖:
2361bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
2371bd4fe43Sopenharmony_ci* @see  hi_gpio_set_ouput_val。
2381bd4fe43Sopenharmony_ci*/
2391bd4fe43Sopenharmony_cihi_u32 hi_gpio_get_output_val(hi_gpio_idx id, hi_gpio_value* val);
2401bd4fe43Sopenharmony_ci
2411bd4fe43Sopenharmony_ci/**
2421bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
2431bd4fe43Sopenharmony_ci* @brief  Obtains the input level of a single I/O pin.CNcomment:获取某个IO管脚输入电平状态。CNend
2441bd4fe43Sopenharmony_ci*
2451bd4fe43Sopenharmony_ci* @par 描述:
2461bd4fe43Sopenharmony_ci*           Obtains the input level of a single I/O pin.CNcomment:获取某个IO管脚输入电平状态。CNend
2471bd4fe43Sopenharmony_ci*
2481bd4fe43Sopenharmony_ci* @attention None
2491bd4fe43Sopenharmony_ci* @param  id  [IN]  type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
2501bd4fe43Sopenharmony_ci* @param  val [OUT] type #hi_gpio_value*,Output value.CNcomment:输出值。CNend
2511bd4fe43Sopenharmony_ci*                 @li 0:low level.CNcomment:低电平。CNend
2521bd4fe43Sopenharmony_ci*                 @li 1:high level.CNcomment:高电平。CNend
2531bd4fe43Sopenharmony_ci*
2541bd4fe43Sopenharmony_ci* @retval #0       Success.
2551bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
2561bd4fe43Sopenharmony_ci* @par 依赖:
2571bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
2581bd4fe43Sopenharmony_ci* @see  None
2591bd4fe43Sopenharmony_ci*/
2601bd4fe43Sopenharmony_cihi_u32 hi_gpio_get_input_val(hi_gpio_idx id, hi_gpio_value *val);
2611bd4fe43Sopenharmony_ci
2621bd4fe43Sopenharmony_ci/**
2631bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
2641bd4fe43Sopenharmony_ci* @brief  Enable GPIO interruption.CNcomment:使能某个GPIO的中断功能。CNend
2651bd4fe43Sopenharmony_ci*
2661bd4fe43Sopenharmony_ci* @par 描述:
2671bd4fe43Sopenharmony_ci*           Enable GPIO interruption.CNcomment:使能某个GPIO的中断功能。CNend
2681bd4fe43Sopenharmony_ci*
2691bd4fe43Sopenharmony_ci* @attention None
2701bd4fe43Sopenharmony_ci* @param  id            [IN] type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
2711bd4fe43Sopenharmony_ci* @param  int_type      [IN] type #hi_gpio_int_type,Interruption type.CNcomment:中断类型。CNend
2721bd4fe43Sopenharmony_ci* @param  int_polarity  [IN] type #hi_gpio_int_polarity,Interruption polarity.CNcomment:中断极性。CNend
2731bd4fe43Sopenharmony_ci* @param  func          [IN] type #gpio_isr_callback_func,Callback function of interruption.
2741bd4fe43Sopenharmony_ciCNcomment:中断回调函数。CNend
2751bd4fe43Sopenharmony_ci* @param  arg           [IN] type #hi_void *,arg of interrupt callback function. CNcomment:中断回调函数入参。CNend
2761bd4fe43Sopenharmony_ci*
2771bd4fe43Sopenharmony_ci* @retval #0       Success.
2781bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
2791bd4fe43Sopenharmony_ci* @par 依赖:
2801bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
2811bd4fe43Sopenharmony_ci* @see  hi_gpio_unregister_isr_function。
2821bd4fe43Sopenharmony_ci*/
2831bd4fe43Sopenharmony_cihi_u32 hi_gpio_register_isr_function(hi_gpio_idx id, hi_gpio_int_type int_type, hi_gpio_int_polarity int_polarity,
2841bd4fe43Sopenharmony_ci                                     gpio_isr_callback func, hi_void *arg);
2851bd4fe43Sopenharmony_ci
2861bd4fe43Sopenharmony_ci/**
2871bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
2881bd4fe43Sopenharmony_ci* @brief  Disable GPIO interruption.CNcomment:去使能某个GPIO的中断功能。CNend
2891bd4fe43Sopenharmony_ci*
2901bd4fe43Sopenharmony_ci* @par 描述:
2911bd4fe43Sopenharmony_ci*           Disable GPIO interruption.CNcomment:去使能某个GPIO的中断功能。CNend
2921bd4fe43Sopenharmony_ci*
2931bd4fe43Sopenharmony_ci* @attention None
2941bd4fe43Sopenharmony_ci* @param  id [IN] type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
2951bd4fe43Sopenharmony_ci*
2961bd4fe43Sopenharmony_ci* @retval #0       Success.
2971bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
2981bd4fe43Sopenharmony_ci* @par 依赖:
2991bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
3001bd4fe43Sopenharmony_ci* @see  hi_gpio_register_isr_function。
3011bd4fe43Sopenharmony_ci*/
3021bd4fe43Sopenharmony_cihi_u32 hi_gpio_unregister_isr_function(hi_gpio_idx id);
3031bd4fe43Sopenharmony_ci
3041bd4fe43Sopenharmony_ci/**
3051bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
3061bd4fe43Sopenharmony_ci* @brief  Mask GPIO interruption.CNcomment:屏蔽某个GPIO的中断功能。CNend
3071bd4fe43Sopenharmony_ci*
3081bd4fe43Sopenharmony_ci* @par 描述:
3091bd4fe43Sopenharmony_ci*           Mask GPIO interruption.CNcomment:屏蔽某个GPIO的中断功能。CNend
3101bd4fe43Sopenharmony_ci*
3111bd4fe43Sopenharmony_ci* @attention If this interface is called before hi_gpio_register_isr_function, the hi_gpio_register_isr_function
3121bd4fe43Sopenharmony_ci*            interface will unmask the GPIO interruption.
3131bd4fe43Sopenharmony_ci*            CNcomment:若此接口在hi_gpio_register_isr_function之前调用,hi_gpio_register_isr_function会将配置
3141bd4fe43Sopenharmony_ci*            修改为不屏蔽GPIO中断。CNend
3151bd4fe43Sopenharmony_ci* @param  id            [IN] type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
3161bd4fe43Sopenharmony_ci* @param  is_mask       [IN] type #hi_bool,Interruption type.CNcomment:中断类型。CNend
3171bd4fe43Sopenharmony_ci*                            @li HI_FALSE:Unmask I/O interruption.CNcomment:不屏蔽GPIO中断。CNend
3181bd4fe43Sopenharmony_ci*                            @li HI_TRUE: Mask I/O interruption.CNcomment:屏蔽GPIO中断。CNend
3191bd4fe43Sopenharmony_ci*
3201bd4fe43Sopenharmony_ci* @retval #0       Success.
3211bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
3221bd4fe43Sopenharmony_ci* @par 依赖:
3231bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
3241bd4fe43Sopenharmony_ci* @see  None
3251bd4fe43Sopenharmony_ci*/
3261bd4fe43Sopenharmony_cihi_u32 hi_gpio_set_isr_mask(hi_gpio_idx id, hi_bool is_mask);
3271bd4fe43Sopenharmony_ci
3281bd4fe43Sopenharmony_ci/**
3291bd4fe43Sopenharmony_ci* @ingroup  iot_gpio
3301bd4fe43Sopenharmony_ci* @brief  Set GPIO interruption type and polarity.CNcomment:设置某个GPIO的中断触发方式。CNend
3311bd4fe43Sopenharmony_ci*
3321bd4fe43Sopenharmony_ci* @par 描述:
3331bd4fe43Sopenharmony_ci*           Set GPIO interruption type and polarity.CNcomment:设置某个GPIO的中断触发方式。CNend
3341bd4fe43Sopenharmony_ci*
3351bd4fe43Sopenharmony_ci* @attention If this interface is called before hi_gpio_register_isr_function, hi_gpio_register_isr_function
3361bd4fe43Sopenharmony_ci*            will overwrite the configurations.
3371bd4fe43Sopenharmony_ci*            CNcomment:若此接口在hi_gpio_register_isr_function之前调用,hi_gpio_register_isr_function会覆盖
3381bd4fe43Sopenharmony_ci*            本接口的配置。CNend
3391bd4fe43Sopenharmony_ci* @param  id            [IN] type #hi_gpio_idx,I/O index.CNcomment:GPIO索引。CNend
3401bd4fe43Sopenharmony_ci* @param  int_type      [IN] type #hi_gpio_int_type,Interruption type.CNcomment:中断类型。CNend
3411bd4fe43Sopenharmony_ci* @param  int_polarity  [IN] type #hi_gpio_int_polarity,Interruption polarity.CNcomment:中断极性。CNend
3421bd4fe43Sopenharmony_ci*
3431bd4fe43Sopenharmony_ci* @retval #0       Success.
3441bd4fe43Sopenharmony_ci* @retval #Other   Failure. For details, see hi_errno.h.
3451bd4fe43Sopenharmony_ci* @par 依赖:
3461bd4fe43Sopenharmony_ci*           @li hi_gpio.h:Describes GPIO APIs.CNcomment:文件用于描述GPIO相关接口。CNend
3471bd4fe43Sopenharmony_ci* @see  None
3481bd4fe43Sopenharmony_ci*/
3491bd4fe43Sopenharmony_cihi_u32 hi_gpio_set_isr_mode(hi_gpio_idx id, hi_gpio_int_type int_type, hi_gpio_int_polarity int_polarity);
3501bd4fe43Sopenharmony_ci
3511bd4fe43Sopenharmony_ci#endif
352