MSP430 DriverLib for MSP430i2xx Devices  2.91.13.01
sfr.h
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_NMI_PIN_INTERRUPT NMIIE
35 #define SFR_OSCILLATOR_FAULT_INTERRUPT OFIE
36 #define SFR_WATCHDOG_INTERRUPT WDTIE
37 #define SFR_FLASH_ACCESS_VIOLATION_INTERRUPT ACCVIE
38 #define SFR_EXTERNAL_RESET_INTERRUPT RSTIFG
39 #define SFR_BROWN_OUT_RESET_INTERRUPT BORIFG
40 
41 //*****************************************************************************
42 //
43 // Prototypes for the APIs.
44 //
45 //*****************************************************************************
46 
47 //*****************************************************************************
48 //
49 //! \brief Enables selected SFR interrupt sources.
50 //!
51 //! This function enables the selected SFR interrupt sources. Only the sources
52 //! that are enabled can be reflected to the processor interrupt; disabled
53 //! sources have no effect on the processor. Does not clear interrupt flags.
54 //!
55 //! \param interruptMask is the bit mask of interrupts that will be enabled.
56 //! Mask value is the logical OR of any of the following:
57 //! - \b SFR_NMI_PIN_INTERRUPT - NMI pin interrupt, if NMI function is
58 //! chosen
59 //! - \b SFR_OSCILLATOR_FAULT_INTERRUPT - Oscillator fault interrupt
60 //! - \b SFR_WATCHDOG_INTERRUPT - Watchdog interrupt
61 //! - \b SFR_FLASH_ACCESS_VIOLATION_INTERRUPT - Flash access violation
62 //! interrupt
63 //!
64 //! \return None
65 //
66 //*****************************************************************************
67 extern void SFR_enableInterrupt(uint8_t interruptMask);
68 
69 //*****************************************************************************
70 //
71 //! \brief Disables selected SFR interrupt sources.
72 //!
73 //! This function disables the selected SFR interrupt sources. Only the sources
74 //! that are enabled can be reflected to the processor interrupt; disabled
75 //! sources have no effect on the processor.
76 //!
77 //! \param interruptMask is the bit mask of interrupts that will be disabled.
78 //! Mask value is the logical OR of any of the following:
79 //! - \b SFR_NMI_PIN_INTERRUPT - NMI pin interrupt, if NMI function is
80 //! chosen
81 //! - \b SFR_OSCILLATOR_FAULT_INTERRUPT - Oscillator fault interrupt
82 //! - \b SFR_WATCHDOG_INTERRUPT - Watchdog interrupt
83 //! - \b SFR_FLASH_ACCESS_VIOLATION_INTERRUPT - Flash access violation
84 //! interrupt
85 //!
86 //! \return None
87 //
88 //*****************************************************************************
89 extern void SFR_disableInterrupt(uint8_t interruptMask);
90 
91 //*****************************************************************************
92 //
93 //! \brief Returns the status of the selected SFR interrupt flags.
94 //!
95 //! This function returns the status of the selected SFR interrupt flags in a
96 //! bit mask format matching that passed into the interruptFlagMask parameter.
97 //!
98 //! \param interruptFlagMask is the bit mask of interrupt flags that the status
99 //! of should be returned.
100 //! Mask value is the logical OR of any of the following:
101 //! - \b SFR_NMI_PIN_INTERRUPT - NMI pin interrupt, if NMI function is
102 //! chosen
103 //! - \b SFR_OSCILLATOR_FAULT_INTERRUPT - Oscillator fault interrupt
104 //! - \b SFR_WATCHDOG_INTERRUPT - Watchdog interrupt
105 //! - \b SFR_EXTERNAL_RESET_INTERRUPT - External reset interrupt
106 //! - \b SFR_BROWN_OUT_RESET_INTERRUPT - Brown out reset interrupt
107 //!
108 //! \return A bit mask of the status of the selected interrupt flags.
109 //! - \b SFR_NMI_PIN_INTERRUPT NMI pin interrupt, if NMI function is
110 //! chosen
111 //! - \b SFR_OSCILLATOR_FAULT_INTERRUPT Oscillator fault interrupt
112 //! - \b SFR_WATCHDOG_INTERRUPT Watchdog interrupt
113 //! - \b SFR_EXTERNAL_RESET_INTERRUPT External reset interrupt
114 //! - \b SFR_BROWN_OUT_RESET_INTERRUPT Brown out reset interrupt
115 //! \n indicating the status of the masked interrupts
116 //
117 //*****************************************************************************
118 extern uint8_t SFR_getInterruptStatus(uint8_t interruptFlagMask);
119 
120 //*****************************************************************************
121 //
122 //! \brief Clears the selected SFR interrupt flags.
123 //!
124 //! This function clears the status of the selected SFR interrupt flags.
125 //!
126 //! \param interruptFlagMask is the bit mask of interrupt flags that will be
127 //! cleared.
128 //! Mask value is the logical OR of any of the following:
129 //! - \b SFR_NMI_PIN_INTERRUPT - NMI pin interrupt, if NMI function is
130 //! chosen
131 //! - \b SFR_OSCILLATOR_FAULT_INTERRUPT - Oscillator fault interrupt
132 //! - \b SFR_WATCHDOG_INTERRUPT - Watchdog interrupt
133 //! - \b SFR_EXTERNAL_RESET_INTERRUPT - External reset interrupt
134 //! - \b SFR_BROWN_OUT_RESET_INTERRUPT - Brown out reset interrupt
135 //!
136 //! \return None
137 //
138 //*****************************************************************************
139 extern void SFR_clearInterrupt(uint8_t interruptFlagMask);
140 
141 //*****************************************************************************
142 //
143 // Mark the end of the C bindings section for C++ compilers.
144 //
145 //*****************************************************************************
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif
151 #endif // __MSP430WARE_SFR_H__
void SFR_disableInterrupt(uint8_t interruptMask)
Disables selected SFR interrupt sources.
Definition: sfr.c:26
uint8_t SFR_getInterruptStatus(uint8_t interruptFlagMask)
Returns the status of the selected SFR interrupt flags.
Definition: sfr.c:31
void SFR_enableInterrupt(uint8_t interruptMask)
Enables selected SFR interrupt sources.
Definition: sfr.c:21
void SFR_clearInterrupt(uint8_t interruptFlagMask)
Clears the selected SFR interrupt flags.
Definition: sfr.c:36

Copyright 2020, Texas Instruments Incorporated