RT-Thread RTOS
1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
dev_watchdog.h
浏览该文件的文档.
1
/*
2
* COPYRIGHT (C) 2011-2023, Real-Thread Information Technology Ltd
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*
6
* Change Logs:
7
* Date Author Notes
8
* 2012-09-12 heyuanjie87 first version.
9
*/
10
11
#ifndef __DEV_WATCHDOG_H__
12
#define __DEV_WATCHDOG_H__
13
14
#include <
rtthread.h
>
15
16
#define RT_DEVICE_CTRL_WDT_GET_TIMEOUT (RT_DEVICE_CTRL_BASE(WDT) + 1)
/* get timeout(in seconds) */
17
#define RT_DEVICE_CTRL_WDT_SET_TIMEOUT (RT_DEVICE_CTRL_BASE(WDT) + 2)
/* set timeout(in seconds) */
18
#define RT_DEVICE_CTRL_WDT_GET_TIMELEFT (RT_DEVICE_CTRL_BASE(WDT) + 3)
/* get the left time before reboot(in seconds) */
19
#define RT_DEVICE_CTRL_WDT_KEEPALIVE (RT_DEVICE_CTRL_BASE(WDT) + 4)
/* refresh watchdog */
20
#define RT_DEVICE_CTRL_WDT_START (RT_DEVICE_CTRL_BASE(WDT) + 5)
/* start watchdog */
21
#define RT_DEVICE_CTRL_WDT_STOP (RT_DEVICE_CTRL_BASE(WDT) + 6)
/* stop watchdog */
22
23
struct
rt_watchdog_ops
;
24
struct
rt_watchdog_device
25
{
26
struct
rt_device
parent
;
27
const
struct
rt_watchdog_ops
*
ops
;
28
};
29
typedef
struct
rt_watchdog_device
rt_watchdog_t
;
30
31
struct
rt_watchdog_ops
32
{
33
rt_err_t
(*
init
)(
rt_watchdog_t
*wdt);
34
rt_err_t
(*
control
)(
rt_watchdog_t
*wdt,
int
cmd,
void
*arg);
35
};
36
37
rt_err_t
rt_hw_watchdog_register
(
rt_watchdog_t
*wdt,
38
const
char
*name,
39
rt_uint32_t
flag,
40
void
*data);
41
42
#endif
/* __DEV_WATCHDOG_H__ */
rt_watchdog_t
struct rt_watchdog_device rt_watchdog_t
定义
dev_watchdog.h:29
rt_hw_watchdog_register
rt_err_t rt_hw_watchdog_register(rt_watchdog_t *wdt, const char *name, rt_uint32_t flag, void *data)
rtthread.h
rt_err_t
rt_base_t rt_err_t
定义
rttypes.h:84
rt_uint32_t
unsigned int rt_uint32_t
定义
rttypes.h:53
rt_device
定义
rtdef.h:1370
rt_watchdog_device
定义
dev_watchdog.h:25
rt_watchdog_device::parent
struct rt_device parent
定义
dev_watchdog.h:26
rt_watchdog_device::ops
const struct rt_watchdog_ops * ops
定义
dev_watchdog.h:27
rt_watchdog_ops
定义
dev_watchdog.h:32
rt_watchdog_ops::init
rt_err_t(* init)(rt_watchdog_t *wdt)
定义
dev_watchdog.h:33
rt_watchdog_ops::control
rt_err_t(* control)(rt_watchdog_t *wdt, int cmd, void *arg)
定义
dev_watchdog.h:34
components
drivers
include
drivers
dev_watchdog.h
制作者
1.13.1