1 /**
2   ******************************************************************************
3   * @file    bl602_ef_cfg.h
4   * @version V1.0
5   * @date
6   * @brief   This file is the standard driver header file
7   ******************************************************************************
8   * @attention
9   *
10   * <h2><center>&copy; COPYRIGHT(c) 2020 Bouffalo Lab</center></h2>
11   *
12   * Redistribution and use in source and binary forms, with or without modification,
13   * are permitted provided that the following conditions are met:
14   *   1. Redistributions of source code must retain the above copyright notice,
15   *      this list of conditions and the following disclaimer.
16   *   2. Redistributions in binary form must reproduce the above copyright notice,
17   *      this list of conditions and the following disclaimer in the documentation
18   *      and/or other materials provided with the distribution.
19   *   3. Neither the name of Bouffalo Lab nor the names of its contributors
20   *      may be used to endorse or promote products derived from this software
21   *      without specific prior written permission.
22   *
23   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33   *
34   ******************************************************************************
35   */
36 #ifndef __BL602_EF_CFG_H__
37 #define __BL602_EF_CFG_H__
38 
39 #include "bl602_common.h"
40 #include "bflb_ef_ctrl.h"
41 
42 /** @addtogroup  BL602_Peripheral_Driver
43  *  @{
44  */
45 
46 /** @addtogroup  EF_CTRL
47  *  @{
48  */
49 
50 /** @defgroup  EF_CTRL_Public_Types
51  *  @{
52  */
53 
54 /**
55  *  @brief Efuse Ctrl key slot type definition
56  */
57 typedef struct {
58     uint32_t rsvd_18_0  : 19; /*!< Reserved */
59     uint32_t chip_ver   : 3;  /*!< chip revision */
60     uint32_t rsvd_23_22 : 2;  /*!< Reserved */
61     uint32_t extInfo    : 3;  /*!< Efuse device info extension: 1:BL602C, 2:BL602L, 3:BL602E, 4:POS/AT */
62     uint32_t memoryInfo : 2;  /*!< Efuse memory info 0:no memory, 1:1MB flash, 2:2MB flash, 3:4MB flash */
63     uint32_t rsvd_29    : 1;  /*!< Efuse reserved */
64     uint32_t mcuInfo    : 1;  /*!< Efuse mcu info 0:wifi, 1:mcu */
65     uint32_t pinInfo    : 1;  /*!< Efuse pin info 0:QFN32, 1:QFN40 */
66 } bflb_efuse_device_info_type;
67 
68 /*@} end of group EF_CTRL_Public_Types */
69 
70 /** @defgroup  EF_CTRL_Public_Constants
71  *  @{
72  */
73 
74 /*@} end of group EF_CTRL_Public_Constants */
75 
76 /** @defgroup  EF_CTRL_Public_Macros
77  *  @{
78  */
79 
80 /*@} end of group EF_CTRL_Public_Macros */
81 
82 /** @defgroup  EF_CTRL_Public_Functions
83  *  @{
84  */
85 
86 void bflb_efuse_switch_cpu_clock_save(void);
87 void bflb_efuse_switch_cpu_clock_restore(void);
88 void bflb_ef_ctrl_get_device_info(bflb_efuse_device_info_type *deviceInfo);
89 uint32_t bflb_ef_ctrl_get_common_trim_list(const bflb_ef_ctrl_com_trim_cfg_t **trim_list);
90 
91 /*@} end of group EF_CTRL_Public_Functions */
92 
93 /*@} end of group EF_CTRL */
94 
95 /*@} end of group BL602_Peripheral_Driver */
96 
97 #endif /* __BL602_EF_CFG_H__ */
98