/*!
 * @file        user_fls_config.c
 *
 * @brief       FLASH configurations
 *
 * @version     V1.0.0
 *
 * @date        2026-03-25
 *
 * @attention
 *
 *  Copyright (C) 2026 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (Geehy Semiconductor Software License Agreement).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed in an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the Geehy Semiconductor Software License Agreement for the governing permissions
 *  and limitations under the License.
 */

/* Includes */
#include "user_fls_config.h"

/** @addtogroup Examples
  @{
*/

/** @addtogroup FLASH_Examples
  @{
*/

/** @addtogroup FMC_Flash_WriteProtection
  @{
*/

/** @defgroup FMC_Flash_WriteProtection_Variables Variables
  @{
*/

/* Option byte default configuration */
Fmc_User_ConfigType g_ob_default_config = {
    .READROT  = FMC_RDP_LEVEL_0,
    .IWDTSW   = FMC_OB_IWDT_SW,
    .STOPCE   = FMC_OB_STOP_NRST,
    .STDBYCE  = FMC_OB_STDBY_NRST,
    .BOOT0SW  = FMC_OB_BOOT0_SET,
    .BOOT1SW  = FMC_OB_BOOT1_SET,
    .VDDASW   = FMC_OB_VDDA_ANALOG_ON
};

/* PFLASH write protection configuration */
const Fmc_Wrpp_ConfigType g_wrp_pflash_config = {
    .WRP0 = WRP_PFLASH_UNPROTECT,
    .WRP1 = WRP_PFLASH_UNPROTECT,
    .WRP2 = WRP_PFLASH_UNPROTECT,
    .WRP3 = WRP_PFLASH_PROTECT
};

/* DFLASH write protection configuration */
const Fmc_Wrpd_ConfigType g_wrp_dflash_config = {
    .WRP4 = WRP_DFLASH_UNPROTECT,
    .WRP5 = WRP_DFLASH_UNPROTECT,
    .WRP6 = WRP_DFLASH_UNPROTECT,
    .WRP7 = WRP_DFLASH_PROTECT
};

/* PFLASH all unprotected configuration */
const Fmc_Wrpp_ConfigType g_wrp_pflash_restore = {
    .WRP0 = WRP_PFLASH_UNPROTECT,
    .WRP1 = WRP_PFLASH_UNPROTECT,
    .WRP2 = WRP_PFLASH_UNPROTECT,
    .WRP3 = WRP_PFLASH_UNPROTECT
};

/* DFLASH all unprotected configuration */
const Fmc_Wrpd_ConfigType g_wrp_dflash_restore = {
    .WRP4 = WRP_DFLASH_UNPROTECT,
    .WRP5 = WRP_DFLASH_UNPROTECT,
    .WRP6 = WRP_DFLASH_UNPROTECT,
    .WRP7 = WRP_DFLASH_UNPROTECT
};

/**@} end of group FMC_Flash_WriteProtection_Variables*/
/**@} end of group FMC_Flash_WriteProtection*/
/**@} end of group Examples*/
