2020-2021 Sunseeker Telemetry and Lighting System
flashctl.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // flashctl.h - Driver for the FLASHCTL Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_FLASHCTL_H__
8 #define __MSP430WARE_FLASHCTL_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_FLASH__
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 mask parameter for
28 // functions: FlashCtl_getStatus() as well as returned by the
29 // FlashCtl_getStatus() function.
30 //
31 //*****************************************************************************
32 #define FLASHCTL_READY_FOR_NEXT_WRITE WAIT
33 #define FLASHCTL_ACCESS_VIOLATION_INTERRUPT_FLAG ACCVIFG
34 #define FLASHCTL_PASSWORD_WRITTEN_INCORRECTLY KEYV
35 #define FLASHCTL_BUSY BUSY
36 
37 //*****************************************************************************
38 //
39 // Prototypes for the APIs.
40 //
41 //*****************************************************************************
42 
43 //*****************************************************************************
44 //
54 //
55 //*****************************************************************************
56 extern void FlashCtl_eraseSegment(uint8_t *flash_ptr);
57 
58 //*****************************************************************************
59 //
68 //
69 //*****************************************************************************
70 extern void FlashCtl_eraseBank(uint8_t *flash_ptr);
71 
72 //*****************************************************************************
73 //
86 //
87 //*****************************************************************************
88 extern void FlashCtl_performMassErase(uint8_t *flash_ptr);
89 
90 //*****************************************************************************
91 //
101 //
102 //*****************************************************************************
103 extern bool FlashCtl_performEraseCheck(uint8_t *flash_ptr,
104  uint16_t numberOfBytes);
105 
106 //*****************************************************************************
107 //
119 //
120 //*****************************************************************************
121 extern void FlashCtl_write8(uint8_t *data_ptr,
122  uint8_t *flash_ptr,
123  uint16_t count);
124 
125 //*****************************************************************************
126 //
139 //
140 //*****************************************************************************
141 extern void FlashCtl_write16(uint16_t *data_ptr,
142  uint16_t *flash_ptr,
143  uint16_t count);
144 
145 //*****************************************************************************
146 //
159 //
160 //*****************************************************************************
161 extern void FlashCtl_write32(uint32_t *data_ptr,
162  uint32_t *flash_ptr,
163  uint16_t count);
164 
165 //*****************************************************************************
166 //
179 //
180 //*****************************************************************************
181 extern void FlashCtl_fillMemory32(uint32_t value,
182  uint32_t *flash_ptr,
183  uint16_t count);
184 
185 //*****************************************************************************
186 //
206 //
207 //*****************************************************************************
208 extern uint8_t FlashCtl_getStatus(uint8_t mask);
209 
210 //*****************************************************************************
211 //
220 //
221 //*****************************************************************************
222 extern void FlashCtl_lockInfoA(void);
223 
224 //*****************************************************************************
225 //
233 //
234 //*****************************************************************************
235 extern void FlashCtl_unlockInfoA(void);
236 
237 //*****************************************************************************
238 //
239 // Mark the end of the C bindings section for C++ compilers.
240 //
241 //*****************************************************************************
242 #ifdef __cplusplus
243 }
244 #endif
245 
246 #endif
247 #endif // __MSP430WARE_FLASHCTL_H__