2020-2021 Sunseeker Telemetry and Lighting System
sfr.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // sfr.h - Driver for the SFR Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_SFR_H__
8 #define __MSP430WARE_SFR_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_SFR__
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 interruptMask parameter
28 // for functions: SFR_enableInterrupt(), and SFR_disableInterrupt(); the
29 // interruptFlagMask parameter for functions: SFR_getInterruptStatus(), and
30 // SFR_clearInterrupt() as well as returned by the SFR_getInterruptStatus()
31 // function.
32 //
33 //*****************************************************************************
34 #define SFR_JTAG_OUTBOX_INTERRUPT JMBOUTIE
35 #define SFR_JTAG_INBOX_INTERRUPT JMBINIE
36 #define SFR_NMI_PIN_INTERRUPT NMIIE
37 #define SFR_VACANT_MEMORY_ACCESS_INTERRUPT VMAIE
38 #define SFR_OSCILLATOR_FAULT_INTERRUPT OFIE
39 #define SFR_WATCHDOG_INTERVAL_TIMER_INTERRUPT WDTIE
40 #define SFR_FLASH_CONTROLLER_ACCESS_VIOLATION_INTERRUPT ACCVIE
41 
42 //*****************************************************************************
43 //
44 // The following are values that can be passed to the pullResistorSetup
45 // parameter for functions: SFR_setResetPinPullResistor().
46 //
47 //*****************************************************************************
48 #define SFR_RESISTORDISABLE (!(SYSRSTRE + SYSRSTUP))
49 #define SFR_RESISTORENABLE_PULLUP (SYSRSTRE + SYSRSTUP)
50 #define SFR_RESISTORENABLE_PULLDOWN (SYSRSTRE)
51 
52 //*****************************************************************************
53 //
54 // The following are values that can be passed to the edgeDirection parameter
55 // for functions: SFR_setNMIEdge().
56 //
57 //*****************************************************************************
58 #define SFR_NMI_RISINGEDGE (!(SYSNMIIES))
59 #define SFR_NMI_FALLINGEDGE (SYSNMIIES)
60 
61 //*****************************************************************************
62 //
63 // The following are values that can be passed to the resetPinFunction
64 // parameter for functions: SFR_setResetNMIPinFunction().
65 //
66 //*****************************************************************************
67 #define SFR_RESETPINFUNC_RESET (!(SYSNMI))
68 #define SFR_RESETPINFUNC_NMI (SYSNMI)
69 
70 //*****************************************************************************
71 //
72 // Prototypes for the APIs.
73 //
74 //*****************************************************************************
75 
76 //*****************************************************************************
77 //
100 //
101 //*****************************************************************************
102 extern void SFR_enableInterrupt(uint8_t interruptMask);
103 
104 //*****************************************************************************
105 //
128 //
129 //*****************************************************************************
130 extern void SFR_disableInterrupt(uint8_t interruptMask);
131 
132 //*****************************************************************************
133 //
169 //
170 //*****************************************************************************
171 extern uint8_t SFR_getInterruptStatus(uint8_t interruptFlagMask);
172 
173 //*****************************************************************************
174 //
196 //
197 //*****************************************************************************
198 extern void SFR_clearInterrupt(uint8_t interruptFlagMask);
199 
200 //*****************************************************************************
201 //
216 //
217 //*****************************************************************************
218 extern void SFR_setResetPinPullResistor(uint16_t pullResistorSetup);
219 
220 //*****************************************************************************
221 //
238 //
239 //*****************************************************************************
240 extern void SFR_setNMIEdge(uint16_t edgeDirection);
241 
242 //*****************************************************************************
243 //
259 //
260 //*****************************************************************************
261 extern void SFR_setResetNMIPinFunction(uint8_t resetPinFunction);
262 
263 //*****************************************************************************
264 //
265 // Mark the end of the C bindings section for C++ compilers.
266 //
267 //*****************************************************************************
268 #ifdef __cplusplus
269 }
270 #endif
271 
272 #endif
273 #endif // __MSP430WARE_SFR_H__