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

Copyright 2015, Texas Instruments Incorporated