MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
flc.h
1
7/******************************************************************************
8 *
9 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
10 * Analog Devices, Inc.),
11 * Copyright (C) 2023-2024 Analog Devices, Inc.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 ******************************************************************************/
26
27#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_FLC_H_
28#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_FLC_H_
29
30/* **** Includes **** */
31#include "flc_regs.h"
32#include "mxc_sys.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
44/***** Definitions *****/
45
47#define MXC_FLASH_PAGE_MASK ~(MXC_FLASH_PAGE_SIZE - 1)
48
50#define MXC_FLASH_PAGE_ADDR(page) (MXC_FLASH_MEM_BASE + ((uint32_t)page * MXC_FLASH_PAGE_SIZE))
51
52/***** Function Prototypes *****/
53
58int MXC_FLC_Init(void);
59
66int MXC_FLC_Busy(void);
67
74
81int MXC_FLC_PageErase(uint32_t address);
82
91void MXC_FLC_Read(int address, void *buffer, int len);
92
102int MXC_FLC_Write(uint32_t address, uint32_t length, uint32_t *buffer);
103
112int MXC_FLC_Write32(uint32_t address, uint32_t data);
113
122int MXC_FLC_Write128(uint32_t address, uint32_t *data);
123
129int MXC_FLC_EnableInt(uint32_t flags);
130
136int MXC_FLC_DisableInt(uint32_t flags);
137
143
150int MXC_FLC_ClearFlags(uint32_t flags);
151
159int MXC_FLC_UnlockInfoBlock(uint32_t address);
160
167int MXC_FLC_LockInfoBlock(uint32_t address);
168
177int MXC_FLC_BlockPageWrite(uint32_t address);
178
187int MXC_FLC_BlockPageRead(uint32_t address);
188
191#ifdef __cplusplus
192}
193#endif
194
195#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_FLC_H_
Registers, Bit Masks and Bit Positions for the FLC Peripheral Module.
int MXC_FLC_Write32(uint32_t address, uint32_t data)
Writes 32 bits of data to flash.
int MXC_FLC_MassErase(void)
Erases the entire flash array.
int MXC_FLC_Init(void)
Initializes the Flash Controller for erase/write operations.
void MXC_FLC_Read(int address, void *buffer, int len)
Read Data out of Flash from an address.
int MXC_FLC_Write128(uint32_t address, uint32_t *data)
Writes 128 bits of data to flash.
int MXC_FLC_Busy(void)
Checks if Flash Controller is busy.
int MXC_FLC_BlockPageRead(uint32_t address)
Blocks read operations from the flash page associated with the 'address' argument.
int MXC_FLC_Write(uint32_t address, uint32_t length, uint32_t *buffer)
Writes data to flash.
int MXC_FLC_UnlockInfoBlock(uint32_t address)
Unlock info block.
int MXC_FLC_PageErase(uint32_t address)
Erases the page of flash at the specified address.
int MXC_FLC_GetFlags(void)
Retrieve flash interrupt flags.
int MXC_FLC_ClearFlags(uint32_t flags)
Clear flash interrupt flags.
int MXC_FLC_EnableInt(uint32_t flags)
Enable flash interrupts.
int MXC_FLC_DisableInt(uint32_t flags)
Disable flash interrupts.
int MXC_FLC_LockInfoBlock(uint32_t address)
Lock info block.
int MXC_FLC_BlockPageWrite(uint32_t address)
Blocks write operations to the flash page associated with the 'address' argument.