MAX32655 Peripheral Driver API
Peripheral Driver API for the MAX32655
flc.h
1 
7 /* ****************************************************************************
8  * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a
11  * copy of this software and associated documentation files (the "Software"),
12  * to deal in the Software without restriction, including without limitation
13  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  * and/or sell copies of the Software, and to permit persons to whom the
15  * Software is furnished to do so, subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be included
18  * in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
24  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26  * OTHER DEALINGS IN THE SOFTWARE.
27  *
28  * Except as contained in this notice, the name of Maxim Integrated
29  * Products, Inc. shall not be used except as stated in the Maxim Integrated
30  * Products, Inc. Branding Policy.
31  *
32  * The mere transfer of this software does not imply any licenses
33  * of trade secrets, proprietary technology, copyrights, patents,
34  * trademarks, maskwork rights, or any other form of intellectual
35  * property whatsoever. Maxim Integrated Products, Inc. retains all
36  * ownership rights.
37  *
38  * $Date: 2018-11-08 09:36:51 -0600 (Thu, 08 Nov 2018) $
39  * $Revision: 39038 $
40  *
41  *************************************************************************** */
42 
43 #ifndef _FLC_H_
44 #define _FLC_H_
45 
46 /* **** Includes **** */
47 #include "flc_regs.h"
48 #include "mxc_sys.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
60 /***** Definitions *****/
61 
63 #define MXC_FLASH_PAGE_MASK ~(MXC_FLASH_PAGE_SIZE - 1)
64 
66 #define MXC_FLASH_PAGE_ADDR(page) (MXC_FLASH_MEM_BASE + ((unsigned long)page * MXC_FLASH_PAGE_SIZE))
67 
68 /***** Function Prototypes *****/
69 
74 int MXC_FLC_Init();
75 
82 int MXC_FLC_Busy (void);
83 
89 int MXC_FLC_MassErase (void);
90 
97 int MXC_FLC_PageErase (uint32_t address);
98 
107 void MXC_FLC_Read (int address, void* buffer, int len);
108 
118 int MXC_FLC_Write (uint32_t address, uint32_t length, uint32_t *buffer);
119 
128 int MXC_FLC_Write32 (uint32_t address, uint32_t data);
129 
138 int MXC_FLC_Write128 (uint32_t address, uint32_t *data);
139 
145 int MXC_FLC_EnableInt (uint32_t flags);
146 
152 int MXC_FLC_DisableInt (uint32_t flags);
153 
158 int MXC_FLC_GetFlags (void);
159 
166 int MXC_FLC_ClearFlags (uint32_t flags);
167 
175 int MXC_FLC_UnlockInfoBlock (uint32_t address);
176 
183 int MXC_FLC_LockInfoBlock (uint32_t address);
184 
187 #ifdef __cplusplus
188 }
189 #endif
190 
191 #endif /* _FLC_H_ */
int MXC_FLC_Write(uint32_t address, uint32_t length, uint32_t *buffer)
Writes data to flash.
int MXC_FLC_GetFlags(void)
Retrieve flash interrupt flags.
int MXC_FLC_PageErase(uint32_t address)
Erases the page of flash at the specified address.
int MXC_FLC_LockInfoBlock(uint32_t address)
Lock info block.
int MXC_FLC_MassErase(void)
Erases the entire flash array.
int MXC_FLC_Init()
Initializes the Flash Controller for erase/write operations.
int MXC_FLC_ClearFlags(uint32_t flags)
Clear flash interrupt flags.
int MXC_FLC_DisableInt(uint32_t flags)
Disable flash interrupts.
void MXC_FLC_Read(int address, void *buffer, int len)
Read Data out of Flash from an address.
int MXC_FLC_Write32(uint32_t address, uint32_t data)
Writes 32 bits of data to flash.
int MXC_FLC_UnlockInfoBlock(uint32_t address)
Unlock info block.
int MXC_FLC_Busy(void)
Checks if Flash Controller is busy.
int MXC_FLC_EnableInt(uint32_t flags)
Enable flash interrupts.
int MXC_FLC_Write128(uint32_t address, uint32_t *data)
Writes 128 bits of data to flash.