/**
*   @file    Mcu_FLASH.h
*   @version 1.0.0
*
*   @brief   AUTOSAR Mcu - Function prototypes.
*   @details Interface available for IPW layer only.
*
*   @addtogroup MCU
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : MC
*   Dependencies         : none
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   Autosar Conf.Variant :
*   SW Version           : 1.0.0
*   Build Version        : MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2019 NXP
*   All Rights Reserved.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/


#ifndef MCU_FLASH_H
#define MCU_FLASH_H


#ifdef __cplusplus
extern "C"{
#endif


/**
* @page misra_violations MISRA-C:2012 violations
*
* @section Mcu_FLASH_h_REF_1
* Violates MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once. This comes from the order of includes in the .c file
* and from include dependencies. As a safe approach, any file must include all its dependencies.
* Header files are already protected against double inclusions. The inclusion of Mcu_MemMap.h is as
* per AUTOSAR requirement [SWS_MemMap_00003].
*
* @section MCU_FLASH_h_REF_2
* Violates MISRA 2012 Advisory Directive 4.9, A function should be used in preference to a function-like macro
* where they are interchangeable. This violation is done to implement user mode support by using function-like macros
* defined for routing function calls.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct.
* This violation is due to the AUTOSAR requirement [SWS_BSW_00036] (perform inter module checks).
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.1, External identifiers shall be distinct.
* This rule does not apply if either identifier is a macro identifier, because this case is covered
* by Rule 5.4 and Rule 5.5.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and name space shall be distinct.
* This rule does not apply if either identifier is a macro identifier, because this case is covered
* by Rule 5.4 and Rule 5.5.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names.
* The identifier clash is between macro identifiers. Therefore, this rule is incorrectly reported by the tool.
*/


/*==================================================================================================
                                         INCLUDE FILES
 1) system and project includes
 2) needed interfaces from external units
 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Mcu_FLASH_Types.h"
#include "Mcu_EnvCfg.h"


/*==================================================================================================
                               SOURCE FILE VERSION INFORMATION
==================================================================================================*/

#define MCU_FLASH_VENDOR_ID                        43
#define MCU_FLASH_AR_RELEASE_MAJOR_VERSION         4
#define MCU_FLASH_AR_RELEASE_MINOR_VERSION         3
#define MCU_FLASH_AR_RELEASE_REVISION_VERSION      1
#define MCU_FLASH_SW_MAJOR_VERSION                 1
#define MCU_FLASH_SW_MINOR_VERSION                 0
#define MCU_FLASH_SW_PATCH_VERSION                 0


/*==================================================================================================
                                      FILE VERSION CHECKS
==================================================================================================*/
/* Check if source file and PLLDIG header file are from the same vendor */
#if (MCU_FLASH_VENDOR_ID != MCU_FLASH_TYPES_VENDOR_ID)
    #error "Mcu_FLASH.h and Mcu_FLASH_Types.h have different vendor ids"
#endif
/* Check if source file and PLLDIG header file are of the same Autosar version */
#if ((MCU_FLASH_AR_RELEASE_MAJOR_VERSION != MCU_FLASH_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (MCU_FLASH_AR_RELEASE_MINOR_VERSION != MCU_FLASH_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (MCU_FLASH_AR_RELEASE_REVISION_VERSION != MCU_FLASH_TYPES_AR_RELEASE_REVISION_VERSION) \
    )
    #error "AutoSar Version Numbers of Mcu_FLASH.h and Mcu_FLASH_Types.h are different"
#endif
/* Check if source file and PLLDIG header file are of the same Software version */
#if ((MCU_FLASH_SW_MAJOR_VERSION != MCU_FLASH_TYPES_SW_MAJOR_VERSION) || \
     (MCU_FLASH_SW_MINOR_VERSION != MCU_FLASH_TYPES_SW_MINOR_VERSION) || \
     (MCU_FLASH_SW_PATCH_VERSION != MCU_FLASH_TYPES_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Mcu_FLASH.h and Mcu_FLASH_Types.h are different"
#endif

/* Check if source file and PLLDIG header file are from the same vendor */
#if (MCU_FLASH_VENDOR_ID != MCU_SCFG_VENDOR_ID)
    #error "Mcu_FLASH.h and Mcu_EnvCfg.h have different vendor ids"
#endif
/* Check if source file and PLLDIG header file are of the same Autosar version */
#if ((MCU_FLASH_AR_RELEASE_MAJOR_VERSION != MCU_SCFG_AR_RELEASE_MAJOR_VERSION) || \
     (MCU_FLASH_AR_RELEASE_MINOR_VERSION != MCU_SCFG_AR_RELEASE_MINOR_VERSION) || \
     (MCU_FLASH_AR_RELEASE_REVISION_VERSION != MCU_SCFG_AR_RELEASE_REVISION_VERSION) \
    )
    #error "AutoSar Version Numbers of Mcu_FLASH.h and Mcu_EnvCfg.h are different"
