]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/asf/sam/utils/cmsis/sam4s/include/component/component_rstc.h
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / CORTEX_M4_ATSAM4S_Atmel_Studio / src / asf / sam / utils / cmsis / sam4s / include / component / component_rstc.h
1 /**\r
2  * \file\r
3  *\r
4  * Copyright (c) 2012 Atmel Corporation. All rights reserved.\r
5  *\r
6  * \asf_license_start\r
7  *\r
8  * Redistribution and use in source and binary forms, with or without\r
9  * modification, are permitted provided that the following conditions are met:\r
10  *\r
11  * 1. Redistributions of source code must retain the above copyright notice,\r
12  *    this list of conditions and the following disclaimer.\r
13  *\r
14  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
15  *    this list of conditions and the following disclaimer in the documentation\r
16  *    and/or other materials provided with the distribution.\r
17  *\r
18  * 3. The name of Atmel may not be used to endorse or promote products derived\r
19  *    from this software without specific prior written permission.\r
20  *\r
21  * 4. This software may only be redistributed and used in connection with an\r
22  *    Atmel microcontroller product.\r
23  *\r
24  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED\r
25  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
26  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
27  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR\r
28  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
30  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\r
32  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
34  * POSSIBILITY OF SUCH DAMAGE.\r
35  *\r
36  * \asf_license_stop\r
37  *\r
38  */\r
39 \r
40 #ifndef _SAM4S_RSTC_COMPONENT_\r
41 #define _SAM4S_RSTC_COMPONENT_\r
42 \r
43 /* ============================================================================= */\r
44 /**  SOFTWARE API DEFINITION FOR Reset Controller */\r
45 /* ============================================================================= */\r
46 /** \addtogroup SAM4S_RSTC Reset Controller */\r
47 /*@{*/\r
48 \r
49 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))\r
50 /** \brief Rstc hardware registers */\r
51 typedef struct {\r
52   WoReg RSTC_CR; /**< \brief (Rstc Offset: 0x00) Control Register */\r
53   RoReg RSTC_SR; /**< \brief (Rstc Offset: 0x04) Status Register */\r
54   RwReg RSTC_MR; /**< \brief (Rstc Offset: 0x08) Mode Register */\r
55 } Rstc;\r
56 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */\r
57 /* -------- RSTC_CR : (RSTC Offset: 0x00) Control Register -------- */\r
58 #define RSTC_CR_PROCRST (0x1u << 0) /**< \brief (RSTC_CR) Processor Reset */\r
59 #define RSTC_CR_PERRST (0x1u << 2) /**< \brief (RSTC_CR) Peripheral Reset */\r
60 #define RSTC_CR_EXTRST (0x1u << 3) /**< \brief (RSTC_CR) External Reset */\r
61 #define RSTC_CR_KEY_Pos 24\r
62 #define RSTC_CR_KEY_Msk (0xffu << RSTC_CR_KEY_Pos) /**< \brief (RSTC_CR) Password */\r
63 #define RSTC_CR_KEY(value) ((RSTC_CR_KEY_Msk & ((value) << RSTC_CR_KEY_Pos)))\r
64 /* -------- RSTC_SR : (RSTC Offset: 0x04) Status Register -------- */\r
65 #define RSTC_SR_URSTS (0x1u << 0) /**< \brief (RSTC_SR) User Reset Status */\r
66 #define RSTC_SR_RSTTYP_Pos 8\r
67 #define RSTC_SR_RSTTYP_Msk (0x7u << RSTC_SR_RSTTYP_Pos) /**< \brief (RSTC_SR) Reset Type */\r
68 #define RSTC_SR_NRSTL (0x1u << 16) /**< \brief (RSTC_SR) NRST Pin Level */\r
69 #define RSTC_SR_SRCMP (0x1u << 17) /**< \brief (RSTC_SR) Software Reset Command in Progress */\r
70 /* -------- RSTC_MR : (RSTC Offset: 0x08) Mode Register -------- */\r
71 #define RSTC_MR_URSTEN (0x1u << 0) /**< \brief (RSTC_MR) User Reset Enable */\r
72 #define RSTC_MR_URSTIEN (0x1u << 4) /**< \brief (RSTC_MR) User Reset Interrupt Enable */\r
73 #define RSTC_MR_ERSTL_Pos 8\r
74 #define RSTC_MR_ERSTL_Msk (0xfu << RSTC_MR_ERSTL_Pos) /**< \brief (RSTC_MR) External Reset Length */\r
75 #define RSTC_MR_ERSTL(value) ((RSTC_MR_ERSTL_Msk & ((value) << RSTC_MR_ERSTL_Pos)))\r
76 #define RSTC_MR_KEY_Pos 24\r
77 #define RSTC_MR_KEY_Msk (0xffu << RSTC_MR_KEY_Pos) /**< \brief (RSTC_MR) Password */\r
78 #define RSTC_MR_KEY(value) ((RSTC_MR_KEY_Msk & ((value) << RSTC_MR_KEY_Pos)))\r
79 \r
80 /*@}*/\r
81 \r
82 \r
83 #endif /* _SAM4S_RSTC_COMPONENT_ */\r