Move also cpu/ to bertos/ :-).
[bertos.git] / bertos / cpu / arm / io / at91_wdt.h
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \version $Id$
34  *
35  * \author Francesco Sacchi <batt@develer.com>
36  *
37  * AT91 Watchdog.
38  * This file is based on NUT/OS implementation. See license below.
39  */
40
41
42 /*
43  * Copyright (C) 2005-2006 by egnite Software GmbH. All rights reserved.
44  *
45  * Redistribution and use in source and binary forms, with or without
46  * modification, are permitted provided that the following conditions
47  * are met:
48  *
49  * 1. Redistributions of source code must retain the above copyright
50  *    notice, this list of conditions and the following disclaimer.
51  * 2. Redistributions in binary form must reproduce the above copyright
52  *    notice, this list of conditions and the following disclaimer in the
53  *    documentation and/or other materials provided with the distribution.
54  * 3. Neither the name of the copyright holders nor the names of
55  *    contributors may be used to endorse or promote products derived
56  *    from this software without specific prior written permission.
57  *
58  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
59  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
60  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
61  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
62  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
63  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
64  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
65  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
66  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
67  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
68  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69  * SUCH DAMAGE.
70  *
71  * For additional information see http://www.ethernut.de/
72  */
73
74 #ifndef AT91_WDT_H
75 #define AT91_WDT_H
76
77
78 /** Watch Dog Control Register */
79 /*\{*/
80 #define WDT_CR_OFF          0x00000000  ///< Watchdog control register offset.
81 #define WDT_CR  (*((reg32_t *)(WDT_BASE + WDT_CR_OFF))) ///< Watchdog control register address.
82 #define WDT_WDRSTT                   0  ///< Watchdog restart.
83 #define WDT_KEY             0xA5000000  ///< Watchdog password.
84 /*\}*/
85
86 /** Watch Dog Mode Register */
87 /*\{*/
88 #define WDT_MR_OFF          0x00000004  ///< Mode register offset.
89 #define WDT_MR  (*((reg32_t *)(WDT_BASE + WDT_MR_OFF))) ///< Mode register address.
90 #define WDT_WDV_MASK        0x00000FFF  ///< Counter value mask.
91 #define WDT_WDV_SHIFT                0  ///< Counter value LSB.
92 #define WDT_WDFIEN                  12  ///< Fault interrupt enable.
93 #define WDT_WDRSTEN                 13  ///< Reset enable.
94 #define WDT_WDRPROC                 14  ///< Eset processor enable.
95 #define WDT_WDDIS                   15  ///< Watchdog disable.
96 #define WDT_WDD_MASK        0x0FFF0000  ///< Delta value mask.
97 #define WDT_WDD_SHIFT               16  ///< Delta value LSB.
98 #define WDT_WDDBGHLT                28  ///< Watchdog debug halt.
99 #define WDT_WDIDLEHLT               29  ///< Watchdog idle halt.
100 /*\}*/
101
102 /** Watch Dog Status Register */
103 /*\{*/
104 #define WDT_SR_OFF          0x00000008  ///< Status register offset.
105 #define WDT_SR  (*((reg32_t *)(WDT_BASE + WDT_SR_OFF))) ///< Status register address.
106 #define WDT_WDUNF                    0  ///< Watchdog underflow.
107 #define WDT_WDERR                    1  ///< Watchdog error.
108 /*\}*/
109
110
111 #endif /* AT91_WDT_H */