ChibiOS/HAL  6.1.0
hal_wdg_lld.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_lld.h
19  * @brief WDG Driver subsystem low level driver header template.
20  *
21  * @addtogroup WDG
22  * @{
23  */
24 
25 #ifndef HAL_WDG_LLD_H
26 #define HAL_WDG_LLD_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  * @name Configuration options
40  * @{
41  */
42 /**
43  * @brief WDG1 driver enable switch.
44  * @note The default is @p FALSE.
45  */
46 #if !defined(PLATFORM_WDG_USE_WDG1) || defined(__DOXYGEN__)
47 #define PLATFORM_WDG_USE_WDG1 FALSE
48 #endif
49 /** @} */
50 
51 /*===========================================================================*/
52 /* Derived constants and error checks. */
53 /*===========================================================================*/
54 
55 /*===========================================================================*/
56 /* Driver data structures and types. */
57 /*===========================================================================*/
58 
59 /**
60  * @brief Type of a structure representing an WDG driver.
61  */
62 typedef struct WDGDriver WDGDriver;
63 
64 /**
65  * @brief Driver configuration structure.
66  * @note It could be empty on some architectures.
67  */
68 typedef struct {
69 } WDGConfig;
70 
71 /**
72  * @brief Structure representing an WDG driver.
73  */
74 struct WDGDriver {
75  /**
76  * @brief Driver state.
77  */
79  /**
80  * @brief Current configuration data.
81  */
82  const WDGConfig *config;
83  /* End of the mandatory fields.*/
84 };
85 
86 /*===========================================================================*/
87 /* Driver macros. */
88 /*===========================================================================*/
89 
90 /*===========================================================================*/
91 /* External declarations. */
92 /*===========================================================================*/
93 
94 #if (PLATFORM_WDG_USE_WDG1 == TRUE) && !defined(__DOXYGEN__)
95 extern WDGDriver WDGD1;
96 #endif
97 
98 #ifdef __cplusplus
99 extern "C" {
100 #endif
101  void wdg_lld_init(void);
102  void wdg_lld_start(WDGDriver *wdgp);
103  void wdg_lld_stop(WDGDriver *wdgp);
104  void wdg_lld_reset(WDGDriver *wdgp);
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif /* HAL_USE_WDG == TRUE */
110 
111 #endif /* HAL_WDG_LLD_H */
112 
113 /** @} */
void wdg_lld_start(WDGDriver *wdgp)
Configures and activates the WDG peripheral.
Definition: hal_wdg_lld.c:73
void wdg_lld_stop(WDGDriver *wdgp)
Deactivates the WDG peripheral.
Definition: hal_wdg_lld.c:85
wdgstate_t state
Driver state.
Definition: hal_wdg_lld.h:78
void wdg_lld_reset(WDGDriver *wdgp)
Reloads WDG's counter.
Definition: hal_wdg_lld.c:97
wdgstate_t
Driver state machine possible states.
Definition: hal_wdg.h:49
const WDGConfig * config
Current configuration data.
Definition: hal_wdg_lld.h:82
Structure representing an WDG driver.
Definition: hal_wdg_lld.h:74
void wdg_lld_init(void)
Low level WDG driver initialization.
Definition: hal_wdg_lld.c:62
Driver configuration structure.
Definition: hal_wdg_lld.h:68