1 /** 2 * @file hi_watchdog.h 3 * 4 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 /** 19 * @defgroup iot_watchdog Watchdog 20 * @ingroup drivers 21 */ 22 #ifndef __HI_WATCHDOG_H__ 23 #define __HI_WATCHDOG_H__ 24 25 #include <hi_types_base.h> 26 27 #define HI_WDG_MIN_TIMEOUT 6500 28 29 /** 30 * @ingroup iot_watchdog 31 * @brief Enables the watchdog.CNcomment:使能看门狗。CNend 32 * 33 * @par 描述: 34 * Enables the watchdog.CNcomment:使能看门狗。CNend 35 * 36 * @attention None 37 * @param None 38 * 39 * @retval None 40 * @par 依赖: 41 * @li hi_watchdog.h:describes the watchdog APIs.CNcomment:文件用于描述看门狗相关接口。CNend 42 * @see None 43 */ 44 hi_void hi_watchdog_enable(hi_void); 45 46 /** 47 * @ingroup iot_watchdog 48 * @brief Feeds the watchdog.CNcomment:喂狗。CNend 49 * 50 * @par 描述: Feeds the watchdog.CNcomment:喂狗。CNend 51 * 52 * @attention None 53 * @param None 54 * 55 * @retval None 56 * @par 依赖: 57 * @li hi_watchdog.h:describes the watchdog APIs.CNcomment:文件用于描述看门狗相关接口。CNend 58 * @see None 59 */ 60 hi_void hi_watchdog_feed(hi_void); 61 62 /** 63 * @ingroup iot_watchdog 64 * @brief Disables the watchdog.CNcomment:关闭看门狗。CNend 65 * 66 * @par 描述: 67 * @li Disable the clock enable control of the watchdog.CNcomment:禁止WatchDog时钟使能控制位。CNend 68 * @li Mask the watchdog reset function.CNcomment:屏蔽WatchDog复位功能。CNend 69 * 70 * @attention None 71 * @param None 72 * 73 * @retval None 74 * @par 依赖: 75 * @li hi_watchdog.h:describes the watchdog APIs.CNcomment:文件用于描述看门狗相关接口。CNend 76 * @see None 77 */ 78 hi_void hi_watchdog_disable(hi_void); 79 80 /** 81 * @ingroup iot_watchdog 82 * @brief Set watchod timeout(ms).CNcomment:设置看门狗超时时间,单位ms。CNend 83 * 84 * @par 描述: 85 * @li Set watchod timeout(ms).CNcomment:设置看门狗超时时间,单位ms。CNend 86 * 87 * @attention 88 * timeout should not smaller than 6500ms.CNcomment:看门狗超时时间不得小于6500ms。 89 * system will restart count after set timeout.CNcomment:设置超时时间后,系统会重新开始计数。 90 * @param timeout_ms [IN] type #hi_u32,timeout(ms). CNcomment:超时时间(单位:ms)。CNend 91 * 92 * @retval #HI_ERR_SUCCESS Success. 93 * @retval #Other Failure. For details, see hi_errno.h. 94 * @par 依赖: 95 * @li hi_watchdog.h:describes the watchdog APIs.CNcomment:文件用于描述看门狗相关接口。CNend 96 * @see None 97 */ 98 hi_u32 hi_watchdog_set_timeout(hi_u32 timeout_ms); 99 100 #endif 101