ChibiOS/HAL  6.1.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  */
49 typedef enum {
50  WDG_UNINIT = 0, /**< Not initialized. */
51  WDG_STOP = 1, /**< Stopped. */
52  WDG_READY = 2 /**< Ready. */
53 } wdgstate_t;
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
75 extern "C" {
76 #endif
77  void wdgInit(void);
78  void 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 /** @} */
wdgstate_t
Driver state machine possible states.
Definition: hal_wdg.h:49
void wdgStop(WDGDriver *wdgp)
Deactivates the WDG peripheral.
Definition: hal_wdg.c:89
void wdgInit(void)
WDG Driver initialization.
Definition: hal_wdg.c:56
WDG Driver subsystem low level driver header template.
Structure representing an WDG driver.
Definition: hal_wdg_lld.h:74
void wdgStart(WDGDriver *wdgp, const WDGConfig *config)
Configures and activates the WDG peripheral.
Definition: hal_wdg.c:69
void wdgReset(WDGDriver *wdgp)
Resets WDG&#39;s counter.
Definition: hal_wdg.c:112
Driver configuration structure.
Definition: hal_wdg_lld.h:68