2020-2021 Sunseeker Telemetry and Lighting System
sysctl.h
Go to the documentation of this file.
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 BSLRAMAssignment
28 // parameter for functions: SysCtl_setRAMAssignedToBSL().
29 //
30 //*****************************************************************************
31 #define SYSCTL_BSLRAMASSIGN_NORAM (!(SYSBSLR))
32 #define SYSCTL_BSLRAMASSIGN_LOWEST16BYTES (SYSBSLR)
33 
34 //*****************************************************************************
35 //
36 // The following are values that can be passed to the BSLSizeSelect parameter
37 // for functions: SysCtl_setBSLSize().
38 //
39 //*****************************************************************************
40 #define SYSCTL_BSLSIZE_SEG3 (~(SYSBSLSIZE0 + SYSBSLSIZE1))
41 #define SYSCTL_BSLSIZE_SEGS23 (SYSBSLSIZE0)
42 #define SYSCTL_BSLSIZE_SEGS123 (SYSBSLSIZE1)
43 #define SYSCTL_BSLSIZE_SEGS1234 (SYSBSLSIZE0 + SYSBSLSIZE1)
44 
45 //*****************************************************************************
46 //
47 // The following are values that can be passed to the mailboxSizeSelect
48 // parameter for functions: SysCtl_initJTAGMailbox().
49 //
50 //*****************************************************************************
51 #define SYSCTL_JTAGMBSIZE_16BIT (!(JMBMODE))
52 #define SYSCTL_JTAGMBSIZE_32BIT (JMBMODE)
53 
54 //*****************************************************************************
55 //
56 // The following are values that can be passed to the autoClearInboxFlagSelect
57 // parameter for functions: SysCtl_initJTAGMailbox().
58 //
59 //*****************************************************************************
60 #define SYSCTL_JTAGINBOX0AUTO_JTAGINBOX1AUTO (!(JMBCLR0OFF + JMBCLR1OFF))
61 #define SYSCTL_JTAGINBOX0AUTO_JTAGINBOX1SW (JMBCLR1OFF)
62 #define SYSCTL_JTAGINBOX0SW_JTAGINBOX1AUTO (JMBCLR0OFF)
63 #define SYSCTL_JTAGINBOX0SW_JTAGINBOX1SW (JMBCLR0OFF + JMBCLR1OFF)
64 
65 //*****************************************************************************
66 //
67 // The following are values that can be passed to the mailboxFlagMask parameter
68 // for functions: SysCtl_getJTAGMailboxFlagStatus(), and
69 // SysCtl_clearJTAGMailboxFlagStatus().
70 //
71 //*****************************************************************************
72 #define SYSCTL_JTAGOUTBOX_FLAG0 (JMBOUT0FG)
73 #define SYSCTL_JTAGOUTBOX_FLAG1 (JMBOUT1FG)
74 #define SYSCTL_JTAGINBOX_FLAG0 (JMBIN0FG)
75 #define SYSCTL_JTAGINBOX_FLAG1 (JMBIN1FG)
76 
77 //*****************************************************************************
78 //
79 // The following are values that can be passed to the inboxSelect parameter for
80 // functions: SysCtl_getJTAGInboxMessage16Bit().
81 //
82 //*****************************************************************************
83 #define SYSCTL_JTAGINBOX_0 (0x0)
84 #define SYSCTL_JTAGINBOX_1 (0x2)
85 
86 //*****************************************************************************
87 //
88 // The following are values that can be passed to the outboxSelect parameter
89 // for functions: SysCtl_setJTAGOutgoingMessage16Bit().
90 //
91 //*****************************************************************************
92 #define SYSCTL_JTAGOUTBOX_0 (0x0)
93 #define SYSCTL_JTAGOUTBOX_1 (0x2)
94 
95 //*****************************************************************************
96 //
97 // The following are values that can be passed toThe following are values that
98 // can be returned by the SysCtl_getBSLEntryIndication() function.
99 //
100 //*****************************************************************************
101 #define SYSCTL_BSLENTRY_INDICATED (0x1)
102 #define SYSCTL_BSLENTRY_NOTINDICATED (0x0)
103 
104 //*****************************************************************************
105 //
106 // Prototypes for the APIs.
107 //
108 //*****************************************************************************
109 
110 //*****************************************************************************
111 //
120 //
121 //*****************************************************************************
122 extern void SysCtl_enableDedicatedJTAGPins(void);
123 
124 //*****************************************************************************
125 //
136 //
137 //*****************************************************************************
138 extern uint8_t SysCtl_getBSLEntryIndication(void);
139 
140 //*****************************************************************************
141 //
149 //
150 //*****************************************************************************
151 extern void SysCtl_enablePMMAccessProtect(void);
152 
153 //*****************************************************************************
154 //
163 //
164 //*****************************************************************************
165 extern void SysCtl_enableRAMBasedInterruptVectors(void);
166 
167 //*****************************************************************************
168 //
176 //
177 //*****************************************************************************
178 extern void SysCtl_disableRAMBasedInterruptVectors(void);
179 
180 //*****************************************************************************
181 //
189 //
190 //*****************************************************************************
191 extern void SysCtl_enableBSLProtect(void);
192 
193 //*****************************************************************************
194 //
201 //
202 //*****************************************************************************
203 extern void SysCtl_disableBSLProtect(void);
204 
205 //*****************************************************************************
206 //
213 //
214 //*****************************************************************************
215 extern void SysCtl_enableBSLMemory(void);
216 
217 //*****************************************************************************
218 //
226 //
227 //*****************************************************************************
228 extern void SysCtl_disableBSLMemory(void);
229 
230 //*****************************************************************************
231 //
245 //
246 //*****************************************************************************
247 extern void SysCtl_setRAMAssignedToBSL(uint8_t BSLRAMAssignment);
248 
249 //*****************************************************************************
250 //
264 //
265 //*****************************************************************************
266 extern void SysCtl_setBSLSize(uint8_t BSLSizeSelect);
267 
268 //*****************************************************************************
269 //
306 //
307 //*****************************************************************************
308 extern void SysCtl_initJTAGMailbox(uint8_t mailboxSizeSelect,
309  uint8_t autoClearInboxFlagSelect);
310 
311 //*****************************************************************************
312 //
327 //
328 //*****************************************************************************
329 extern uint8_t SysCtl_getJTAGMailboxFlagStatus(uint8_t mailboxFlagMask);
330 
331 //*****************************************************************************
332 //
346 //
347 //*****************************************************************************
348 extern void SysCtl_clearJTAGMailboxFlagStatus(uint8_t mailboxFlagMask);
349 
350 //*****************************************************************************
351 //
365 //
366 //*****************************************************************************
367 extern uint16_t SysCtl_getJTAGInboxMessage16Bit(uint8_t inboxSelect);
368 
369 //*****************************************************************************
370 //
381 //
382 //*****************************************************************************
383 extern uint32_t SysCtl_getJTAGInboxMessage32Bit(void);
384 
385 //*****************************************************************************
386 //
402 //
403 //*****************************************************************************
404 extern void SysCtl_setJTAGOutgoingMessage16Bit(uint8_t outboxSelect,
405  uint16_t outgoingMessage);
406 
407 //*****************************************************************************
408 //
419 //
420 //*****************************************************************************
421 extern void SysCtl_setJTAGOutgoingMessage32Bit(uint32_t outgoingMessage);
422 
423 //*****************************************************************************
424 //
425 // Mark the end of the C bindings section for C++ compilers.
426 //
427 //*****************************************************************************
428 #ifdef __cplusplus
429 }
430 #endif
431 
432 #endif
433 #endif // __MSP430WARE_SYSCTL_H__