MCUSW
Wdg.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright (c) 2019 Texas Instruments Incorporated
4 *
5 * All rights reserved not granted herein.
6 *
7 * Limited License.
8 *
9 * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
10 * license under copyrights and patents it now or hereafter owns or controls to make,
11 * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
12 * terms herein. With respect to the foregoing patent license, such license is granted
13 * solely to the extent that any such patent is necessary to Utilize the software alone.
14 * The patent license shall not apply to any combinations which include this software,
15 * other than combinations with devices manufactured by or for TI ("TI Devices").
16 * No hardware patent is licensed hereunder.
17 *
18 * Redistributions must preserve existing copyright notices and reproduce this license
19 * (including the above copyright notice and the disclaimer and (if applicable) source
20 * code license limitations below) in the documentation and/or other materials provided
21 * with the distribution
22 *
23 * Redistribution and use in binary form, without modification, are permitted provided
24 * that the following conditions are met:
25 *
26 * * No reverse engineering, decompilation, or disassembly of this software is
27 * permitted with respect to any software provided in binary form.
28 *
29 * * any redistribution and use are licensed by TI for use only with TI Devices.
30 *
31 * * Nothing shall obligate TI to provide you with source code for the software
32 * licensed and provided to you in object code.
33 *
34 * If software source code is provided to you, modification and redistribution of the
35 * source code are permitted provided that the following conditions are met:
36 *
37 * * any redistribution and use of the source code, including any resulting derivative
38 * works, are licensed by TI for use only with TI Devices.
39 *
40 * * any redistribution and use of any object code compiled from the source code
41 * and any resulting derivative works, are licensed by TI for use only with TI Devices.
42 *
43 * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
44 *
45 * may be used to endorse or promote products derived from this software without
46 * specific prior written permission.
47 *
48 * DISCLAIMER.
49 *
50 * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
51 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53 * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
54 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
55 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
57 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
58 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
59 * OF THE POSSIBILITY OF SUCH DAMAGE.
60 *
61 */
62 
118 /* Design : DES_WDG_001, DES_WDG_006, DES_WDG_009, DES_WDG_010, DES_WDG_020
119  *
120  */
121 /*
122  * Below are the global requirements which are met by this WDG
123  * which can't be mapped to a particular source ID
124  */
125 /*
126  * Requirements : MCAL-2571, MCAL-2572, MCAL-2573, MCAL-2567,
127  * MCAL-2574, MCAL-2575, MCAL-2630, MCAL-2645,
128  * MCAL-2646, MCAL-981
129  */
130 
131 #ifndef WDG_H_
132 #define WDG_H_
133 
134 /* ========================================================================== */
135 /* Include Files */
136 /* ========================================================================== */
137 
138 /* Requirements : MCAL-2601 */
139 /* Design : DES_WDG_003 */
140 #include "WdgIf_Types.h"
141 /* Requirements:MCAL-2569 */
142 #include "Wdg_Cfg.h"
143 
144 #ifdef __cplusplus
145 extern "C"
146 {
147 #endif
148 
149 /* ========================================================================== */
150 /* Macros & Typedefs */
151 /* ========================================================================== */
152 
160 #define WDG_SW_MAJOR_VERSION (1U)
161 
162 #define WDG_SW_MINOR_VERSION (3U)
163 
164 #define WDG_SW_PATCH_VERSION (4U)
165 /* @} */
166 
174 #define WDG_AR_RELEASE_MAJOR_VERSION (4U)
175 
176 #define WDG_AR_RELEASE_MINOR_VERSION (3U)
177 
178 #define WDG_AR_RELEASE_REVISION_VERSION (1U)
179 /* @} */
180 
186 #define WDG_VENDOR_ID ((uint16) 44U)
187 
188 #define WDG_MODULE_ID ((uint16) 102U)
189 
190 #define WDG_INSTANCE_ID ((uint8) 0U)
191 /* @} */
192 
193 /* Design : DES_WDG_008 */
194 /* Requirements : MCAL-2576 */
202 #define WDG_E_DRIVER_STATE ((uint8) 0x10U)
203 
204 #define WDG_E_PARAM_MODE ((uint8) 0x11U)
205 
206 #define WDG_E_PARAM_CONFIG ((uint8) 0x12U)
207 
208 #define WDG_E_PARAM_TIMEOUT ((uint8) 0x13U)
209 
210 #define WDG_E_PARAM_POINTER ((uint8) 0x14U)
211 
212 #define WDG_E_INIT_FAILED ((uint8) 0x15U)
213 /* @} */
214 
215 /* Requirements : MCAL-2647 */
224 #define WDG_API_INIT ((uint8) 0x00U)
225 
226 #define WDG_API_SET_MODE ((uint8) 0x01U)
227 
228 #define WDG_SET_TRIGGER_CONDITION ((uint8) 0x03U)
229 
230 #define WDG_API_GET_VERSION_INFO ((uint8) 0x04U)
231 
232 #define WDG_API_TRIGGER ((uint8) 0x05U)
233 
234 #define WDG_API_REGISTER_READBACK ((uint8) 0x06U)
235 /* @} */
236 
244 #define WDG_WINDOW_100_PERCENT ((uint32) 0x00000005U)
245 
246 #define WDG_WINDOW_50_PERCENT ((uint32) 0x00000050U)
247 
248 #define WDG_WINDOW_25_PERCENT ((uint32) 0x00000500U)
249 
250 #define WDG_WINDOW_12P5_PERCENT ((uint32) 0x00005000U)
251 
252 #define WDG_WINDOW_6P25_PERCENT ((uint32) 0x00050000U)
253 
254 #define WDG_WINDOW_3P125_PERCENT ((uint32) 0x00500000U)
255 /* @} */
256 
257 /* ========================================================================== */
258 /* Structures and Enums */
259 /* ========================================================================== */
272 typedef enum
273 {
284 
285 /* Design : DES_WDG_011 */
287 typedef struct
288 {
289  uint32 reaction;
298  uint32 windowSize;
301  uint32 timeOutVal;
304 
305 /* Design : DES_WDG_012 */
306 /* Requirements : MCAL-2602 */
308 typedef struct Wdg_ConfigType_s
309 {
310  WdgIf_ModeType defaultMode;
317 
318 /* Design : DES_WDG_013 */
319 /* Requirements : MCAL-2639, MCAL-2552 */
321 typedef struct Wdg_ConfigType_PC_s
322 {
323  uint16 instanceId;
329 
330 #if (STD_ON == WDG_REGISTER_READBACK_API)
331 typedef struct
332 {
333  uint32 rtiDwdCtrl;
335  uint32 rtiDwdprld;
337  uint32 rtiWdStatus;
339  uint32 rtiWdKey;
346 #endif /* STD_ON == WDG_REGISTER_READBACK_API */
347 
348 /* @} */
349 
350 /* ========================================================================== */
351 /* Function Declarations */
352 /* ========================================================================== */
353 
354 #if (STD_ON == WDG_GET_VERSION_INFO_API)
355 
375 FUNC(void, WDG_CODE) Wdg_GetVersionInfo(Std_VersionInfoType * versioninfo);
376 #endif
377 
395 FUNC(void, WDG_CODE) Wdg_Init(
396  P2CONST(Wdg_ConfigType, AUTOMATIC, WDG_APPL_CONST) CfgPtr);
415 FUNC(void, WDG_CODE) Wdg_SetTriggerCondition(uint16 timeout);
434 FUNC(void, WDG_CODE) Wdg_Trigger(void);
454 FUNC(Std_ReturnType, WDG_CODE) Wdg_SetMode(WdgIf_ModeType Mode);
455 #if (STD_ON == WDG_REGISTER_READBACK_API)
456 
482 FUNC(Std_ReturnType, WDG_CODE) Wdg_RegisterReadback
483  (P2VAR(Wdg_RegisterReadbackType, AUTOMATIC,
484  WDG_APPL_DATA) regRbPtr);
485 #endif
486 #ifdef __cplusplus
487 }
488 #endif
489 
490 #endif /* #ifndef WDG_H_ */
491 
492 /* @} */
uint32 windowSize
Definition: Wdg.h:298
uint32 rtiWdStatus
Definition: Wdg.h:337
Std_ReturnType Wdg_RegisterReadback(Wdg_RegisterReadbackType *regRbPtr)
This function reads the important registers of the hardware unit and returns the value in the structu...
void Wdg_SetTriggerCondition(uint16 timeout)
Sets the timeout value for the trigger counter.
WDG config structure.
Definition: Wdg.h:308
WDG pre-compile config structure.
Definition: Wdg.h:321
void Wdg_Init(const Wdg_ConfigType *CfgPtr)
This service initializes the WDG driver.
void Wdg_GetVersionInfo(Std_VersionInfoType *versioninfo)
This service returns the version information of this module.
uint32 reaction
Definition: Wdg.h:289
uint16 instanceId
Definition: Wdg.h:323
uint32 timeOutVal
Definition: Wdg.h:301
Definition: Wdg.h:280
Std_ReturnType Wdg_SetMode(WdgIf_ModeType Mode)
This function triggers the servicing of the watchdog.
Mode info type.
Definition: Wdg.h:287
uint32 initialTimeOut
Definition: Wdg.h:325
uint32 rtiWwdSizeCtrl
Definition: Wdg.h:343
Wdg_ModeInfoType fastModeCfg
Definition: Wdg.h:312
Definition: Wdg.h:331
WdgIf_ModeType defaultMode
Definition: Wdg.h:310
void Wdg_Trigger(void)
This function triggers the servicing of the watchdog.
Definition: Wdg.h:274
uint32 rtiDwdprld
Definition: Wdg.h:335
This file contains generated pre compile configuration file for WDG MCAL driver.
Wdg_StatusType
Watchdog driver state.
Definition: Wdg.h:272
Wdg_ModeInfoType slowModeCfg
Definition: Wdg.h:314
uint32 rtiDwdCtrl
Definition: Wdg.h:333
Definition: Wdg.h:277
uint32 rtiWdKey
Definition: Wdg.h:339
uint32 rtiWwdRxnCtrl
Definition: Wdg.h:341