summaryrefslogtreecommitdiff
path: root/cesar/hal/leon/watchdog.h
blob: 5c8ec347de45641e6e59b80b40607b98f0bcc89e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef hal_leon_watchdog_h
#define hal_leon_watchdog_h
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    hal/leon/watchdog.h
 * \brief   Leon watchdog support.
 * \ingroup hal_leon
 */

/** Watchdog base address. */
#define LEON_WATCHDOG_BASE 0x8000004c

/** Watchdog counter register. */
#define LEON_WATCHDOG_COUNTER (* (volatile u32 *) (LEON_WATCHDOG_BASE + 0x00))

/** Watchdog counter reset value, about 2 sec. */
#define LEON_WATCHDOG_RESET_VALUE (2 * 1024 * 1024)

extern inline void
leon_watchdog_reset (void)
{
    LEON_WATCHDOG_COUNTER = LEON_WATCHDOG_RESET_VALUE;
}

#endif /* hal_leon_watchdog_h */