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 // sfr.h - Driver for the SFR Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_SFR_H__\r
39 #define __MSP430WARE_SFR_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #ifdef __MSP430_HAS_SFR__\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 interruptMask parameter\r
59 // for functions: SFR_enableInterrupt(), and SFR_disableInterrupt(); the\r
60 // interruptFlagMask parameter for functions: SFR_getInterruptStatus(), and\r
61 // SFR_clearInterrupt() as well as returned by the SFR_getInterruptStatus()\r
62 // function.\r
63 //\r
64 //*****************************************************************************\r
65 #define SFR_JTAG_OUTBOX_INTERRUPT JMBOUTIE\r
66 #define SFR_JTAG_INBOX_INTERRUPT JMBINIE\r
67 #define SFR_NMI_PIN_INTERRUPT NMIIE\r
68 #define SFR_VACANT_MEMORY_ACCESS_INTERRUPT VMAIE\r
69 #define SFR_OSCILLATOR_FAULT_INTERRUPT OFIE\r
70 #define SFR_WATCHDOG_INTERVAL_TIMER_INTERRUPT WDTIE\r
71 #define SFR_FLASH_CONTROLLER_ACCESS_VIOLATION_INTERRUPT ACCVIE\r
72 \r
73 //*****************************************************************************\r
74 //\r
75 // The following are values that can be passed to the pullResistorSetup\r
76 // parameter for functions: SFR_setResetPinPullResistor().\r
77 //\r
78 //*****************************************************************************\r
79 #define SFR_RESISTORDISABLE (!(SYSRSTRE + SYSRSTUP))\r
80 #define SFR_RESISTORENABLE_PULLUP (SYSRSTRE + SYSRSTUP)\r
81 #define SFR_RESISTORENABLE_PULLDOWN (SYSRSTRE)\r
82 \r
83 //*****************************************************************************\r
84 //\r
85 // The following are values that can be passed to the edgeDirection parameter\r
86 // for functions: SFR_setNMIEdge().\r
87 //\r
88 //*****************************************************************************\r
89 #define SFR_NMI_RISINGEDGE (!(SYSNMIIES))\r
90 #define SFR_NMI_FALLINGEDGE (SYSNMIIES)\r
91 \r
92 //*****************************************************************************\r
93 //\r
94 // The following are values that can be passed to the resetPinFunction\r
95 // parameter for functions: SFR_setResetNMIPinFunction().\r
96 //\r
97 //*****************************************************************************\r
98 #define SFR_RESETPINFUNC_RESET (!(SYSNMI))\r
99 #define SFR_RESETPINFUNC_NMI (SYSNMI)\r
100 \r
101 //*****************************************************************************\r
102 //\r
103 // Prototypes for the APIs.\r
104 //\r
105 //*****************************************************************************\r
106 extern void SFR_enableInterrupt(uint16_t baseAddress,\r
107 uint8_t interruptMask);\r
108 \r
109 extern void SFR_disableInterrupt(uint16_t baseAddress,\r
110 uint8_t interruptMask);\r
111 \r
112 extern uint8_t SFR_getInterruptStatus(uint16_t baseAddress,\r
113 uint8_t interruptFlagMask);\r
114 \r
115 extern void SFR_clearInterrupt(uint16_t baseAddress,\r
116 uint8_t interruptFlagMask);\r
117 \r
118 extern void SFR_setResetPinPullResistor(uint16_t baseAddress,\r
119 uint16_t pullResistorSetup);\r
120 \r
121 extern void SFR_setNMIEdge(uint16_t baseAddress,\r
122 uint16_t edgeDirection);\r
123 \r
124 extern void SFR_setResetNMIPinFunction(uint16_t baseAddress,\r
125 uint8_t resetPinFunction);\r
126 \r
127 //*****************************************************************************\r
128 //\r
129 // Mark the end of the C bindings section for C++ compilers.\r
130 //\r
131 //*****************************************************************************\r
132 #ifdef __cplusplus\r
133 }\r
134 #endif\r
135 \r
136 #endif\r
137 #endif // __MSP430WARE_SFR_H__\r