]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430FR5969_LaunchPad/driverlib/MSP430FR5xx_6xx/sysctl.h
Start of an MSP430FR5969 IAR project - currently running Blinky only.
[freertos] / FreeRTOS / Demo / MSP430FR5969_LaunchPad / driverlib / MSP430FR5xx_6xx / sysctl.h
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 // sysctl.h - Driver for the SYSCTL Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_SYSCTL_H__\r
39 #define __MSP430WARE_SYSCTL_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 mailboxSizeSelect\r
59 // parameter for functions: SysCtl_initJTAGMailbox().\r
60 //\r
61 //*****************************************************************************\r
62 #define SYSCTL_JTAGMBSIZE_16BIT                                    (!(JMBMODE))\r
63 #define SYSCTL_JTAGMBSIZE_32BIT                                       (JMBMODE)\r
64 \r
65 //*****************************************************************************\r
66 //\r
67 // The following are values that can be passed to the autoClearInboxFlagSelect\r
68 // parameter for functions: SysCtl_initJTAGMailbox().\r
69 //\r
70 //*****************************************************************************\r
71 #define SYSCTL_JTAGINBOX0AUTO_JTAGINBOX1AUTO       (!(JMBCLR0OFF + JMBCLR1OFF))\r
72 #define SYSCTL_JTAGINBOX0AUTO_JTAGINBOX1SW                         (JMBCLR1OFF)\r
73 #define SYSCTL_JTAGINBOX0SW_JTAGINBOX1AUTO                         (JMBCLR0OFF)\r
74 #define SYSCTL_JTAGINBOX0SW_JTAGINBOX1SW              (JMBCLR0OFF + JMBCLR1OFF)\r
75 \r
76 //*****************************************************************************\r
77 //\r
78 // The following are values that can be passed to the mailboxFlagMask parameter\r
79 // for functions: SysCtl_getJTAGMailboxFlagStatus(), and\r
80 // SysCtl_clearJTAGMailboxFlagStatus().\r
81 //\r
82 //*****************************************************************************\r
83 #define SYSCTL_JTAGOUTBOX_FLAG0                                     (JMBOUT0FG)\r
84 #define SYSCTL_JTAGOUTBOX_FLAG1                                     (JMBOUT1FG)\r
85 #define SYSCTL_JTAGINBOX_FLAG0                                       (JMBIN0FG)\r
86 #define SYSCTL_JTAGINBOX_FLAG1                                       (JMBIN1FG)\r
87 \r
88 //*****************************************************************************\r
89 //\r
90 // The following are values that can be passed to the inboxSelect parameter for\r
91 // functions: SysCtl_getJTAGInboxMessage16Bit().\r
92 //\r
93 //*****************************************************************************\r
94 #define SYSCTL_JTAGINBOX_0                                                (0x0)\r
95 #define SYSCTL_JTAGINBOX_1                                                (0x2)\r
96 \r
97 //*****************************************************************************\r
98 //\r
99 // The following are values that can be passed to the outboxSelect parameter\r
100 // for functions: SysCtl_setJTAGOutgoingMessage16Bit().\r
101 //\r
102 //*****************************************************************************\r
103 #define SYSCTL_JTAGOUTBOX_0                                               (0x0)\r
104 #define SYSCTL_JTAGOUTBOX_1                                               (0x2)\r
105 \r
106 //*****************************************************************************\r
107 //\r
108 // The following are values that can be passed toThe following are values that\r
109 // can be returned by the SysCtl_getBSLEntryIndication() function.\r
110 //\r
111 //*****************************************************************************\r
112 #define SYSCTL_BSLENTRY_INDICATED                                         (0x1)\r
113 #define SYSCTL_BSLENTRY_NOTINDICATED                                      (0x0)\r
114 \r
115 //*****************************************************************************\r
116 //\r
117 // Prototypes for the APIs.\r
118 //\r
119 //*****************************************************************************\r
120 \r
121 //*****************************************************************************\r
122 //\r
123 //! \brief Sets the JTAG pins to be exclusively for JTAG until a BOR occurs.\r
124 //!\r
125 //! This function sets the JTAG pins to be exclusively used for the JTAG, and\r
126 //! not to be shared with the GPIO pins. This setting can only be cleared when\r
127 //! a BOR occurs.\r
128 //!\r
129 //!\r
130 //! \return None\r
131 //\r
132 //*****************************************************************************\r
133 extern void SysCtl_enableDedicatedJTAGPins(void);\r
134 \r
135 //*****************************************************************************\r
136 //\r
137 //! \brief Returns the indication of a BSL entry sequence from the Spy-Bi-Wire.\r
138 //!\r
139 //! This function returns the indication of a BSL entry sequence from the Spy-\r
140 //! Bi-Wire.\r
141 //!\r
142 //!\r
143 //! \return One of the following:\r
144 //!         - \b SysCtl_BSLENTRY_INDICATED\r
145 //!         - \b SysCtl_BSLENTRY_NOTINDICATED\r
146 //!         \n indicating if a BSL entry sequence was detected\r
147 //\r
148 //*****************************************************************************\r
149 extern uint8_t SysCtl_getBSLEntryIndication(void);\r
150 \r
151 //*****************************************************************************\r
152 //\r
153 //! \brief Enables PMM Access Protection.\r
154 //!\r
155 //! This function enables the PMM Access Protection, which will lock any\r
156 //! changes on the PMM control registers until a BOR occurs.\r
157 //!\r
158 //!\r
159 //! \return None\r
160 //\r
161 //*****************************************************************************\r
162 extern void SysCtl_enablePMMAccessProtect(void);\r
163 \r
164 //*****************************************************************************\r
165 //\r
166 //! \brief Enables RAM-based Interrupt Vectors.\r
167 //!\r
168 //! This function enables RAM-base Interrupt Vectors, which means that\r
169 //! interrupt vectors are generated with the end address at the top of RAM,\r
170 //! instead of the top of the lower 64kB of flash.\r
171 //!\r
172 //!\r
173 //! \return None\r
174 //\r
175 //*****************************************************************************\r
176 extern void SysCtl_enableRAMBasedInterruptVectors(void);\r
177 \r
178 //*****************************************************************************\r
179 //\r
180 //! \brief Disables RAM-based Interrupt Vectors.\r
181 //!\r
182 //! This function disables the interrupt vectors from being generated at the\r
183 //! top of the RAM.\r
184 //!\r
185 //!\r
186 //! \return None\r
187 //\r
188 //*****************************************************************************\r
189 extern void SysCtl_disableRAMBasedInterruptVectors(void);\r
190 \r
191 //*****************************************************************************\r
192 //\r
193 //! \brief Initializes JTAG Mailbox with selected properties.\r
194 //!\r
195 //! This function sets the specified settings for the JTAG Mailbox system. The\r
196 //! settings that can be set are the size of the JTAG messages, and the auto-\r
197 //! clearing of the inbox flags. If the inbox flags are set to auto-clear, then\r
198 //! the inbox flags will be cleared upon reading of the inbox message buffer,\r
199 //! otherwise they will have to be reset by software using the\r
200 //! SYS_clearJTAGMailboxFlagStatus() function.\r
201 //!\r
202 //! \param mailboxSizeSelect is the size of the JTAG Mailboxes, whether 16- or\r
203 //!        32-bits.\r
204 //!        Valid values are:\r
205 //!        - \b SYSCTL_JTAGMBSIZE_16BIT [Default] - the JTAG messages will take\r
206 //!           up only one JTAG mailbox (i. e. an outgoing message will take up\r
207 //!           only 1 outbox of the JTAG mailboxes)\r
208 //!        - \b SYSCTL_JTAGMBSIZE_32BIT - the JTAG messages will be contained\r
209 //!           within both JTAG mailboxes (i. e. an outgoing message will take\r
210 //!           up both Outboxes of the JTAG mailboxes)\r
211 //!        \n Modified bits are \b JMBMODE of \b SYSJMBC register.\r
212 //! \param autoClearInboxFlagSelect decides how the JTAG inbox flags should be\r
213 //!        cleared, whether automatically after the corresponding outbox has\r
214 //!        been written to, or manually by software.\r
215 //!        Valid values are:\r
216 //!        - \b SYSCTL_JTAGINBOX0AUTO_JTAGINBOX1AUTO [Default] - both JTAG\r
217 //!           inbox flags will be reset automatically when the corresponding\r
218 //!           inbox is read from.\r
219 //!        - \b SYSCTL_JTAGINBOX0AUTO_JTAGINBOX1SW - only JTAG inbox 0 flag is\r
220 //!           reset automatically, while JTAG inbox 1 is reset with the\r
221 //!        - \b SYSCTL_JTAGINBOX0SW_JTAGINBOX1AUTO - only JTAG inbox 1 flag is\r
222 //!           reset automatically, while JTAG inbox 0 is reset with the\r
223 //!        - \b SYSCTL_JTAGINBOX0SW_JTAGINBOX1SW - both JTAG inbox flags will\r
224 //!           need to be reset manually by the\r
225 //!        \n Modified bits are \b JMBCLR0OFF and \b JMBCLR1OFF of \b SYSJMBC\r
226 //!        register.\r
227 //!\r
228 //! \return None\r
229 //\r
230 //*****************************************************************************\r
231 extern void SysCtl_initJTAGMailbox(uint8_t mailboxSizeSelect,\r
232                                    uint8_t autoClearInboxFlagSelect);\r
233 \r
234 //*****************************************************************************\r
235 //\r
236 //! \brief Returns the status of the selected JTAG Mailbox flags.\r
237 //!\r
238 //! This function will return the status of the selected JTAG Mailbox flags in\r
239 //! bit mask format matching that passed into the mailboxFlagMask parameter.\r
240 //!\r
241 //! \param mailboxFlagMask is the bit mask of JTAG mailbox flags that the\r
242 //!        status of should be returned.\r
243 //!        Mask value is the logical OR of any of the following:\r
244 //!        - \b SYSCTL_JTAGOUTBOX_FLAG0 - flag for JTAG outbox 0\r
245 //!        - \b SYSCTL_JTAGOUTBOX_FLAG1 - flag for JTAG outbox 1\r
246 //!        - \b SYSCTL_JTAGINBOX_FLAG0 - flag for JTAG inbox 0\r
247 //!        - \b SYSCTL_JTAGINBOX_FLAG1 - flag for JTAG inbox 1\r
248 //!\r
249 //! \return A bit mask of the status of the selected mailbox flags.\r
250 //\r
251 //*****************************************************************************\r
252 extern uint8_t SysCtl_getJTAGMailboxFlagStatus(uint8_t mailboxFlagMask);\r
253 \r
254 //*****************************************************************************\r
255 //\r
256 //! \brief Clears the status of the selected JTAG Mailbox flags.\r
257 //!\r
258 //! This function clears the selected JTAG Mailbox flags.\r
259 //!\r
260 //! \param mailboxFlagMask is the bit mask of JTAG mailbox flags that the\r
261 //!        status of should be cleared.\r
262 //!        Mask value is the logical OR of any of the following:\r
263 //!        - \b SYSCTL_JTAGOUTBOX_FLAG0 - flag for JTAG outbox 0\r
264 //!        - \b SYSCTL_JTAGOUTBOX_FLAG1 - flag for JTAG outbox 1\r
265 //!        - \b SYSCTL_JTAGINBOX_FLAG0 - flag for JTAG inbox 0\r
266 //!        - \b SYSCTL_JTAGINBOX_FLAG1 - flag for JTAG inbox 1\r
267 //!\r
268 //! \return None\r
269 //\r
270 //*****************************************************************************\r
271 extern void SysCtl_clearJTAGMailboxFlagStatus(uint8_t mailboxFlagMask);\r
272 \r
273 //*****************************************************************************\r
274 //\r
275 //! \brief Returns the contents of the selected JTAG Inbox in a 16 bit format.\r
276 //!\r
277 //! This function returns the message contents of the selected JTAG inbox. If\r
278 //! the auto clear settings for the Inbox flags were set, then using this\r
279 //! function will automatically clear the corresponding JTAG inbox flag.\r
280 //!\r
281 //! \param inboxSelect is the chosen JTAG inbox that the contents of should be\r
282 //!        returned\r
283 //!        Valid values are:\r
284 //!        - \b SYSCTL_JTAGINBOX_0 - return contents of JTAG inbox 0\r
285 //!        - \b SYSCTL_JTAGINBOX_1 - return contents of JTAG inbox 1\r
286 //!\r
287 //! \return The contents of the selected JTAG inbox in a 16 bit format.\r
288 //\r
289 //*****************************************************************************\r
290 extern uint16_t SysCtl_getJTAGInboxMessage16Bit(uint8_t inboxSelect);\r
291 \r
292 //*****************************************************************************\r
293 //\r
294 //! \brief Returns the contents of JTAG Inboxes in a 32 bit format.\r
295 //!\r
296 //! This function returns the message contents of both JTAG inboxes in a 32 bit\r
297 //! format. This function should be used if 32-bit messaging has been set in\r
298 //! the SYS_initJTAGMailbox() function. If the auto clear settings for the\r
299 //! Inbox flags were set, then using this function will automatically clear\r
300 //! both JTAG inbox flags.\r
301 //!\r
302 //!\r
303 //! \return The contents of both JTAG messages in a 32 bit format.\r
304 //\r
305 //*****************************************************************************\r
306 extern uint32_t SysCtl_getJTAGInboxMessage32Bit(void);\r
307 \r
308 //*****************************************************************************\r
309 //\r
310 //! \brief Sets a 16 bit outgoing message in to the selected JTAG Outbox.\r
311 //!\r
312 //! This function sets the outgoing message in the selected JTAG outbox. The\r
313 //! corresponding JTAG outbox flag is cleared after this function, and set\r
314 //! after the JTAG has read the message.\r
315 //!\r
316 //! \param outboxSelect is the chosen JTAG outbox that the message should be\r
317 //!        set it.\r
318 //!        Valid values are:\r
319 //!        - \b SYSCTL_JTAGOUTBOX_0 - set the contents of JTAG outbox 0\r
320 //!        - \b SYSCTL_JTAGOUTBOX_1 - set the contents of JTAG outbox 1\r
321 //! \param outgoingMessage is the message to send to the JTAG.\r
322 //!        \n Modified bits are \b MSGHI and \b MSGLO of \b SYSJMBOx register.\r
323 //!\r
324 //! \return None\r
325 //\r
326 //*****************************************************************************\r
327 extern void SysCtl_setJTAGOutgoingMessage16Bit(uint8_t outboxSelect,\r
328                                                uint16_t outgoingMessage);\r
329 \r
330 //*****************************************************************************\r
331 //\r
332 //! \brief Sets a 32 bit message in to both JTAG Outboxes.\r
333 //!\r
334 //! This function sets the 32-bit outgoing message in both JTAG outboxes. The\r
335 //! JTAG outbox flags are cleared after this function, and set after the JTAG\r
336 //! has read the message.\r
337 //!\r
338 //! \param outgoingMessage is the message to send to the JTAG.\r
339 //!        \n Modified bits are \b MSGHI and \b MSGLO of \b SYSJMBOx register.\r
340 //!\r
341 //! \return None\r
342 //\r
343 //*****************************************************************************\r
344 extern void SysCtl_setJTAGOutgoingMessage32Bit(uint32_t outgoingMessage);\r
345 \r
346 //*****************************************************************************\r
347 //\r
348 // Mark the end of the C bindings section for C++ compilers.\r
349 //\r
350 //*****************************************************************************\r
351 #ifdef __cplusplus\r
352 }\r
353 #endif\r
354 \r
355 #endif\r
356 #endif // __MSP430WARE_SYSCTL_H__\r