1 /* --COPYRIGHT--,BSD\r
2 * Copyright (c) 2014, Texas Instruments Incorporated\r
3 * All rights reserved.\r
4 *\r
5 * Redistribution and use in source and binary forms, with or without\r
6 * modification, are permitted provided that the following conditions\r
7 * are met:\r
8 *\r
9 * * Redistributions of source code must retain the above copyright\r
10 * notice, this list of conditions and the following disclaimer.\r
11 *\r
12 * * Redistributions in binary form must reproduce the above copyright\r
13 * notice, this list of conditions and the following disclaimer in the\r
14 * documentation and/or other materials provided with the distribution.\r
15 *\r
16 * * Neither the name of Texas Instruments Incorporated nor the names of\r
17 * its contributors may be used to endorse or promote products derived\r
18 * from this software without specific prior written permission.\r
19 *\r
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31 * --/COPYRIGHT--*/\r
32 //*****************************************************************************\r
33 //\r
34 // sys.h - Driver for the SYS Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_SYS_H__\r
39 #define __MSP430WARE_SYS_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #ifdef __MSP430_HAS_SYS__\r
44 \r
45 //*****************************************************************************\r
46 //\r
47 // If building with a C++ compiler, make all of the definitions in this header\r
48 // have a C binding.\r
49 //\r
50 //*****************************************************************************\r
51 #ifdef __cplusplus\r
52 extern "C"\r
53 {\r
54 #endif\r
55 \r
56 //*****************************************************************************\r
57 //\r
58 // The following are values that can be passed to the BSLRAMAssignment\r
59 // parameter for functions: SYS_setRAMAssignedToBSL().\r
60 //\r
61 //*****************************************************************************\r
62 #define SYS_BSLRAMASSIGN_NORAM (!(SYSBSLR))\r
63 #define SYS_BSLRAMASSIGN_LOWEST16BYTES (SYSBSLR)\r
64 \r
65 //*****************************************************************************\r
66 //\r
67 // The following are values that can be passed to the BSLSizeSelect parameter\r
68 // for functions: SYS_setBSLSize().\r
69 //\r
70 //*****************************************************************************\r
71 #define SYS_BSLSIZE_SEG3 (~(SYSBSLSIZE0 + SYSBSLSIZE1))\r
72 #define SYS_BSLSIZE_SEGS23 (SYSBSLSIZE0)\r
73 #define SYS_BSLSIZE_SEGS123 (SYSBSLSIZE1)\r
74 #define SYS_BSLSIZE_SEGS1234 (SYSBSLSIZE0 + SYSBSLSIZE1)\r
75 \r
76 //*****************************************************************************\r
77 //\r
78 // The following are values that can be passed to the mailboxSizeSelect\r
79 // parameter for functions: SYS_JTAGMailboxInit().\r
80 //\r
81 //*****************************************************************************\r
82 #define SYS_JTAGMBSIZE_16BIT (!(JMBMODE))\r
83 #define SYS_JTAGMBSIZE_32BIT (JMBMODE)\r
84 \r
85 //*****************************************************************************\r
86 //\r
87 // The following are values that can be passed to the autoClearInboxFlagSelect\r
88 // parameter for functions: SYS_JTAGMailboxInit().\r
89 //\r
90 //*****************************************************************************\r
91 #define SYS_JTAGINBOX0AUTO_JTAGINBOX1AUTO (!(JMBCLR0OFF + JMBCLR1OFF))\r
92 #define SYS_JTAGINBOX0AUTO_JTAGINBOX1SW (JMBCLR1OFF)\r
93 #define SYS_JTAGINBOX0SW_JTAGINBOX1AUTO (JMBCLR0OFF)\r
94 #define SYS_JTAGINBOX0SW_JTAGINBOX1SW (JMBCLR0OFF + JMBCLR1OFF)\r
95 \r
96 //*****************************************************************************\r
97 //\r
98 // The following are values that can be passed to the mailboxFlagMask parameter\r
99 // for functions: SYS_getJTAGMailboxFlagStatus(), and\r
100 // SYS_clearJTAGMailboxFlagStatus().\r
101 //\r
102 //*****************************************************************************\r
103 #define SYS_JTAGOUTBOX_FLAG0 (JMBOUT0FG)\r
104 #define SYS_JTAGOUTBOX_FLAG1 (JMBOUT1FG)\r
105 #define SYS_JTAGINBOX_FLAG0 (JMBIN0FG)\r
106 #define SYS_JTAGINBOX_FLAG1 (JMBIN1FG)\r
107 \r
108 //*****************************************************************************\r
109 //\r
110 // The following are values that can be passed to the inboxSelect parameter for\r
111 // functions: SYS_getJTAGInboxMessage16Bit().\r
112 //\r
113 //*****************************************************************************\r
114 #define SYS_JTAGINBOX_0 (0x0)\r
115 #define SYS_JTAGINBOX_1 (0x2)\r
116 \r
117 //*****************************************************************************\r
118 //\r
119 // The following are values that can be passed to the outboxSelect parameter\r
120 // for functions: SYS_setJTAGOutgoingMessage16Bit().\r
121 //\r
122 //*****************************************************************************\r
123 #define SYS_JTAGOUTBOX_0 (0x0)\r
124 #define SYS_JTAGOUTBOX_1 (0x2)\r
125 \r
126 //*****************************************************************************\r
127 //\r
128 // The following are values that can be passed toThe following are values that\r
129 // can be returned by the SYS_getBSLEntryIndication() function.\r
130 //\r
131 //*****************************************************************************\r
132 #define SYS_BSLENTRY_INDICATED (0x1)\r
133 #define SYS_BSLENTRY_NOTINDICATED (0x0)\r
134 \r
135 //*****************************************************************************\r
136 //\r
137 // Prototypes for the APIs.\r
138 //\r
139 //*****************************************************************************\r
140 extern void SYS_enableDedicatedJTAGPins(void);\r
141 \r
142 extern uint8_t SYS_getBSLEntryIndication(void);\r
143 \r
144 extern void SYS_enablePMMAccessProtect(void);\r
145 \r
146 extern void SYS_enableRAMBasedInterruptVectors(void);\r
147 \r
148 extern void SYS_disableRAMBasedInterruptVectors(void);\r
149 \r
150 extern void SYS_enableBSLProtect(void);\r
151 \r
152 extern void SYS_disableBSLProtect(void);\r
153 \r
154 extern void SYS_enableBSLMemory(void);\r
155 \r
156 extern void SYS_disableBSLMemory(void);\r
157 \r
158 extern void SYS_setRAMAssignedToBSL(uint8_t BSLRAMAssignment);\r
159 \r
160 extern void SYS_setBSLSize(uint8_t BSLSizeSelect);\r
161 \r
162 extern void SYS_JTAGMailboxInit(uint8_t mailboxSizeSelect,\r
163 uint8_t autoClearInboxFlagSelect);\r
164 \r
165 extern uint8_t SYS_getJTAGMailboxFlagStatus(uint8_t mailboxFlagMask);\r
166 \r
167 extern void SYS_clearJTAGMailboxFlagStatus(uint8_t mailboxFlagMask);\r
168 \r
169 extern uint16_t SYS_getJTAGInboxMessage16Bit(uint8_t inboxSelect);\r
170 \r
171 extern uint32_t SYS_getJTAGInboxMessage32Bit(void);\r
172 \r
173 extern void SYS_setJTAGOutgoingMessage16Bit(uint8_t outboxSelect,\r
174 uint16_t outgoingMessage);\r
175 \r
176 extern void SYS_setJTAGOutgoingMessage32Bit(uint32_t outgoingMessage);\r
177 \r
178 //*****************************************************************************\r
179 //\r
180 // Mark the end of the C bindings section for C++ compilers.\r
181 //\r
182 //*****************************************************************************\r
183 #ifdef __cplusplus\r
184 }\r
185 #endif\r
186 \r
187 #endif\r
188 #endif // __MSP430WARE_SYS_H__\r