1 /**
2  * @file flc_reva.h
3  * @brief      Flash RevA Controller driver.
4  * @details    This driver can be used to operate on the embedded flash memory.
5  */
6 /******************************************************************************
7  *
8  * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
9  * Analog Devices, Inc.),
10  * Copyright (C) 2023-2024 Analog Devices, Inc.
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  *     http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  *
24  ******************************************************************************/
25 
26 #ifndef LIBRARIES_PERIPHDRIVERS_SOURCE_FLC_FLC_REVA_H_
27 #define LIBRARIES_PERIPHDRIVERS_SOURCE_FLC_FLC_REVA_H_
28 
29 /* **** Includes **** */
30 #include <string.h>
31 #include "mxc_device.h"
32 #include "mxc_assert.h"
33 #include "mxc_sys.h"
34 #include "flc.h"
35 #include "flc_common.h"
36 #include "flc_reva_regs.h"
37 
38 /**
39  * @ingroup flc
40  * @{
41  */
42 
43 /* **** Definitions **** */
44 
45 /* **** Globals **** */
46 
47 /* **** Functions **** */
48 
49 int MXC_FLC_RevA_Busy(void);
50 
51 int MXC_FLC_RevA_MassErase(mxc_flc_reva_regs_t *flc);
52 
53 int MXC_FLC_RevA_PageErase(mxc_flc_reva_regs_t *flc, uint32_t addr);
54 
55 int MXC_FLC_RevA_Write32(mxc_flc_reva_regs_t *flc, uint32_t locgialAddr, uint32_t data,
56                          uint32_t physicalAddr);
57 
58 int MXC_FLC_RevA_Write32Using128(mxc_flc_reva_regs_t *flc, uint32_t locgialAddr, uint32_t data,
59                                  uint32_t physicalAddr);
60 
61 int MXC_FLC_RevA_Write128(mxc_flc_reva_regs_t *flc, uint32_t addr, uint32_t *data);
62 
63 void MXC_FLC_RevA_SetFLCInt(mxc_flc_reva_regs_t *flc);
64 
65 mxc_flc_reva_regs_t *MXC_FLC_RevA_GetFLCInt(void);
66 
67 int MXC_FLC_RevA_EnableInt(uint32_t mask);
68 
69 int MXC_FLC_RevA_DisableInt(uint32_t mask);
70 
71 int MXC_FLC_RevA_GetFlags(void);
72 
73 int MXC_FLC_RevA_ClearFlags(uint32_t mask);
74 
75 int MXC_FLC_RevA_UnlockInfoBlock(mxc_flc_reva_regs_t *flc, uint32_t address);
76 
77 int MXC_FLC_RevA_LockInfoBlock(mxc_flc_reva_regs_t *flc, uint32_t address);
78 
79 int MXC_FLC_RevA_BlockPageWrite(uint32_t address, uint32_t bank_base);
80 
81 int MXC_FLC_RevA_BlockPageRead(uint32_t address, uint32_t bank_base);
82 
83 /**@} end of group flc */
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif // LIBRARIES_PERIPHDRIVERS_SOURCE_FLC_FLC_REVA_H_
90