/****************************************************************************** * Copyright (C) 2021, Xiaohua Semiconductor Co., Ltd. All rights reserved. * * This software component is licensed by XHSC under BSD 3-Clause license * (the "License"); You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ******************************************************************************/ /****************************************************************************** * @file flash.h * * @brief Header file for FLASH functions * * @author MADS Team * ******************************************************************************/ #ifndef __FLASH_H__ #define __FLASH_H__ /******************************************************************************/ /* Include files */ /******************************************************************************/ #include "ddl.h" /* C binding of definitions if building with C++ compiler */ #ifdef __cplusplus extern "C" { #endif /** ****************************************************************************** ** \defgroup FlashGroup Flash Controller (Flash) ** ** ******************************************************************************/ //@{ /****************************************************************************** * Global type definitions ******************************************************************************/ /** ****************************************************************************** ** \brief Flash中断类型重定义 *****************************************************************************/ typedef enum en_flash_int_type { FlashPCInt = 0x01u, ///<擦写PC地址报警中断 FlashSlockInt = 0x02u, ///<擦写保护报警中断 } en_flash_int_type_t; /** ****************************************************************************** ** \brief Flash读等待周期类型重定义 *****************************************************************************/ typedef enum en_flash_waitcycle { FlashWaitCycle0 = 0u, ///< 读等待周期设置为0-即读周期为1(当HCLK小于等于24MHz时) FlashWaitCycle1 = 1u, ///< 读等待周期设置为1-即读周期为2(当HCLK大于24MHz时必须至少为1) FlashWaitCycle2 = 2u, ///< 读等待周期设置为2-即读周期为3(当HCK大于48MHz时必须至少为2) } en_flash_waitcycle_t; /** ****************************************************************************** ** \brief Flash擦写保护范围重定义 *****************************************************************************/ typedef enum en_flash_lock { FlashLock0 = 0u, ///