1 /**
2 *********************************************************************************
3 *
4 * @file ald_syscfg.h
5 * @brief SYSCFG module driver.
6 *
7 * @version V1.0
8 * @date 04 Jun 2019
9 * @author AE Team
10 * @note
11 * Change Logs:
12 * Date Author Notes
13 * 04 Jun 2019 AE Team The first version
14 *
15 * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
16 *
17 * SPDX-License-Identifier: Apache-2.0
18 *
19 * Licensed under the Apache License, Version 2.0 (the License); you may
20 * not use this file except in compliance with the License.
21 * You may obtain a copy of the License at
22 *
23 * www.apache.org/licenses/LICENSE-2.0
24 *
25 * Unless required by applicable law or agreed to in writing, software
26 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
27 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 * See the License for the specific language governing permissions and
29 * limitations under the License.
30 **********************************************************************************
31 */
32
33 #ifndef __ALD_SYSCFG_H__
34 #define __ALD_SYSCFG_H__
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #include "utils.h"
41
42
43 /** @addtogroup ES32FXXX_ALD
44 * @{
45 */
46
47 /** @defgroup SYSCFG SYSCFG
48 * @brief SYSCFG module driver
49 * @{
50 */
51
52 /** @defgroup SYSCFG_Public_Macros SYSCFG Public Macros
53 * @{
54 */
55 #define SYSCFG_LOCK() WRITE_REG(SYSCFG->PROT, 0x0U)
56 #define SYSCFG_UNLOCK() WRITE_REG(SYSCFG->PROT, 0x55AA6996U)
57 #define GET_SYSCFG_LOCK() READ_BIT(SYSCFG->PROT, SYSCFG_PROT_PROT_MSK)
58
59 #define SYSCFG_BOOTFLASH_MAPPING_ENABLE() SET_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_BFRMPEN_MSK)
60 #define SYSCFG_BOOTFLASH_MAPPING_DISABLE() CLEAR_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_BFRMPEN_MSK)
61 /**
62 * @}
63 */
64
65 /** @defgroup SYSCFG_Public_Functions SYSCFG Public Functions
66 * @{
67 */
68 /**
69 * @brief Set the offset of the interrup vector map
70 * @param offset: Offset of the interrup vector map
71 * @param status: ENABLE/DISABLE
72 * @retval None
73 */
ald_vtor_config(uint32_t offset,type_func_t status)74 __STATIC_INLINE__ void ald_vtor_config(uint32_t offset, type_func_t status)
75 {
76 SCB->VTOR = status ? (offset & ~0x3FU) : 0;
77 return;
78 }
79 /**
80 * @}
81 */
82 /**
83 * @}
84 */
85 /**
86 * @}
87 */
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif
94