MCUSW
Loading...
Searching...
No Matches
Wdg.h
Go to the documentation of this file.
1/*
2*
3* Copyright (c) 2024 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
119/*
120 * Below are the global design requirements which are met by this WDG
121 * which can't be mapped to a particular source ID
122 */
123/*
124 * Design: MCAL-5599,MCAL-5558,MCAL-5603,MCAL-5559,MCAL-5560,MCAL-5568,MCAL-5564,MCAL-5547
125 */
126
127#ifndef WDG_H_
128#define WDG_H_
129
130/* ========================================================================== */
131/* Include Files */
132/* ========================================================================== */
133
134/*
135 * Design: MCAL-5557
136 */
137#include "WdgIf_Types.h"
138/*
139 * Design: MCAL-5573
140 */
141#include "Wdg_Cfg.h"
142#ifdef __cplusplus
143extern "C"
144{
145#endif
146
147/* ========================================================================== */
148/* Macros & Typedefs */
149/* ========================================================================== */
150
158#define WDG_SW_MAJOR_VERSION (9U)
160#define WDG_SW_MINOR_VERSION (1U)
162#define WDG_SW_PATCH_VERSION (0U)
163/* @} */
164
172#define WDG_AR_RELEASE_MAJOR_VERSION (4U)
174#define WDG_AR_RELEASE_MINOR_VERSION (3U)
176#define WDG_AR_RELEASE_REVISION_VERSION (1U)
177/* @} */
178
184#define WDG_VENDOR_ID ((uint16) 44U)
186#define WDG_MODULE_ID ((uint16) 102U)
188#define WDG_INSTANCE_ID ((uint8) 0U)
189/* @} */
190
191/*
192 * Design: MCAL-5591
193 */
201#define WDG_E_DRIVER_STATE ((uint8) 0x10U)
203#define WDG_E_PARAM_MODE ((uint8) 0x11U)
205#define WDG_E_PARAM_CONFIG ((uint8) 0x12U)
207#define WDG_E_PARAM_TIMEOUT ((uint8) 0x13U)
209#define WDG_E_PARAM_POINTER ((uint8) 0x14U)
211#define WDG_E_INIT_FAILED ((uint8) 0x15U)
212/* @} */
213
214/*
215 * Design: MCAL-5604
216 */
225#define WDG_API_INIT ((uint8) 0x00U)
227#define WDG_API_SET_MODE ((uint8) 0x01U)
229#define WDG_SET_TRIGGER_CONDITION ((uint8) 0x03U)
231#define WDG_API_GET_VERSION_INFO ((uint8) 0x04U)
233#define WDG_API_TRIGGER ((uint8) 0x05U)
235#define WDG_API_REGISTER_READBACK ((uint8) 0x06U)
236/* @} */
237
245#define WDG_WINDOW_100_PERCENT ((uint32) 0x00000005U)
247#define WDG_WINDOW_50_PERCENT ((uint32) 0x00000050U)
249#define WDG_WINDOW_25_PERCENT ((uint32) 0x00000500U)
251#define WDG_WINDOW_12P5_PERCENT ((uint32) 0x00005000U)
253#define WDG_WINDOW_6P25_PERCENT ((uint32) 0x00050000U)
255#define WDG_WINDOW_3P125_PERCENT ((uint32) 0x00500000U)
256/* @} */
257
259#define INIT_VAL_ZERO (0U)
260
261/* ========================================================================== */
262/* Structures and Enums */
263/* ========================================================================== */
276typedef enum
277{
281 WDG_IDLE,
288
290typedef struct
291{
292 uint32 reaction;
307
308/*
309 * Design: MCAL-5587
310 */
312typedef struct Wdg_ConfigType_s
313{
314 WdgIf_ModeType defaultMode;
321
322/*
323 * Design: MCAL-5609,MCAL-5556
324 */
326typedef struct Wdg_ConfigType_PC_s
327{
334
335#if (STD_ON == WDG_REGISTER_READBACK_API)
336typedef struct
337{
344 uint32 rtiWdKey;
351#endif /* STD_ON == WDG_REGISTER_READBACK_API */
352
353/* @} */
354
355/* ========================================================================== */
356/* Function Declarations */
357/* ========================================================================== */
358
359#if (STD_ON == WDG_GET_VERSION_INFO_API)
380FUNC(void, WDG_CODE) Wdg_GetVersionInfo(Std_VersionInfoType * versioninfo);
381#endif
382
400FUNC(void, WDG_CODE) Wdg_Init(
401 P2CONST(Wdg_ConfigType, AUTOMATIC, WDG_APPL_CONST) CfgPtr);
420FUNC(void, WDG_CODE) Wdg_SetTriggerCondition(uint16 timeout);
439FUNC(void, WDG_CODE) Wdg_Trigger(void);
459FUNC(Std_ReturnType, WDG_CODE) Wdg_SetMode(WdgIf_ModeType Mode);
460#if (STD_ON == WDG_REGISTER_READBACK_API)
487FUNC(Std_ReturnType, WDG_CODE) Wdg_RegisterReadback
488 (P2VAR(Wdg_RegisterReadbackType, AUTOMATIC,
489 WDG_APPL_DATA) regRbPtr);
490#endif
491#ifdef __cplusplus
492}
493#endif
494
495#endif /* #ifndef WDG_H_ */
496
497/* @} */
This file contains generated pre compile configuration file for WDG MCAL driver.
void Wdg_Trigger(void)
This function triggers the servicing of the watchdog.
Wdg_StatusType
Watchdog driver state.
Definition Wdg.h:277
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.
void Wdg_SetTriggerCondition(uint16 timeout)
Sets the timeout value for the trigger counter.
Std_ReturnType Wdg_RegisterReadback(Wdg_RegisterReadbackType *regRbPtr)
This function reads the important registers of the hardware unit and returns the value in the structu...
Std_ReturnType Wdg_SetMode(WdgIf_ModeType Mode)
This function triggers the servicing of the watchdog.
uint32 reaction
Definition Wdg.h:292
uint16 instanceId
Definition Wdg.h:328
uint32 rtiWdKey
Definition Wdg.h:344
uint32 rtiWdStatus
Definition Wdg.h:342
Wdg_ModeInfoType fastModeCfg
Definition Wdg.h:316
uint32 rtiDwdCtrl
Definition Wdg.h:338
WdgIf_ModeType defaultMode
Definition Wdg.h:314
uint32 rtiDwdprld
Definition Wdg.h:340
uint32 initialTimeOut
Definition Wdg.h:330
Wdg_ModeInfoType slowModeCfg
Definition Wdg.h:318
uint32 timeOutVal
Definition Wdg.h:304
uint32 rtiWwdSizeCtrl
Definition Wdg.h:348
uint32 rtiWwdRxnCtrl
Definition Wdg.h:346
uint32 windowSize
Definition Wdg.h:301
@ WDG_UNINIT
Definition Wdg.h:278
@ WDG_IDLE
Definition Wdg.h:281
@ WDG_BUSY
Definition Wdg.h:284
WDG pre-compile config structure.
Definition Wdg.h:327
WDG config structure.
Definition Wdg.h:313
Mode info type.
Definition Wdg.h:291
Definition Wdg.h:337