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

Copyright 2015, Texas Instruments Incorporated