MAX32665 Peripheral Driver API
Peripheral Driver API for the MAX32665
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  *************************************************************************** */
39 
40 #ifndef _FLC_H_
41 #define _FLC_H_
42 
43 /* **** Includes **** */
44 #include "flc_regs.h"
45 #include "mxc_sys.h"
46 #include "mxc_errors.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
58 /***** Definitions *****/
59 
61 #define MXC_FLASH_PAGE_MASK ~(MXC_FLASH_PAGE_SIZE - 1)
62 
64 #define MXC_FLASH_PAGE_ADDR(page) (MXC_FLASH_MEM_BASE + ((unsigned long)page * MXC_FLASH_PAGE_SIZE))
65 
66 /***** Function Prototypes *****/
67 
73 
80 int MXC_FLC_Busy (void);
81 
87 int MXC_FLC_MassErase (void);
88 
95 int MXC_FLC_PageErase (uint32_t address);
96 
105 void MXC_FLC_Read (int address, void* buffer, int len);
106 
116 int MXC_FLC_Write (uint32_t address, uint32_t length, uint32_t *buffer);
117 
126 int MXC_FLC_Write32 (uint32_t address, uint32_t data);
127 
136 int MXC_FLC_Write128 (uint32_t address, uint32_t *data);
137 
143 int MXC_FLC_EnableInt (uint32_t flags);
144 
150 int MXC_FLC_DisableInt (uint32_t flags);
151 
156 int MXC_FLC_GetFlags (void);
157 
164 int MXC_FLC_ClearFlags (uint32_t flags);
165 
173 int MXC_FLC_UnlockInfoBlock (uint32_t address);
174 
181 int MXC_FLC_LockInfoBlock (uint32_t address);
182 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 #endif /* _FLC_H_ */
MXC_FLC_Write128
int MXC_FLC_Write128(uint32_t address, uint32_t *data)
Writes 128 bits of data to flash.
MXC_FLC_DisableInt
int MXC_FLC_DisableInt(uint32_t flags)
Disable flash interrupts.
MXC_FLC_LockInfoBlock
int MXC_FLC_LockInfoBlock(uint32_t address)
Lock info block.
MXC_FLC_ClearFlags
int MXC_FLC_ClearFlags(uint32_t flags)
Clear flash interrupt flags.
MXC_FLC_Write
int MXC_FLC_Write(uint32_t address, uint32_t length, uint32_t *buffer)
Writes data to flash.
MXC_FLC_Init
int MXC_FLC_Init()
Initializes the Flash Controller for erase/write operations.
MXC_FLC_GetFlags
int MXC_FLC_GetFlags(void)
Retrieve flash interrupt flags.
MXC_FLC_MassErase
int MXC_FLC_MassErase(void)
Erases the entire flash array.
MXC_FLC_EnableInt
int MXC_FLC_EnableInt(uint32_t flags)
Enable flash interrupts.
MXC_FLC_Read
void MXC_FLC_Read(int address, void *buffer, int len)
Read Data out of Flash from an address.
MXC_FLC_Write32
int MXC_FLC_Write32(uint32_t address, uint32_t data)
Writes 32 bits of data to flash.
MXC_FLC_UnlockInfoBlock
int MXC_FLC_UnlockInfoBlock(uint32_t address)
Unlock info block.
MXC_FLC_PageErase
int MXC_FLC_PageErase(uint32_t address)
Erases the page of flash at the specified address.
MXC_FLC_Busy
int MXC_FLC_Busy(void)
Checks if Flash Controller is busy.