ChibiOS/HAL 9.0.0
hal_wdg.h
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file hal_wdg.h
19 * @brief WDG Driver macros and structures.
20 *
21 * @addtogroup WDG
22 * @{
23 */
24
25#ifndef HAL_WDG_H
26#define HAL_WDG_H
27
28#if (HAL_USE_WDG == TRUE) || defined(__DOXYGEN__)
29
30/*===========================================================================*/
31/* Driver constants. */
32/*===========================================================================*/
33
34/*===========================================================================*/
35/* Driver pre-compile time settings. */
36/*===========================================================================*/
37
38/*===========================================================================*/
39/* Derived constants and error checks. */
40/*===========================================================================*/
41
42/*===========================================================================*/
43/* Driver data structures and types. */
44/*===========================================================================*/
45
46/**
47 * @brief Driver state machine possible states.
48 */
49typedef enum {
50 WDG_UNINIT = 0, /**< Not initialized. */
51 WDG_STOP = 1, /**< Stopped. */
52 WDG_READY = 2 /**< Ready. */
54
55#include "hal_wdg_lld.h"
56
57/*===========================================================================*/
58/* Driver macros. */
59/*===========================================================================*/
60
61/**
62 * @brief Resets WDG's counter.
63 *
64 * @param[in] wdgp pointer to the @p WDGDriver object
65 *
66 * @iclass
67 */
68#define wdgResetI(wdgp) wdg_lld_reset(wdgp)
69
70/*===========================================================================*/
71/* External declarations. */
72/*===========================================================================*/
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77 void wdgInit(void);
78 msg_t wdgStart(WDGDriver *wdgp, const WDGConfig * config);
79 void wdgStop(WDGDriver *wdgp);
80 void wdgReset(WDGDriver *wdgp);
81#ifdef __cplusplus
82}
83#endif
84
85#endif /* HAL_USE_WDG == TRUE */
86
87#endif /* HAL_WDG_H */
88
89/** @} */
int32_t msg_t
Type of a message.
Definition osal.h:159
void wdgReset(WDGDriver *wdgp)
Resets WDG's counter.
Definition hal_wdg.c:130
msg_t wdgStart(WDGDriver *wdgp, const WDGConfig *config)
Configures and activates the WDG peripheral.
Definition hal_wdg.c:70
void wdgInit(void)
WDG Driver initialization.
Definition hal_wdg.c:56
void wdgStop(WDGDriver *wdgp)
Deactivates the WDG peripheral.
Definition hal_wdg.c:107
wdgstate_t
Driver state machine possible states.
Definition hal_wdg.h:49
@ WDG_UNINIT
Definition hal_wdg.h:50
@ WDG_READY
Definition hal_wdg.h:52
@ WDG_STOP
Definition hal_wdg.h:51
WDG Driver subsystem low level driver header template.
Driver configuration structure.
Definition hal_wdg_lld.h:68
Structure representing an WDG driver.
Definition hal_wdg_lld.h:74