#endif
/* Check if source file and PLLDIG header file are of the same Software version */
#if ((MCU_FLASH_SW_MAJOR_VERSION != MCU_SCFG_SW_MAJOR_VERSION) || \
     (MCU_FLASH_SW_MINOR_VERSION != MCU_SCFG_SW_MINOR_VERSION) || \
     (MCU_FLASH_SW_PATCH_VERSION != MCU_SCFG_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Mcu_FLASH.h and Mcu_EnvCfg.h are different"
#endif

/*==================================================================================================
                                           CONSTANTS
==================================================================================================*/


/*==================================================================================================
                                       DEFINES AND MACROS
==================================================================================================*/


/*==================================================================================================
                                             ENUMS
==================================================================================================*/


/*==================================================================================================
                                 STRUCTURES AND OTHER TYPEDEFS
==================================================================================================*/


/*==================================================================================================
                                 GLOBAL VARIABLE DECLARATIONS
==================================================================================================*/


/*==================================================================================================
                                     FUNCTION PROTOTYPES
==================================================================================================*/
#define MCU_START_SEC_CODE
/**
* @violates @ref Mcu_FLASH_h_REF_1 Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*/
#include "Mcu_MemMap.h"

#if (MCU_DISABLE_FLASH_CONFIG == STD_OFF)
    
#if defined(MCU_ENABLE_USER_MODE_SUPPORT) \
    && (STD_ON == MCU_ENABLE_USER_MODE_SUPPORT) 
/**
* @violates @ref MCU_FLASH_h_REF_2 A function should be used in preference to a function-like macro
* where they are interchangeable.
*/
#define  Call_Mcu_FLASH_pfInit(FLASH_pConfigPtr) \
      Mcal_Trusted_Call1param(Mcu_FLASH_pfInit,(FLASH_pConfigPtr))
#else    
/**
* @violates @ref MCU_FLASH_h_REF_2 A function should be used in preference to a function-like macro
* where they are interchangeable.
*/
#define  Call_Mcu_FLASH_pfInit(FLASH_pConfigPtr) \
        Mcu_FLASH_pfInit(FLASH_pConfigPtr)
#endif /* MCU_ENABLE_USER_MODE_SUPPORT */

extern P2FUNC (void, MCU_CODE, Mcu_FLASH_pfInit) (P2CONST( Mcu_FLASH_ConfigType, AUTOMATIC, MCU_APPL_CONST) FLASH_pConfigPtr);
#endif /* (MCU_DISABLE_FLASH_CONFIG == STD_OFF) */

#if (MCU_INIT_CLOCK == STD_ON)
#if (MCU_DISABLE_FLASH_CONFIG == STD_OFF)

#if defined(MCU_ENABLE_USER_MODE_SUPPORT) \
    && (STD_ON == MCU_ENABLE_USER_MODE_SUPPORT)
/**
* @violates @ref MCU_FLASH_h_REF_2 A function should be used in preference to a function-like macro
* where they are interchangeable.
*/
#define  Call_Mcu_FLASH_pfSetWS(FLASH_pClockConfigPtr) \
        Mcal_Trusted_Call1param(Mcu_FLASH_pfSetWS,(FLASH_pClockConfigPtr))
#else
/**
* @violates @ref MCU_FLASH_h_REF_2 A function should be used in preference to a function-like macro
* where they are interchangeable.
*/
#define  Call_Mcu_FLASH_pfSetWS( FLASH_pClockConfigPtr) \
        Mcu_FLASH_pfSetWS(FLASH_pClockConfigPtr)
#endif /* MCU_ENABLE_USER_MODE_SUPPORT */

extern P2FUNC (void, MCU_CODE, Mcu_FLASH_pfSetWS) (P2CONST( Mcu_FLASH_ClockConfigType, AUTOMATIC, MCU_APPL_CONST) FLASH_pClockConfigPtr);
#endif /* (MCU_DISABLE_FLASH_CONFIG == STD_OFF) */
#endif /* (MCU_INIT_CLOCK == STD_ON) */


#define MCU_STOP_SEC_CODE
/**
* @violates @ref Mcu_FLASH_h_REF_1 Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*/
#include "Mcu_MemMap.h"


#ifdef __cplusplus
}
#endif

#endif /* MCU_FLASH_H */

/** @} */

