1 /******************************************************************************
2  *
3  * Copyright (C) 2024 Analog Devices, Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  ******************************************************************************/
18 
19 /**
20  * @file    sfcc.h
21  * @brief   SPI Flash Controller Cache(SFCC) function prototypes and data types.
22  */
23 
24 /* Define to prevent redundant inclusion */
25 #ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32572_SFCC_H_
26 #define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32572_SFCC_H_
27 
28 /* **** Includes **** */
29 #include <stdint.h>
30 #include "sfcc_regs.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /**
37  * @defgroup sfcc SFCC
38  * @ingroup periphlibs
39  * @{
40  */
41 
42 /**
43  * @brief Enumeration type for the Cache ID Register
44  */
45 typedef enum {
46     SFCC_INFO_RELNUM, ///< Identifies the Release Number
47     SFCC_INFO_PARTNUM, ///< Specifies the value of Cache ID Part Number
48     SFCC_INFO_ID ///< Specifies the value of Cache ID
49 } mxc_sfcc_info_t;
50 
51 /**
52  * @brief   Reads the data from the Cache Id Register.
53  * @param   cid Enumeration type for Cache Id Register.
54  * @retval  Returns the contents of Cache Id Register.
55  */
56 int MXC_SFCC_ID(mxc_sfcc_info_t cid);
57 
58 /**
59  * @brief   Enable the instruction cache controller.
60  */
61 void MXC_SFCC_Enable(void);
62 
63 /**
64  * @brief   Disable the instruction cache controller.
65  */
66 void MXC_SFCC_Disable(void);
67 
68 /**
69  * @brief   Flush the instruction cache controller.
70  */
71 void MXC_SFCC_Flush(void);
72 
73 /**@} end of group sfcc */
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32572_SFCC_H_
80