MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
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 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
57 /***** Definitions *****/
58 
60 #define MXC_FLASH_PAGE_MASK ~(MXC_FLASH_PAGE_SIZE - 1)
61 
63 #define MXC_FLASH_PAGE_ADDR(page) (MXC_FLASH_MEM_BASE + ((unsigned long)page * MXC_FLASH_PAGE_SIZE))
64 
65 /***** Function Prototypes *****/
66 
71 int MXC_FLC_Init();
72 
79 int MXC_FLC_Busy (void);
80 
86 int MXC_FLC_MassErase (void);
87 
94 int MXC_FLC_PageErase (uint32_t address);
95 
104 void MXC_FLC_Read (int address, void* buffer, int len);
105 
115 int MXC_FLC_Write (uint32_t address, uint32_t length, uint32_t *buffer);
116 
125 int MXC_FLC_Write32 (uint32_t address, uint32_t data);
126 
135 int MXC_FLC_Write128 (uint32_t address, uint32_t *data);
136 
142 int MXC_FLC_EnableInt (uint32_t flags);
143 
149 int MXC_FLC_DisableInt (uint32_t flags);
150 
155 int MXC_FLC_GetFlags (void);
156 
163 int MXC_FLC_ClearFlags (uint32_t flags);
164 
172 int MXC_FLC_UnlockInfoBlock (uint32_t address);
173 
180 int MXC_FLC_LockInfoBlock (uint32_t address);
181 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #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.