MSP430 DriverLib for MSP430FR57xx 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_FR5XX__
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 UBDIEN
33 #define FRAMCTL_CORRECTABLE_BIT_INTERRUPT CBDIEN
34 #define FRAMCTL_ACCESS_VIOLATION_INTERRUPT ACCVIE
35 #define FRAMCTL_ACCESS_TIME_ERROR_INTERRUPT ACCTEIE
36 
37 //*****************************************************************************
38 //
39 // The following are values that can be passed to the interruptFlagMask
40 // parameter for functions: FRAMCtl_getInterruptStatus() as well as returned by
41 // the FRAMCtl_getInterruptStatus() function.
42 //
43 //*****************************************************************************
44 #define FRAMCTL_ACCESS_TIME_ERROR_FLAG ACCTEIFG
45 #define FRAMCTL_UNCORRECTABLE_BIT_FLAG UBDIFG
46 #define FRAMCTL_CORRECTABLE_BIT_FLAG CBDIFG
47 #define FRAMCTL_ACCESS_VIOLATION_FLAG ACCVIFG
48 
49 //*****************************************************************************
50 //
51 // The following are values that can be passed to the accessTime parameter for
52 // functions: FRAMCtl_configureWaitStateControl().
53 //
54 //*****************************************************************************
55 #define FRAMCTL_ACCESS_TIME_CYCLES_0 NACCESS_0
56 #define FRAMCTL_ACCESS_TIME_CYCLES_1 NACCESS_1
57 #define FRAMCTL_ACCESS_TIME_CYCLES_2 NACCESS_2
58 #define FRAMCTL_ACCESS_TIME_CYCLES_3 NACCESS_3
59 #define FRAMCTL_ACCESS_TIME_CYCLES_4 NACCESS_4
60 #define FRAMCTL_ACCESS_TIME_CYCLES_5 NACCESS_5
61 #define FRAMCTL_ACCESS_TIME_CYCLES_6 NACCESS_6
62 #define FRAMCTL_ACCESS_TIME_CYCLES_7 NACCESS_7
63 
64 //*****************************************************************************
65 //
66 // The following are values that can be passed to the accessTime parameter for
67 // functions: FRAMCtl_configureWaitStateControl().
68 //
69 //*****************************************************************************
70 #define FRAMCTL_PRECHARGE_TIME_CYCLES_0 NPRECHG_0
71 #define FRAMCTL_PRECHARGE_TIME_CYCLES_1 NPRECHG_1
72 #define FRAMCTL_PRECHARGE_TIME_CYCLES_2 NPRECHG_2
73 #define FRAMCTL_PRECHARGE_TIME_CYCLES_3 NPRECHG_3
74 #define FRAMCTL_PRECHARGE_TIME_CYCLES_4 NPRECHG_4
75 #define FRAMCTL_PRECHARGE_TIME_CYCLES_5 NPRECHG_5
76 #define FRAMCTL_PRECHARGE_TIME_CYCLES_6 NPRECHG_6
77 #define FRAMCTL_PRECHARGE_TIME_CYCLES_7 NPRECHG_7
78 
79 //*****************************************************************************
80 //
81 // The following are values that can be passed to the manualWaitState parameter
82 // for functions: FRAMCtl_configureWaitStateControl().
83 //
84 //*****************************************************************************
85 #define FRAMCTL_AUTO_MODE NAUTO
86 #define FRAMCTL_MANUAL_MODE 0x00
87 
88 //*****************************************************************************
89 //
90 // Prototypes for the APIs.
91 //
92 //*****************************************************************************
93 
94 //*****************************************************************************
95 //
96 //! \brief Write data into the fram memory in byte format.
97 //!
98 //! \param dataPtr is the pointer to the data to be written
99 //! \param framPtr is the pointer into which to write the data
100 //! \param numberOfBytes is the number of bytes to be written
101 //!
102 //! \return None
103 //
104 //*****************************************************************************
105 extern void FRAMCtl_write8(uint8_t *dataPtr,
106  uint8_t *framPtr,
107  uint16_t numberOfBytes);
108 
109 //*****************************************************************************
110 //
111 //! \brief Write data into the fram memory in word format.
112 //!
113 //! \param dataPtr is the pointer to the data to be written
114 //! \param framPtr is the pointer into which to write the data
115 //! \param numberOfWords
116 //!
117 //
118 //*****************************************************************************
119 extern void FRAMCtl_write16(uint16_t *dataPtr,
120  uint16_t *framPtr,
121  uint16_t numberOfWords);
122 
123 //*****************************************************************************
124 //
125 //! \brief Write data into the fram memory in long format, pass by reference
126 //!
127 //! \param dataPtr is the pointer to the data to be written
128 //! \param framPtr is the pointer into which to write the data
129 //! \param count
130 //!
131 //
132 //*****************************************************************************
133 extern void FRAMCtl_write32(uint32_t *dataPtr,
134  uint32_t *framPtr,
135  uint16_t count);
136 
137 //*****************************************************************************
138 //
139 //! \brief Write data into the fram memory in long format, pass by value
140 //!
141 //! \param value is the value to written to FRAMCTL memory
142 //! \param framPtr is the pointer into which to write the data
143 //! \param count
144 //!
145 //
146 //*****************************************************************************
147 extern void FRAMCtl_memoryFill32(uint32_t value,
148  uint32_t *framPtr,
149  uint16_t count);
150 
151 //*****************************************************************************
152 //
153 //! \brief Enables selected FRAMCtl interrupt sources.
154 //!
155 //! If header file contains legacy definitions: FRAMCtl_PUC_ON_DOUBLE_BIT_ERROR
156 //! - Enable PUC reset if FRAMCtl detects double bit error is detected.
157 //! FRAMCtl_DOUBLE_BIT_ERROR_INTERRUPT - Interrupts when a double bit error is
158 //! detected. FRAMCtl_SINGLE_BIT_ERROR_INTERRUPT - Interrupts when a single bit
159 //! error is detected.
160 //!
161 //! \param interruptMask is the bit mask of the memory buffer interrupt sources
162 //! to be disabled.
163 //! Mask value is the logical OR of any of the following:
164 //! - \b FRAMCTL_PUC_ON_UNCORRECTABLE_BIT - Enable PUC reset if FRAMCtl
165 //! uncorrectable bit error detected.
166 //! - \b FRAMCTL_UNCORRECTABLE_BIT_INTERRUPT - Interrupts when an
167 //! uncorrectable bit error is detected.
168 //! - \b FRAMCTL_CORRECTABLE_BIT_INTERRUPT - Interrupts when a
169 //! correctable bit error is detected.
170 //! - \b FRAMCTL_ACCESS_VIOLATION_INTERRUPT - Interrupts when an access
171 //! violation occurs.
172 //! - \b FRAMCTL_ACCESS_TIME_ERROR_INTERRUPT - Interrupts when an access
173 //! time error occurs.
174 //!
175 //! \return None
176 //
177 //*****************************************************************************
178 extern void FRAMCtl_enableInterrupt(uint8_t interruptMask);
179 
180 //*****************************************************************************
181 //
182 //! \brief Returns the status of the selected FRAMCtl interrupt flags.
183 //!
184 //! If header file contains legacy definitions: FRAMCtl_SINGLE_BIT_ERROR_FLAG -
185 //! Interrupt flag is set if a correctable bit error has been detected and
186 //! corrected in the FRAMCtl memory error detection logic.
187 //! FRAMCtl_DOUBLE_BIT_ERROR_FLAG .- Interrupt flag is set if an uncorrectable
188 //! bit error has been detected in the FRAMCtl memory error detection logic.
189 //!
190 //! \param interruptFlagMask is a bit mask of the interrupt flags status to be
191 //! returned.
192 //! Mask value is the logical OR of any of the following:
193 //! - \b FRAMCTL_ACCESS_TIME_ERROR_FLAG - Interrupt flag is set if a
194 //! wrong setting for NPRECHG and NACCESS is set and FRAMCtl access
195 //! time is not hold.
196 //! - \b FRAMCTL_UNCORRECTABLE_BIT_FLAG - Interrupt flag is set if an
197 //! uncorrectable bit error has been detected in the FRAMCtl memory
198 //! error detection logic.
199 //! - \b FRAMCTL_CORRECTABLE_BIT_FLAG - Interrupt flag is set if a
200 //! correctable bit error has been detected and corrected in the
201 //! FRAMCtl memory error detection logic.
202 //! - \b FRAMCTL_ACCESS_VIOLATION_FLAG - Interrupt flag is set if an
203 //! access violation is triggered.
204 //!
205 //! \return The current interrupt flag status for the corresponding mask.
206 //! Return Logical OR of any of the following:
207 //! - \b FRAMCtl_ACCESS_TIME_ERROR_FLAG Interrupt flag is set if a
208 //! wrong setting for NPRECHG and NACCESS is set and FRAMCtl access
209 //! time is not hold.
210 //! - \b FRAMCtl_UNCORRECTABLE_BIT_FLAG Interrupt flag is set if an
211 //! uncorrectable bit error has been detected in the FRAMCtl memory
212 //! error detection logic.
213 //! - \b FRAMCtl_CORRECTABLE_BIT_FLAG Interrupt flag is set if a
214 //! correctable bit error has been detected and corrected in the
215 //! FRAMCtl memory error detection logic.
216 //! - \b FRAMCtl_ACCESS_VIOLATION_FLAG Interrupt flag is set if an
217 //! access violation is triggered.
218 //! \n indicating the status of the masked flags
219 //
220 //*****************************************************************************
221 extern uint8_t FRAMCtl_getInterruptStatus(uint16_t interruptFlagMask);
222 
223 //*****************************************************************************
224 //
225 //! \brief Disables selected FRAMCtl interrupt sources.
226 //!
227 //! If header file contains legacy definitions: FRAMCtl_PUC_ON_DOUBLE_BIT_ERROR
228 //! - Enable PUC reset if FRAMCtl detects double bit error is detected.
229 //! FRAMCtl_DOUBLE_BIT_ERROR_INTERRUPT - Interrupts when a double bit error is
230 //! detected. FRAMCtl_SINGLE_BIT_ERROR_INTERRUPT - Interrupts when a single bit
231 //! error is detected.
232 //!
233 //! \param interruptMask is the bit mask of the memory buffer interrupt sources
234 //! to be disabled.
235 //! Mask value is the logical OR of any of the following:
236 //! - \b FRAMCTL_PUC_ON_UNCORRECTABLE_BIT - Enable PUC reset if FRAMCtl
237 //! uncorrectable bit error detected.
238 //! - \b FRAMCTL_UNCORRECTABLE_BIT_INTERRUPT - Interrupts when an
239 //! uncorrectable bit error is detected.
240 //! - \b FRAMCTL_CORRECTABLE_BIT_INTERRUPT - Interrupts when a
241 //! correctable bit error is detected.
242 //! - \b FRAMCTL_ACCESS_VIOLATION_INTERRUPT - Interrupts when an access
243 //! violation occurs.
244 //! - \b FRAMCTL_ACCESS_TIME_ERROR_INTERRUPT - Interrupts when an access
245 //! time error occurs.
246 //!
247 //! \return None
248 //
249 //*****************************************************************************
250 extern void FRAMCtl_disableInterrupt(uint16_t interruptMask);
251 
252 //*****************************************************************************
253 //
254 //! \brief Configures the wait state control of the FRAMCtl module
255 //! Configures the wait state control of the FRAM module. If using the
256 //! FRAMCtl_AUTO_MODE the values for accessTime and prechargeTime do not
257 //! matter.
258 //!
259 //! \param manualWaitState chooses if the wait state control is manual or
260 //! automatic
261 //! Valid values are:
262 //! - \b FRAMCTL_AUTO_MODE
263 //! - \b FRAMCTL_MANUAL_MODE
264 //! \param accessTime
265 //! Valid values are:
266 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_0
267 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_1
268 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_2
269 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_3
270 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_4
271 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_5
272 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_6
273 //! - \b FRAMCTL_ACCESS_TIME_CYCLES_7
274 //! - \b FRAMCTL_PRECHARGE_TIME_CYCLES_0
275 //! - \b FRAMCTL_PRECHARGE_TIME_CYCLES_1
276 //! - \b FRAMCTL_PRECHARGE_TIME_CYCLES_2
277 //! - \b FRAMCTL_PRECHARGE_TIME_CYCLES_3
278 //! - \b FRAMCTL_PRECHARGE_TIME_CYCLES_4
279 //! - \b FRAMCTL_PRECHARGE_TIME_CYCLES_5
280 //! - \b FRAMCTL_PRECHARGE_TIME_CYCLES_6
281 //! - \b FRAMCTL_PRECHARGE_TIME_CYCLES_7
282 //! \param prechargeTime
283 //!
284 //
285 //*****************************************************************************
286 extern void FRAMCtl_configureWaitStateControl(uint8_t manualWaitState,
287  uint8_t accessTime,
288  uint8_t prechargeTime);
289 
290 //*****************************************************************************
291 //
292 // Mark the end of the C bindings section for C++ compilers.
293 //
294 //*****************************************************************************
295 #ifdef __cplusplus
296 }
297 #endif
298 
299 #endif
300 #endif // __MSP430WARE_FRAMCTL_H__
void FRAMCtl_disableInterrupt(uint16_t interruptMask)
Disables selected FRAMCtl interrupt sources.
Definition: framctl.c:89
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:70
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:46
void FRAMCtl_memoryFill32(uint32_t value, uint32_t *framPtr, uint16_t count)
Write data into the fram memory in long format, pass by value.
Definition: framctl.c:57
uint8_t FRAMCtl_getInterruptStatus(uint16_t interruptFlagMask)
Returns the status of the selected FRAMCtl interrupt flags.
Definition: framctl.c:84
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_configureWaitStateControl(uint8_t manualWaitState, uint8_t accessTime, uint8_t prechargeTime)
Configures the wait state control of the FRAMCtl module Configures the wait state control of the FRAM...
Definition: framctl.c:100

Copyright 2015, Texas Instruments Incorporated