/*
* @file    SchM_Platform.h
*==================================================================================================
*   Project              : YTMicro AUTOSAR 4.4.0 MCAL
*   Platform             : ARM
*   Peripheral           : SchM_Platform
*   Dependencies         : none
*
*   Autosar Version      : V4.4.0
*   Autosar Revision     : ASR_REL_4_4_REV_0000
*   SW Version           : V0.9.0
*
*   (c) Copyright 2020-2025 Yuntu Microelectronics co.,ltd.
*   All Rights Reserved.
==================================================================================================*/

#ifndef SCHM_PLATFORM_H
#define SCHM_PLATFORM_H

/**
*   @file    SchM_Platform.h
*
*   @addtogroup SCHM_PLATFORM_MODULE
*   @{
*/

#ifdef __cplusplus
extern "C" {
#endif

/*==================================================================================================
                                              INCLUDE FILES
==================================================================================================*/
#include "Platform_Cfg.h"
/*==================================================================================================
                                      HEADER FILE VERSION INFORMATION
==================================================================================================*/
#define SCHM_PLATFORM_VENDOR_ID                      (180)
#define SCHM_PLATFORM_AR_RELEASE_MAJOR_VERSION       (4)
#define SCHM_PLATFORM_AR_RELEASE_MINOR_VERSION       (4)
#define SCHM_PLATFORM_AR_RELEASE_REVISION_VERSION    (0)
#define SCHM_PLATFORM_SW_MAJOR_VERSION               (0)
#define SCHM_PLATFORM_SW_MINOR_VERSION               (9)
#define SCHM_PLATFORM_SW_PATCH_VERSION               (0)
/*==================================================================================================
                                            FILE VERSION CHECKS
==================================================================================================*/
/* Check if header file and PLATFORM_CFG header file are of the same vendor */
#if (SCHM_PLATFORM_VENDOR_ID != PLATFORM_MAIN_CFG_VENDOR_ID)
#error "SchM_Platform.h and Platform_Cfg.h have different vendor ids"
#endif

/* Check if header file and PLATFORM_CFG header file are of the same Autosar version */
#if (( SCHM_PLATFORM_AR_RELEASE_MAJOR_VERSION != PLATFORM_MAIN_CFG_AR_RELEASE_MAJOR_VERSION) || \
      ( SCHM_PLATFORM_AR_RELEASE_MINOR_VERSION != PLATFORM_MAIN_CFG_AR_RELEASE_MINOR_VERSION) || \
      ( SCHM_PLATFORM_AR_RELEASE_REVISION_VERSION != PLATFORM_MAIN_CFG_AR_RELEASE_REVISION_VERSION))
#error "AutoSar Version Numbers of SchM_Platform.h and Platform_Cfg.h are different"
#endif

/* Check if header file and PLATFORM_CFG header file are of the same Software version */
#if (( SCHM_PLATFORM_SW_MAJOR_VERSION != PLATFORM_MAIN_CFG_SW_MAJOR_VERSION) || \
      ( SCHM_PLATFORM_SW_MINOR_VERSION != PLATFORM_MAIN_CFG_SW_MINOR_VERSION) || \
      ( SCHM_PLATFORM_SW_PATCH_VERSION != PLATFORM_MAIN_CFG_SW_PATCH_VERSION))
#error "Software Version Numbers of SchM_Platform.h and Platform_Cfg.h are different"
#endif
/*==================================================================================================
                                                DEFINES AND MACROS
==================================================================================================*/

/* Number of cores id */
#ifndef NUMBER_OF_CORES
#define NUMBER_OF_CORES         (uint8)(1U)
#endif /* NUMBER_OF_CORES */

/*==================================================================================================
                                                EXTERNAL CONSTANTS
==================================================================================================*/
/*==================================================================================================
                                                ENUMS
==================================================================================================*/
/*==================================================================================================
                                                FUNCTION PROTOTYPES
==================================================================================================*/

#if (STD_ON == PLATFORM_SCHM_SUPPORT)

#ifdef MCAL_SCHM_LITE

extern void SchM_Enter_Platform_PLATFORM_EXCLUSIVE_AREA(void);
extern void SchM_Exit_Platform_PLATFORM_EXCLUSIVE_AREA(void);

#define SchM_Enter_Platform_PLATFORM_EXCLUSIVE_AREA_00() SchM_Enter_Platform_PLATFORM_EXCLUSIVE_AREA()
#define SchM_Exit_Platform_PLATFORM_EXCLUSIVE_AREA_00() SchM_Exit_Platform_PLATFORM_EXCLUSIVE_AREA()

#else

extern void SchM_Enter_Platform_PLATFORM_EXCLUSIVE_AREA_00(void);
extern void SchM_Exit_Platform_PLATFORM_EXCLUSIVE_AREA_00(void);

#endif  /* MCAL_SCHM_LITE */

#else

#define SchM_Enter_Platform_PLATFORM_EXCLUSIVE_AREA_00()
#define SchM_Exit_Platform_PLATFORM_EXCLUSIVE_AREA_00()

#endif  /* (STD_ON == PLATFORM_SCHM_SUPPORT) */

#ifdef __cplusplus
}
#endif

/** @} */

#endif /* End of file SchM_Platform.h */

