/*!
* @file     Std_Types.h
*
* @version  1.0.0
*
* @brief    AUTOSAR standard types definition
*
* @attention
*
* Project Name      : AUTOSAR MCAL
*
* Platform          : Arm
*
* Autosar Standard  : Classic Platform 4.4.0
*
* Compiled Version  : G32A10xx_MCAL_1_0_0_01-Otc-25
*
* 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 usefull 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
* 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.
*/

#ifndef STD_TYPES_H
#define STD_TYPES_H

#ifdef __cplusplus
extern "C"{
#endif

#include "Platform_Types.h"
#include "Compiler.h"

/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

/** @defgroup PLATFORM_Driver
  * @brief PLATFORM driver modules
  @{
*/

/** @defgroup PLATFORM_Macros
  @{
*/
/*******************************************************************************
                    VENDOR ID & AUTOSAR VERSION INFO
*******************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define STD_TYPES_H_VENDOR_ID                    0x00C1U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define STD_TYPES_H_AR_RELEASE_MAJOR_VERSION     0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define STD_TYPES_H_AR_RELEASE_MINOR_VERSION     0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define STD_TYPES_H_AR_RELEASE_REVISION_VERSION  0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define STD_TYPES_H_SW_MAJOR_VERSION             0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define STD_TYPES_H_SW_MINOR_VERSION             0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define STD_TYPES_H_SW_PATCH_VERSION             0x00U

/**@} end of group PLATFORM_Macros */

/**************************************************************************
                    VERSION INFOMATION VERIFICATION
**************************************************************************/
#ifdef ENABLE_INTERMODULE_MCAL_CHECK
    /* Make sure the AUTOSAR major version number is the same between Std_Types.h and Compiler.h */
    #if (STD_TYPES_H_AR_RELEASE_MAJOR_VERSION != COMPILER_H_AR_RELEASE_MAJOR_VERSION)
        #error "AUTOSAR Major Version Number mismatch between Std_Types.h and Compiler.h"
    #endif
    /* Make sure the AUTOSAR minor version number is the same between Std_Types.h and Compiler.h */
    #if (STD_TYPES_H_AR_RELEASE_MINOR_VERSION != COMPILER_H_AR_RELEASE_MINOR_VERSION)
        #error "AUTOSAR Minor Version Number mismatch between Std_Types.h and Compiler.h"
    #endif

    /* Make sure the AUTOSAR major version number is the same between Std_Types.h and Platform_Types.h */
    #if (STD_TYPES_H_AR_RELEASE_MAJOR_VERSION != PLATFORM_TYPES_H_AR_RELEASE_MAJOR_VERSION)
        #error "AUTOSAR Major Version Number mismatch between Std_Types.h and Platform_Types.h"
    #endif
    /* Make sure the AUTOSAR minor version number is the same between Std_Types.h and Platform_Types.h */
    #if (STD_TYPES_H_AR_RELEASE_MINOR_VERSION != PLATFORM_TYPES_H_AR_RELEASE_MINOR_VERSION)
        #error "AUTOSAR Minor Version Number mismatch between Std_Types.h and Platform_Types.h"
    #endif
#endif

/*******************************************************************************
                            DEFINES AND MACROS
*******************************************************************************/
/** @defgroup PLATFORM_Macros
  @{
*/

/** Physical state 0V */
#define STD_LOW     0x00U
/** Physical state 5V or 3.3V */
#define STD_HIGH    0x01U

/** Logical state idle */
#define STD_IDLE    0x00U
/** Logical state active */
#define STD_ACTIVE  0x01U

/** MACRO FUNCTION OFF */
#define STD_OFF     0x00U
/** MACRO FUNCTION ON */
#define STD_ON      0x01U

/**@} end of group PLATFORM_Macros */

/** @defgroup PLATFORM_Structure
  @{
*/

/** Used as API return type which is shared between the RTE and the BSW modules. */
typedef uint8 Std_ReturnType;

/**@} end of group PLATFORM_Structure */

/** Added for OSEK compliance */
#ifndef STATUSTYPEDEFINED

/** @defgroup PLATFORM_Macros
  @{
*/
    #define STATUSTYPEDEFINED
    /** Return code for success */
    #define E_OK    (uint8)0x00U

/**@} end of group PLATFORM_Macros */

/** @defgroup PLATFORM_Structure
  @{
*/

    typedef unsigned char Std_StatusType;

/**@} end of group PLATFORM_Structure */

#endif

/** @defgroup PLATFORM_Macros
  @{
*/

/** Return code for failure/error */
#define E_NOT_OK    (uint8)0x01U

/**@} end of group PLATFORM_Macros */

/** @defgroup PLATFORM_Structure
  @{
*/

/**
 * @brief    Used to get the version of a BSW module via the xxx_GetVersionInfo() API
 */
typedef struct
{
    uint16  vendorID;           //!< Vendor ID
    uint16  moduleID;           //!< BSW module ID
    uint8   sw_major_version;   //!< BSW module software major version
    uint8   sw_minor_version;   //!< BSW module software minor version
    uint8   sw_patch_version;   //!< BSW module software patch version
} Std_VersionInfoType;

/**@} end of group PLATFORM_Structure */

#ifdef __cplusplus
}
#endif

#endif

/**@} end of group PLATFORM_Driver */
/**@} end of group G32A10xx_StdPeriphDriver */
