KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
watchdog.h
Go to the documentation of this file.
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2012-2016 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : watchdog.h
11  * Created : 12 aug. 2016
12  * Author : Vincent van Beveren
13  */
14 #ifndef DRV_WB_WATCHDOG_H_
15 #define DRV_WB_WATCHDOG_H_
16 
17 #include <stdint.h>
18 
19 #include "lm32soc/dev_soc.h"
20 
21 /**
22  * @file
23  *
24  * @ingroup wbdrivers
25  *
26  * Watchdog driver.
27  */
28 
29 /**
30  * Feed the watchdog.
31  */
32 static inline void wdogFeed()
33 {
35 }
36 
37 /**
38  * Reboot the FPGA (hard)
39  */
40 static inline void wdogReboot()
41 {
43 }
44 
45 /**
46  * Set the watchdog top-counter in seconds.
47  *
48  * @param counterValue The counter value to set.
49  */
50 static inline void wdogSetTopCount(uint16_t counterValue)
51 {
52  WATCHDOG->CNT = counterValue;
53  wdogFeed(); // apply new top value to current count-down.
54 }
55 
56 
57 #endif /* DRV_WB_WATCHDOG_H_ */
58 
#define WATCHDOG_CMD_FEED
Feed the dog.
Definition: dev_watchdog.h:32
static void wdogSetTopCount(uint16_t counterValue)
Set the watchdog top-counter in seconds.
Definition: watchdog.h:50
static void wdogReboot()
Reboot the FPGA (hard)
Definition: watchdog.h:40
#define WATCHDOG
Watchdog device.
Definition: dev_soc.h:81
#define WATCHDOG_CMD_REBOOT
Reboot now.
Definition: dev_watchdog.h:31
This file assigns all device structures to memory mapped structures.
static void wdogFeed()
Feed the watchdog.
Definition: watchdog.h:32