/*!
 * @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 on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES 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_ReadProtection
  @{
  */

/** @defgroup FMC_Flash_ReadProtection_Variables Variables
  @{
  */

/* Default option byte configuration (RDP level 0) */
Fmc_User_ConfigType g_ob_default_config = {
    .READROT  = FMC_RDP_LEVEL_0,        /* No read protection */
    .IWDTSW   = FMC_OB_IWDT_SW,          /* Software IWDG */
    .STOPCE   = FMC_OB_STOP_NRST,        /* No reset in STOP mode */
    .STDBYCE  = FMC_OB_STDBY_NRST,       /* No reset in STANDBY mode */
    .BOOT0SW  = FMC_OB_BOOT0_SET,        /* BOOT0 controlled by pin */
    .BOOT1SW  = FMC_OB_BOOT1_SET,        /* BOOT1 controlled by pin */
    .VDDASW   = FMC_OB_VDDA_ANALOG_ON    /* VDDA analog enable */
};

/* Read protection configuration (RDP level 1) */
Fmc_User_ConfigType g_ob_readprot_config = {
    .READROT  = FMC_RDP_LEVEL_1,        /* Enable read protection */
    .IWDTSW   = FMC_OB_IWDT_SW,          /* Software IWDG */
    .STOPCE   = FMC_OB_STOP_NRST,        /* No reset in STOP mode */
    .STDBYCE  = FMC_OB_STDBY_NRST,       /* No reset in STANDBY mode */
    .BOOT0SW  = FMC_OB_BOOT0_SET,        /* BOOT0 controlled by pin */
    .BOOT1SW  = FMC_OB_BOOT1_SET,        /* BOOT1 controlled by pin */
    .VDDASW   = FMC_OB_VDDA_ANALOG_ON    /* VDDA analog enable */
};

/**@} end of group FMC_Flash_ReadProtection_Variables */
/**@} end of group FMC_Flash_ReadProtection */
/**@} end of group FLASH_Examples */
/**@} end of group Examples */
