You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
6.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2008-2019. All rights reserved.
* Description: Application programming interfaces (APIs) of WDG.
*/
#ifndef __UAPI_WDG_H__
#define __UAPI_WDG_H__
#include "td_type.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
/* ****************************** API Declaration **************************** */
/* * \addtogroup WDG */
/* * @{ */ /* * <!-- [WDG] */
/*
* \brief Starts the WDG device.
* CNcomment:\brief 初始化WDGWatch Dog设备。CNend
* \attention \n
* By default, the WDG device is disabled after it is started. In this case,
* you need to call uapi_wdg_enable to enable it.\n
* CNcomment:打开之后WDG默认是禁止的需要显式调用UAPI_WDG_Enable使能WDG设备。CNend\N
* \param N/A CNcomment:无。CNend
* \retval 0 Success. CNcomment:成功。CNend
* \retval ::SOC_ERR_WDG_FAILED_INIT open failed
* \see \n
* N/A
*/
td_s32 uapi_wdg_init(td_void);
/*
* \brief Stops the WDG device.
* CNcomment:\brief 去初始化WDG设备。CNend
* \attention \n
* N/A
* \param N/A CNcomment:无。CNend
* \retval 0 Success. CNcomment:成功。CNend
* \see \n
* N/A
*/
td_s32 uapi_wdg_deinit(td_void);
/*
* \brief Get the number of WDG device.
* CNcomment:\brief 获取WDG设备数量。CNend
* \attention \n
* You can call this API to get thenumber of WDG chipset supports after the WDG device is started.
* CNcomment:打开WDG设备后调用此接口获取芯片支持的WDG的数量。CNend
* \param[out] wdg_num The number of WDG chipset supports CNcomment:芯片支持的WDG的数量。CNend
* \retval 0 Success CNcomment:成功 CNend
* \retval ::TD_FAILURE The Parameter pu32WdgNum is NULL. CNcomment:参数指针pu32WdgNum为空。CNend
* \see \n
* N/A
*/
td_s32 uapi_wdg_get_num(td_u32 *wdg_num);
/*
* \brief Enables the WDG device.
* CNcomment:\brief 使能WDG设备。CNend
* \attention \n
* You must call uapi_wdg_enable after the WDG device is started.
* CNcomment:打开WDG设备后必须显式调用使能接口。CNend
* \param[in] wdg_id WDG No. to operate. CNcomment:执行操作的WDG号。CNend
* \retval 0 Success. CNcomment:成功。CNend
* \retval ::SOC_ERR_WDG_NOT_INIT The WDG device is not initialized. CNcomment:WDG设备未初始化。CNend
* \retval ::SOC_ERR_WDG_INVALID_PARA The Paramteter is invalid. CNcomment:参数无效。CNend
* \retval ::SOC_ERR_WDG_FAILED_ENABLE enable watchdog failed. CNcomment:使能看门狗失败。CNend
* \see \n
* N/A
*/
td_s32 uapi_wdg_enable(td_u32 wdg_id);
/*
* \brief Disables the WDG device.
* CNcomment:\brief 禁止WDG设备。CNend
* \attention \n
* After calling this API, you cannot feed and reset the WDG.
* CNcomment:调用此函数后喂狗和复位操作不起作用。CNend
* \param[in] wdg_id WDG No. to operate. CNcomment:执行操作的WDG号。CNend
* \retval 0 Success. CNcomment:成功。CNend
* \retval ::SOC_ERR_WDG_NOT_INIT The WDG device is not initialized. CNcomment:WDG设备未初始化。CNend
* \retval ::SOC_ERR_WDG_INVALID_PARA The Paramteter is invalid. CNcomment:参数无效。CNend
* \retval ::SOC_ERR_WDG_FAILED_DISABLE disable watchdog failed. CNcomment:禁止看门狗失败。CNend
* \see \n
* N/A
*/
td_s32 uapi_wdg_disable(td_u32 wdg_id);
/*
* \brief Obtains the interval of feeding the WDG.
* CNcomment:\brief 获取喂狗时间间隔。CNend
* \attention \n
* The interval precision is as high as 1000 ms.
* CNcomment:时间间隔精确到1000ms。CNend
* \param[in] wdg_id WDG No. to operate. CNcomment:执行操作的WDG号。CNend
* \param[in] value Interval of feeding the WDG, in ms. CNcomment:喂狗时间间隔单位为ms。CNend
* \retval 0 Success. CNcomment:成功。CNend
* \retval ::SOC_ERR_WDG_NOT_INIT The WDG device is not initialized. CNcomment:WDG 设备未初始化。CNend
* \retval ::SOC_ERR_WDG_INVALID_PARA The WDG input pointer is invalid. CNcomment:WDG输入指针无效。CNend
* \retval ::SOC_ERR_WDG_FAILED_SETTIMEOUT get timeout failed. CNcomment:WDG获取超时时间失败。CNend
* \see \n
* N/A
*/
td_s32 uapi_wdg_get_timeout(td_u32 wdg_id, td_u32 *value);
/*
* \brief Sets the interval of feeding the WDG.
* CNcomment:\brief 设置喂狗时间间隔。CNend
* \attention \n
* N/A
* \param[in] wdg_id WDG No. to operate. CNcomment:执行操作的WDG号。CNend
* \param[out] value Interval of feeding the WDG, in ms. CNcomment:喂狗时间间隔单位为ms。CNend
* \retval 0 Success. CNcomment:成功。CNend
* \retval ::SOC_ERR_WDG_NOT_INIT The WDG device is not initialized. CNcomment:WDG设备未初始化。CNend
* \retval ::SOC_ERR_WDG_FAILED_SETTIMEOUT The WDG set timeout failed. CNcomment:WDG设置超时时间失败。CNend
* \retval ::SOC_ERR_WDG_INVALID_PARA The WDG input parameter is invalid. CNcomment:WDG输入参数无效。CNend
* \see \n
* N/A
*/
td_s32 uapi_wdg_set_timeout(td_u32 wdg_id, td_u32 value);
/*
* \brief Feeds the WDG.
* CNcomment:\brief 执行喂狗操作。CNend
* \attention \n
* N/A
* \param[in] wdg_id WDG No. to operate. CNcomment:执行操作的WDG号。CNend
* \retval 0 Success. CNcomment:成功。CNend
* \retval ::SOC_ERR_WDG_NOT_INIT The WDG device is not initialized. CNcomment:WDG设备未初始化。CNend
* \retval ::SOC_ERR_WDG_FAILED_CLEARWDG The WDG clear watchdog failed. CNcomment:WDG 喂狗失败。CNend
* \retval ::SOC_ERR_WDG_INVALID_PARA The Paramteter is invalid. CNcomment:参数无效。CNend
* \see \n
* N/A
*/
td_s32 uapi_wdg_clear(td_u32 wdg_id);
/*
* \brief Resets the entire system.
* CNcomment:\brief 用于复位整个系统。CNend
* \attention \n
* N/A
* \param[in] wdg_id WDG No. to operate. CNcomment:执行操作的WDG号。CNend
* \retval 0 Success. CNcomment:成功。CNend
* \retval ::SOC_ERR_WDG_NOT_INIT The WDG device is not initialized. CNcomment:WDG设备未初始化。CNend
* \retval ::SOC_ERR_WDG_FAILED_RESET The WDG reset failed. CNcomment:WDG复位失败。CNend
* \retval ::SOC_ERR_WDG_INVALID_PARA The Paramteter is invalid. CNcomment:参数无效。CNend
* \see \n
* N/A
*/
td_s32 uapi_wdg_reset(td_u32 wdg_id);
/* * @} */ /* * <!-- ==== API Declaration End ==== */
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* __UAPI_WDG_H__ */