libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
wdog_common.h
Go to the documentation of this file.
1
/** @addtogroup wdog_defines
2
*/
3
/*
4
* This file is part of the libopencm3 project.
5
*
6
* Copyright (C) 2015 Kuldeep Singh Dhaka <kuldeepdhaka9@gmail.com>
7
*
8
* This library is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
12
*
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with this library. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#pragma once
23
24
#include <
libopencm3/efm32/memorymap.h
>
25
#include <
libopencm3/cm3/common.h
>
26
27
/**@{*/
28
29
#define WDOG_CTRL MMIO32(WDOG_BASE + 0x000)
30
#define WDOG_CMD MMIO32(WDOG_BASE + 0x004)
31
#define WDOG_SYNCBUSY MMIO32(WDOG_BASE + 0x008)
32
33
/* WDOG_CTRL */
34
#define WDOG_CTRL_CLKSEL_SHIFT (12)
35
#define WDOG_CTRL_CLKSEL_MASK (0x3 << WDOG_CTRL_CLKSEL_SHIFT)
36
#define WDOG_CTRL_CLKSEL(v) \
37
(((v) << WDOG_CTRL_CLKSEL_SHIFT) & WDOG_CTRL_CLKSEL_MASK)
38
#define WDOG_CTRL_CLKSEL_ULFRCO 0
39
#define WDOG_CTRL_CLKSEL_LFRCO 1
40
#define WDOG_CTRL_CLKSEL_LFXO 2
41
42
#define WDOG_CTRL_PERSEL_SHIFT (8)
43
#define WDOG_CTRL_PERSEL_MASK (0xF << WDOG_CTRL_PERSEL_SHIFT)
44
#define WDOG_CTRL_PERSEL(v) \
45
(((v) << WDOG_CTRL_PERSEL_SHIFT) & WDOG_CTRL_PERSEL_MASK)
46
#define WDOG_CTRL_PERSEL_9CYCLES 0
47
#define WDOG_CTRL_PERSEL_17CYCLES 1
48
#define WDOG_CTRL_PERSEL_33CYCLES 2
49
#define WDOG_CTRL_PERSEL_65CYCLES 3
50
#define WDOG_CTRL_PERSEL_129CYCLES 4
51
#define WDOG_CTRL_PERSEL_257CYCLES 5
52
#define WDOG_CTRL_PERSEL_513CYCLES 6
53
#define WDOG_CTRL_PERSEL_1KCYCLES 7
54
#define WDOG_CTRL_PERSEL_2KCYCLES 8
55
#define WDOG_CTRL_PERSEL_4KCYCLES 9
56
#define WDOG_CTRL_PERSEL_8KCYCLES 10
57
#define WDOG_CTRL_PERSEL_16KCYCLES 11
58
#define WDOG_CTRL_PERSEL_32KCYCLES 12
59
#define WDOG_CTRL_PERSEL_64KCYCLES 13
60
#define WDOG_CTRL_PERSEL_128KCYCLES 14
61
#define WDOG_CTRL_PERSEL_256KCYCLES 15
62
63
#define WDOG_CTRL_SWOSCBLOCK (1 << 6)
64
#define WDOG_CTRL_EM4BLOCK (1 << 5)
65
#define WDOG_CTRL_LOCK (1 << 4)
66
#define WDOG_CTRL_EM3RUN (1 << 3)
67
#define WDOG_CTRL_EM2RUN (1 << 2)
68
#define WDOG_CTRL_DEBUGRUN (1 << 1)
69
#define WDOG_CTRL_EN (1 << 0)
70
71
/* WDOG_CMD */
72
#define WDOG_CMD_CLEAR (1 << 0)
73
74
/* WDOG_SYNCBUSY */
75
#define WDOG_SYNCBUSY_CMD (1 << 1)
76
#define WDOG_SYNCBUSY_CTRL (1 << 0)
77
78
/**@}*/
common.h
memorymap.h
Dispatcher for the base address definitions, depending on the particular Gecko family.
include
libopencm3
efm32
common
wdog_common.h
Generated on Tue Mar 7 2023 16:12:44 for libopencm3 by
1.9.4