MSP430 DriverLib for MSP430FR2xx_4xx Devices  2.10.00.09
 All Data Structures Functions Variables Modules Pages
framctl.h
1 //*****************************************************************************
2 //
3 // framctl.h - Driver for the FRAMCTL Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_FRAMCTL_H__
8 #define __MSP430WARE_FRAMCTL_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_FRAM__
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: FRAMCtl_enableInterrupt(), and FRAMCtl_disableInterrupt().
29 //
30 //*****************************************************************************
31 #define FRAMCTL_PUC_ON_UNCORRECTABLE_BIT UBDRSTEN
32 #define FRAMCTL_UNCORRECTABLE_BIT_INTERRUPT UBDIE
33 #define FRAMCTL_CORRECTABLE_BIT_INTERRUPT CBDIE
34 #define FRAMCTL_ACCESS_TIME_ERROR_INTERRUPT ACCTEIE
35 
36 //*****************************************************************************
37 //
38 // The following are values that can be passed to the interruptFlagMask
39 // parameter for functions: FRAMCtl_getInterruptStatus() as well as returned by
40 // the FRAMCtl_getInterruptStatus() function.
41 //
42 //*****************************************************************************
43 #define FRAMCTL_ACCESS_TIME_ERROR_FLAG ACCTEIFG
44 #define FRAMCTL_UNCORRECTABLE_BIT_FLAG UBDIFG
45 #define FRAMCTL_CORRECTABLE_BIT_FLAG CBDIFG
46 
47 //*****************************************************************************
48 //
49 // The following are values that can be passed to the waitState parameter for
50 // functions: FRAMCtl_configureWaitStateControl().
51 //
52 //*****************************************************************************
53 #define FRAMCTL_ACCESS_TIME_CYCLES_0 NWAITS_0
54 #define FRAMCTL_ACCESS_TIME_CYCLES_1 NWAITS_1
55 #define FRAMCTL_ACCESS_TIME_CYCLES_2 NWAITS_2
56 #define FRAMCTL_ACCESS_TIME_CYCLES_3 NWAITS_3
57 #define FRAMCTL_ACCESS_TIME_CYCLES_4 NWAITS_4
58 #define FRAMCTL_ACCESS_TIME_CYCLES_5 NWAITS_5
59 #define FRAMCTL_ACCESS_TIME_CYCLES_6 NWAITS_6
60 #define FRAMCTL_ACCESS_TIME_CYCLES_7 NWAITS_7
61 
62 //*****************************************************************************
63 //
64 // The following are values that can be passed to the delayStatus parameter for
65 // functions: FRAMCtl_delayPowerUpFromLPM().
66 //
67 //*****************************************************************************
68 #define FRAMCTL_DELAY_FROM_LPM_ENABLE 0x00
69 #define FRAMCTL_DELAY_FROM_LPM_DISABLE 0x02
70 
71 //*****************************************************************************
72 //
73 // Prototypes for the APIs.
74 //
75 //*****************************************************************************
76 
77 //*****************************************************************************
78 //
79 //! \brief Write data into the fram memory in byte format.
80 //!
81 //! \param dataPtr is the pointer to the data to be written
82 //! \param framPtr is the pointer into which to write the data
83 //! \param numberOfBytes is the number of bytes to be written
84 //!
85 //! \return None
86 //
87 //*****************************************************************************
88 extern void FRAMCtl_write8(uint8_t *dataPtr,
89  uint8_t *framPtr,
90  uint16_t numberOfBytes);
91 
92 //*****************************************************************************
93 //
94 //! \brief Write data into the fram memory in word format.
95 //!
96 //! \param dataPtr is the pointer to the data to be written
97 //! \param framPtr is the pointer into which to write the data
98 //! \param numberOfWords is the number of words to be written
99 //!
100 //! \return None
101 //
102 //*****************************************************************************
103 extern void FRAMCtl_write16(uint16_t *dataPtr,
104  uint16_t *framPtr,
105  uint16_t numberOfWords);
106 
107 //*****************************************************************************
108 //
109 //! \brief Write data into the fram memory in long format, pass by reference
110 //!
111 //! \param dataPtr is the pointer to the data to be written
112 //! \param framPtr is the pointer into which to write the data
113 //! \param count is the number of 32 bit words to be written
114 //!
115 //! \return None
116 //
117 //*****************************************************************************
118 extern void FRAMCtl_write32(uint32_t *dataPtr,
119  uint32_t *framPtr,
120  uint16_t count);
121 
122 //*****************************************************************************
123 //
124 //! \brief Write data into the fram memory in long format, pass by value
125 //!
126 //! \param value is the value to written to FRAMCTL memory
127 //! \param framPtr is the pointer into which to write the data
128 //! \param count is the number of 32 bit addresses to fill
129 //!
130 //! \return None
131 //
132 //*****************************************************************************
133 extern void FRAMCtl_fillMemory32(uint32_t value,
134  uint32_t *framPtr,
135  uint16_t count);
136 
137 //*****************************************************************************
138 //
139 //! \brief Enables selected FRAMCtl interrupt sources.
140 //!
141 //! Enables the indicated FRAMCtl interrupt sources. Only the sources that are
142 //! enabled can be reflected to the processor interrupt; disabled sources have
143 //! no effect on the processor. Does not clear interrupt flags.
144 //!
145 //! \param interruptMask is the bit mask of the memory buffer interrupt sources
146 //! to be disabled.
147 //! Mask value is the logical OR of any of the following:
148 //! - \b FRAMCTL_PUC_ON_UNCORRECTABLE_BIT - Enable PUC reset if FRAMCtl
149 //! uncorrectable bit error detected.
150 //! - \b FRAMCTL_UNCORRECTABLE_BIT_INTERRUPT - Interrupts when an
151 //! uncorrectable bit error is detected.
152 //! - \b FRAMCTL_CORRECTABLE_BIT_INTERRUPT - Interrupts when a
153 //! correctable bit error is detected.
154 //! - \b FRAMCTL_ACCESS_TIME_ERROR_INTERRUPT - Interrupts when an access
155 //! time error occurs.
156 //!
157 //! Modified bits of \b GCCTL0 register and bits of \b FRCTL0 register.
158 //!
159 //! \return None
160 //
161 //*****************************************************************************
162 extern void FRAMCtl_enableInterrupt(uint8_t interruptMask);
163 
164 //*****************************************************************************
165 //
166 //! \brief Returns the status of the selected FRAMCtl interrupt flags.
167 //!
168 //! \param interruptFlagMask is a bit mask of the interrupt flags status to be
169 //! returned.
170 //! Mask value is the logical OR of any of the following:
171 //! - \b FRAMCTL_ACCESS_TIME_ERROR_FLAG - Interrupt flag is set if a
172 //! wrong setting for NPRECHG and NACCESS is set and FRAMCtl access
173 //! time is not hold.
174 //! - \b FRAMCTL_UNCORRECTABLE_BIT_FLAG - Interrupt flag is set if an
175 //! uncorrectable bit error has been detected in the FRAMCtl memory
176 //! error detection logic.
177 //! - \b FRAMCTL_CORRECTABLE_BIT_FLAG - Interrupt flag is set if a
178 //! correctable bit error has been detected and corrected in the
179 //! FRAMCtl memory error detection logic.
180 //!
181 //! \return Logical OR of any of the following:
182 //! - \b FRAMCtl_ACCESS_TIME_ERROR_FLAG Interrupt flag is set if a
183 //! wrong setting for NPRECHG and NACCESS is set and FRAMCtl access
184 //! time is not hold.
185 //! - \b FRAMCtl_UNCORRECTABLE_BIT_FLAG Interrupt flag is set if an
186 //! uncorrectable bit error has been detected in the FRAMCtl memory
187 //! error detection logic.
188 //! - \b FRAMCtl_CORRECTABLE_BIT_FLAG Interrupt flag is set if a
189 //! correctable bit error has been detected and corrected in the
190 //! FRAMCtl memory error detection logic.
191 //! \n indicating the status of the masked flags
192 //
193 //*****************************************************************************
194 extern uint8_t FRAMCtl_getInterruptStatus(uint16_t interruptFlagMask);
195 
196 //*****************************************************************************
197 //
198 //! \brief Disables selected FRAMCtl interrupt sources.
199 //!
200 //! Disables the indicated FRAMCtl interrupt sources. Only the sources that
201 //! are enabled can be reflected to the processor interrupt; disabled sources
202 //! have no effect on the processor.
203 //!
204 //! \param interruptMask is the bit mask of the memory buffer interrupt sources
205 //! to be disabled.
206 //! Mask value is the logical OR of any of the following:
207 //! - \b FRAMCTL_PUC_ON_UNCORRECTABLE_BIT - Enable PUC reset if FRAMCtl
208 //! uncorrectable bit error detected.
209 //! - \b FRAMCTL_UNCORRECTABLE_BIT_INTERRUPT - Interrupts when an
210 //! uncorrectable bit error is detected.
211 //! - \b FRAMCTL_CORRECTABLE_BIT_INTERRUPT - Interrupts when a
212 //! correctable bit error is detected.
213 //! - \b FRAMCTL_ACCESS_TIME_ERROR_INTERRUPT - Interrupts when an access
214 //! time error occurs.
215 //!
216 //! \return None
217 //
218 //*****************************************************************************
219 extern void FRAMCtl_disableInterrupt(uint16_t interruptMask);
220 
221 //*****************************************************************************
222 //
223 //! \brief Configures the access time of the FRAMCtl module
224 //!
225 //! Configures the access time of the FRAMCtl module.
226 //!
227 //! \param waitState defines the number of CPU cycles required for access time
228 //! defined in the datasheet
229 //! Valid values are:
230 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_0
231 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_1
232 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_2
233 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_3
234 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_4
235 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_5
236 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_6
237 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_7
238 //!
239 //! Modified bits are \b NWAITS of \b GCCTL0 register.
240 //!
241 //! \return None
242 //
243 //*****************************************************************************
244 extern void FRAMCtl_configureWaitStateControl(uint8_t waitState);
245 
246 //*****************************************************************************
247 //
248 //! \brief Configures when the FRAMCtl module will power up after LPM exit
249 //!
250 //! Configures when the FRAMCtl module will power up after LPM exit. The module
251 //! can either wait until the first FRAMCtl access to power up or power up
252 //! immediately after leaving LPM. If FRAMCtl power is disabled, a memory
253 //! access will automatically insert wait states to ensure sufficient timing
254 //! for the FRAMCtl power-up and access.
255 //!
256 //! \param delayStatus chooses if FRAMCTL should power up instantly with LPM
257 //! exit or to wait until first FRAMCTL access after LPM exit
258 //! Valid values are:
259 //! - \b FRAMCTL_DELAY_FROM_LPM_ENABLE
260 //! - \b FRAMCTL_DELAY_FROM_LPM_DISABLE
261 //!
262 //! \return None
263 //
264 //*****************************************************************************
265 extern void FRAMCtl_delayPowerUpFromLPM(uint8_t delayStatus);
266 
267 //*****************************************************************************
268 //
269 // Mark the end of the C bindings section for C++ compilers.
270 //
271 //*****************************************************************************
272 #ifdef __cplusplus
273 }
274 #endif
275 
276 #endif
277 #endif // __MSP430WARE_FRAMCTL_H__
void FRAMCtl_disableInterrupt(uint16_t interruptMask)
Disables selected FRAMCtl interrupt sources.
Definition: framctl.c:146
void FRAMCtl_configureWaitStateControl(uint8_t waitState)
Configures the access time of the FRAMCtl module.
Definition: framctl.c:157
void FRAMCtl_write16(uint16_t *dataPtr, uint16_t *framPtr, uint16_t numberOfWords)
Write data into the fram memory in word format.
Definition: framctl.c:49
void FRAMCtl_enableInterrupt(uint8_t interruptMask)
Enables selected FRAMCtl interrupt sources.
Definition: framctl.c:129
void FRAMCtl_fillMemory32(uint32_t value, uint32_t *framPtr, uint16_t count)
Write data into the fram memory in long format, pass by value.
Definition: framctl.c:101
void FRAMCtl_write32(uint32_t *dataPtr, uint32_t *framPtr, uint16_t count)
Write data into the fram memory in long format, pass by reference.
Definition: framctl.c:75
uint8_t FRAMCtl_getInterruptStatus(uint16_t interruptFlagMask)
Returns the status of the selected FRAMCtl interrupt flags.
Definition: framctl.c:141
void FRAMCtl_write8(uint8_t *dataPtr, uint8_t *framPtr, uint16_t numberOfBytes)
Write data into the fram memory in byte format.
Definition: framctl.c:21
void FRAMCtl_delayPowerUpFromLPM(uint8_t delayStatus)
Configures when the FRAMCtl module will power up after LPM exit.
Definition: framctl.c:166

Copyright 2015, Texas Instruments Incorporated