1 /** 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * 15 * Description: Provides efuse register \n 16 * \n 17 * History: \n 18 * 2022-3-4, Create file. \n 19 */ 20 #ifndef HAL_EFUSE_V151_REG_DEF_H 21 #define HAL_EFUSE_V151_REG_DEF_H 22 23 #include <stdint.h> 24 25 #ifdef __cplusplus 26 #if __cplusplus 27 extern "C" { 28 #endif /* __cplusplus */ 29 #endif /* __cplusplus */ 30 31 /** 32 * @defgroup drivers_hal_efuse_ip1_reg_def Efuse Regs Definition 33 * @ingroup drivers_hal_efuse 34 * @{ 35 */ 36 37 typedef union efuse_sts { 38 uint32_t d32; 39 struct { 40 uint32_t efuse_man_sts : 2; 41 uint32_t efuse_boot0_done : 1; 42 uint32_t efuse_boot1_done : 1; 43 uint32_t efuse_boot2_done : 1; 44 } b; 45 } efuse_sts_t; 46 47 typedef union efuse_ctl { 48 uint32_t d32; 49 struct { 50 uint32_t efuse_wr_rd : 16; 51 } b; 52 } efuse_ctl_t; 53 54 typedef union clock_period { 55 uint32_t d32; 56 struct { 57 uint32_t clock_period : 8; 58 } b; 59 } clock_period_t; 60 61 typedef union efuse_avdd_ctl { 62 uint32_t d32; 63 struct { 64 uint32_t efuse_avdd_sw : 1; 65 } b; 66 } efuse_avdd_ctl_t; 67 68 #if defined(CONFIG_EFUSE_SWITCH_EN) 69 typedef union efuse_switch_en_ctl { 70 uint32_t d32; 71 struct { 72 uint32_t efuse_switch_enable : 16; 73 } b; 74 } efuse_switch_en_ctl_t; 75 #endif 76 77 /** 78 * @brief Registers associated with Efuse. 79 */ 80 typedef struct efuse_regs { 81 volatile efuse_ctl_t efuse_ctl_data; 82 volatile clock_period_t efuse_clk_period_data; 83 volatile uint32_t reserved; 84 volatile efuse_avdd_ctl_t efuse_avdd_ctl_data; 85 } efuse_regs_t; 86 87 /** 88 * @brief Registers associated with Efuse boot done. 89 */ 90 typedef struct efuse_boot_done_regs { 91 volatile efuse_sts_t efuse_sts_data; 92 } efuse_boot_done_regs_t; 93 94 #if defined(CONFIG_EFUSE_SWITCH_EN) 95 /** 96 * @brief Registers associated with Efuse boot done. 97 */ 98 typedef struct efuse_switch_en_regs { 99 volatile efuse_switch_en_ctl_t efuse_switch_en; 100 } efuse_switch_en_regs_t; 101 #endif 102 103 /** 104 * @} 105 */ 106 107 #ifdef __cplusplus 108 #if __cplusplus 109 } 110 #endif /* __cplusplus */ 111 #endif /* __cplusplus */ 112 113 #endif 114