TI-RTOS for SimpleLink Wireless MCUs  2.14.03.28
Watchdog.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
110 #ifndef ti_drivers_Watchdog__include
111 #define ti_drivers_Watchdog__include
112 
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
116 
117 
118 #include <stdint.h>
119 
131 #define Watchdog_CMD_RESERVED 32
132 
145 #define Watchdog_STATUS_RESERVED -32
146 
153 #define Watchdog_STATUS_SUCCESS 0
154 
161 #define Watchdog_STATUS_ERROR -1
162 
170 #define Watchdog_STATUS_UNDEFINEDCMD -2
171 
176 
185 typedef enum Watchdog_DebugMode {
189 
197 typedef enum Watchdog_ResetMode {
201 
210 typedef void (*Watchdog_Callback)(uintptr_t);
211 
220 typedef struct Watchdog_Params {
227  void *custom;
230 
235 typedef void (*Watchdog_ClearFxn) (Watchdog_Handle handle);
236 
241 typedef void (*Watchdog_CloseFxn) (Watchdog_Handle handle);
242 
247 typedef int (*Watchdog_ControlFxn) (Watchdog_Handle handle,
248  unsigned int cmd,
249  void *arg);
250 
255 typedef void (*Watchdog_InitFxn) (Watchdog_Handle handle);
256 
261 typedef Watchdog_Handle (*Watchdog_OpenFxn) (Watchdog_Handle handle,
262  Watchdog_Params *params);
263 
268 typedef void (*Watchdog_SetReloadFxn) (Watchdog_Handle handle, uint32_t value);
269 
275 typedef struct Watchdog_FxnTable {
283 
295 typedef struct Watchdog_Config {
300 
302  void *object;
303 
305  void const *hwAttrs;
307 
316 extern void Watchdog_clear(Watchdog_Handle handle);
317 
329 extern void Watchdog_close(Watchdog_Handle handle);
330 
350 extern int Watchdog_control(Watchdog_Handle handle,
351  unsigned int cmd,
352  void *arg);
353 
362 extern void Watchdog_init(void);
363 
383 extern Watchdog_Handle Watchdog_open(unsigned int index, Watchdog_Params *params);
384 
396 extern void Watchdog_Params_init(Watchdog_Params *params);
397 
413 extern void Watchdog_setReload(Watchdog_Handle handle, uint32_t value);
414 
415 #ifdef __cplusplus
416 }
417 #endif
418 
419 #endif /* ti_drivers_Watchdog__include */
Watchdog_Handle Watchdog_open(unsigned int index, Watchdog_Params *params)
Opens a Watchdog.
Watchdog_Callback callbackFxn
Definition: Watchdog.h:221
Watchdog_DebugMode debugStallMode
Definition: Watchdog.h:225
void Watchdog_clear(Watchdog_Handle handle)
Clears the Watchdog.
void * custom
Definition: Watchdog.h:227
Watchdog_ControlFxn watchdogControl
Definition: Watchdog.h:278
Watchdog_Handle(* Watchdog_OpenFxn)(Watchdog_Handle handle, Watchdog_Params *params)
A function pointer to a driver specific implementation of Watchdog_open().
Definition: Watchdog.h:261
struct Watchdog_FxnTable Watchdog_FxnTable
The definition of a Watchdog function table that contains the required set of functions to control a ...
Watchdog_ResetMode resetMode
Definition: Watchdog.h:223
Watchdog Parameters.
Definition: Watchdog.h:220
void Watchdog_setReload(Watchdog_Handle handle, uint32_t value)
Sets the Watchdog reload value.
Watchdog_FxnTable const * fxnTablePtr
Definition: Watchdog.h:299
void(* Watchdog_InitFxn)(Watchdog_Handle handle)
A function pointer to a driver specific implementation of Watchdog_init().
Definition: Watchdog.h:255
Definition: Watchdog.h:198
void const * hwAttrs
Definition: Watchdog.h:305
void Watchdog_Params_init(Watchdog_Params *params)
Function to initialize the Watchdog_Params structure to its defaults.
int Watchdog_control(Watchdog_Handle handle, unsigned int cmd, void *arg)
Function performs implementation specific features on a given Watchdog_Handle.
void(* Watchdog_CloseFxn)(Watchdog_Handle handle)
A function pointer to a driver specific implementation of Watchdog_close().
Definition: Watchdog.h:241
Watchdog_DebugMode
Watchdog debug stall settings.
Definition: Watchdog.h:185
void(* Watchdog_SetReloadFxn)(Watchdog_Handle handle, uint32_t value)
A function pointer to a driver specific implementation of Watchdog_setReload().
Definition: Watchdog.h:268
Watchdog_OpenFxn watchdogOpen
Definition: Watchdog.h:280
void * object
Definition: Watchdog.h:302
void Watchdog_close(Watchdog_Handle handle)
Function to close a Watchdog peripheral specified by the Watchdog handle.It stops (holds) the Watchdo...
void Watchdog_init(void)
Initializes the Watchdog module.
void(* Watchdog_ClearFxn)(Watchdog_Handle handle)
A function pointer to a driver specific implementation of Watchdog_clear().
Definition: Watchdog.h:235
void(* Watchdog_Callback)(uintptr_t)
Watchdog callback pointer.
Definition: Watchdog.h:210
Watchdog Global configuration.
Definition: Watchdog.h:295
Watchdog_ClearFxn watchdogClear
Definition: Watchdog.h:276
struct Watchdog_Config Watchdog_Config
Watchdog Global configuration.
Watchdog_SetReloadFxn watchdogSetReload
Definition: Watchdog.h:281
Definition: Watchdog.h:199
The definition of a Watchdog function table that contains the required set of functions to control a ...
Definition: Watchdog.h:275
Watchdog_ResetMode
Watchdog reset mode settings.
Definition: Watchdog.h:197
Definition: Watchdog.h:186
Watchdog_InitFxn watchdogInit
Definition: Watchdog.h:279
int(* Watchdog_ControlFxn)(Watchdog_Handle handle, unsigned int cmd, void *arg)
A function pointer to a driver specific implementation of Watchdog_control().
Definition: Watchdog.h:247
Definition: Watchdog.h:187
struct Watchdog_Params Watchdog_Params
Watchdog Parameters.
Watchdog_CloseFxn watchdogClose
Definition: Watchdog.h:277
struct Watchdog_Config * Watchdog_Handle
Watchdog Handle.
Definition: Watchdog.h:175
Copyright 2015, Texas Instruments Incorporated