4 * This file is part of BeRTOS.
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.
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.
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
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.
29 * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
33 * \brief Atmel SAM3 system controller registers.
39 /** Supply controller base */
41 #define SUPC_BASE 0x400E1A10
43 #define SUPC_BASE 0x400E1410
47 * Supply controller offsets.
50 #define SUPC_CR_OFF 0x0 ///< Supply Controller Control
51 #define SUPC_SMMR_OFF 0x4 ///< Supply Controller Supply Monitor Mode
52 #define SUPC_MR_OFF 0x8 ///< Supply Controller Mode
53 #define SUPC_WUMR_OFF 0xC ///< Supply Controller Wake Up Mode
54 #define SUPC_WUIR_OFF 0x10 ///< Supply Controller Wake Up Inputs
55 #define SUPC_SR_OFF 0x14 ///< Supply Controller Status
59 * Supply controller registers.
62 #define SUPC_CR (*((reg32_t *)(SUPC_BASE + SUPC_CR_OFF ))) ///< Supply Controller Control
63 #define SUPC_SMMR (*((reg32_t *)(SUPC_BASE + SUPC_SMMR_OFF))) ///< Supply Controller Supply Monitor Mode
64 #define SUPC_MR (*((reg32_t *)(SUPC_BASE + SUPC_MR_OFF ))) ///< Supply Controller Mode
65 #define SUPC_WUMR (*((reg32_t *)(SUPC_BASE + SUPC_WUMR_OFF))) ///< Supply Controller Wake Up Mode
66 #define SUPC_WUIR (*((reg32_t *)(SUPC_BASE + SUPC_WUIR_OFF))) ///< Supply Controller Wake Up Inputs
67 #define SUPC_SR (*((reg32_t *)(SUPC_BASE + SUPC_SR_OFF ))) ///< Supply Controller Status
71 * Defines for bit fields in SUPC_CR register.
74 #define SUPC_CR_VROFF 2 ///< Voltage Regulator Off
75 #define SUPC_CR_XTALSEL 3 ///< Crystal Oscillator Select
76 #define SUPC_CR_KEY_P 24
77 #define SUPC_CR_KEY_MASK (0xff << SUPC_CR_KEY_P) ///< SUPC_CR key
78 #define SUPC_CR_KEY(value) (SUPC_CR_KEY_MASK & ((value) << SUPC_CR_KEY_P))
82 * Defines for bit fields in SUPC_SR register.
85 #define SUPC_SR_WKUPS 1 ///< WKUP Wake Up Status
86 #define SUPC_SR_SMWS 2 ///< Supply Monitor Detection Wake Up Status
87 #define SUPC_SR_BODRSTS 3 ///< Brownout Detector Reset Status
88 #define SUPC_SR_SMRSTS 4 ///< Supply Monitor Reset Status
89 #define SUPC_SR_SMS 5 ///< Supply Monitor Status
90 #define SUPC_SR_SMOS 6 ///< Supply Monitor Output Status
91 #define SUPC_SR_OSCSEL 7 ///< 32-kHz Oscillator Selection Status
92 #define SUPC_SR_WKUPIS0 16 ///< WKUP Input Status 0
93 #define SUPC_SR_WKUPIS1 17 ///< WKUP Input Status 1
94 #define SUPC_SR_WKUPIS2 18 ///< WKUP Input Status 2
95 #define SUPC_SR_WKUPIS3 19 ///< WKUP Input Status 3
96 #define SUPC_SR_WKUPIS4 20 ///< WKUP Input Status 4
97 #define SUPC_SR_WKUPIS5 21 ///< WKUP Input Status 5
98 #define SUPC_SR_WKUPIS6 22 ///< WKUP Input Status 6
99 #define SUPC_SR_WKUPIS7 23 ///< WKUP Input Status 7
100 #define SUPC_SR_WKUPIS8 24 ///< WKUP Input Status 8
101 #define SUPC_SR_WKUPIS9 25 ///< WKUP Input Status 9
102 #define SUPC_SR_WKUPIS10 26 ///< WKUP Input Status 10
103 #define SUPC_SR_WKUPIS11 27 ///< WKUP Input Status 11
104 #define SUPC_SR_WKUPIS12 28 ///< WKUP Input Status 12
105 #define SUPC_SR_WKUPIS13 29 ///< WKUP Input Status 13
106 #define SUPC_SR_WKUPIS14 30 ///< WKUP Input Status 14
107 #define SUPC_SR_WKUPIS15 31 ///< WKUP Input Status 15
110 #endif /* SAM3_SYSCTL_H */