/*!
* @file     Ocu_Tmr_Types.h
*
* @version  1.0.0
*
* @brief    The header of OCU TMR types definition.
*           This header file includes the TMR types definition of the Ocu moudle.
* @attention
*
* Project Name      : AUTOSAR MCAL
*
* Platform          : Arm
*
* Autosar Standard  : Classic Platform 4.4.0
*
* Compiled Version  : G32A10xx_MCAL_1_0_0_15-Nov-2
*
* 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 OCU_TMR_TYPES_H
#define OCU_TMR_TYPES_H

#ifdef __cplusplus
extern "C"{
#endif  /* ifdef __cplusplus */

#include "Pdl_TmrReg.h"
#include "Ocu_Cfg.h"
/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

/** @defgroup OCU_Driver
  * @brief OCU driver modules
  @{
*/

/** @defgroup OCU_Macros
  @{
*/
/***********************************************************************************************************************
                                    VENDOR ID & AUTOSAR VERSION INFO
***********************************************************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define OCU_TMR_TYPES_H_VENDOR_ID                         0x00C1U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */ 
#define OCU_TMR_TYPES_H_AR_RELEASE_MAJOR_VERSION          0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define OCU_TMR_TYPES_H_AR_RELEASE_MINOR_VERSION          0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define OCU_TMR_TYPES_H_AR_RELEASE_REVISION_VERSION       0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */ 
#define OCU_TMR_TYPES_H_SW_MAJOR_VERSION                  0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define OCU_TMR_TYPES_H_SW_MINOR_VERSION                  0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define OCU_TMR_TYPES_H_SW_PATCH_VERSION                  0x00U
/**@} end of group OCU_Macros */
/***********************************************************************************************************
                                  VERSION INFOMATION VERIFICATION
*************************************************************************************************************/
#ifdef ENABLE_INTERMODULE_MCAL_CHECK
    /* Make sure the AUTOSAR major version number is the same between Ocu_Tmr_Types.h and Tmr_Common_Types.h */
    #if (OCU_TMR_TYPES_H_AR_RELEASE_MAJOR_VERSION != TMR_COMMON_TYPES_H_AR_RELEASE_MAJOR_VERSION)
        #error "AUTOSAR Major Version Number mismatch between Ocu_Tmr_Types.h and Tmr_Common_Types.h"
    #endif
    /* Make sure the AUTOSAR minor version number is the same between Ocu_Tmr_Types.h and Tmr_Common_Types.h */
    #if (OCU_TMR_TYPES_H_AR_RELEASE_MINOR_VERSION != TMR_COMMON_TYPES_H_AR_RELEASE_MINOR_VERSION)
        #error "AUTOSAR Minor Version Number mismatch between Ocu_Tmr_Types.h and Tmr_Common_Types.h"
    #endif
#endif  

/* Make sure the vendor ids are the same between Ocu_Tmr_Types.h and Ocu_Cfg.h */
#if ( OCU_TMR_TYPES_H_VENDOR_ID!= OCU_CFG_H_VENDOR_ID)
    #error "Vendor ids mismatch between Ocu_Tmr_Types.h and Ocu_Cfg.h"
#endif  /* {if ( OCU_TMR_TYPES_H_VENDOR_ID!= OCU_CFG_H_VENDOR_ID)} */

/* Make sure the AUTOSAR major version number is the same between Ocu_Tmr_Types.h and Ocu_Cfg.h */
#if (OCU_TMR_TYPES_H_AR_RELEASE_MAJOR_VERSION != OCU_CFG_H_AR_RELEASE_MAJOR_VERSION)
    #error "AUTOSAR Major Version Number mismatch between Ocu_Tmr_Types.h and Ocu_Cfg.h"
#endif
/* Make sure the AUTOSAR minor version number is the same between Ocu_Tmr_Types.h and Ocu_Cfg.h */
#if (OCU_TMR_TYPES_H_AR_RELEASE_MINOR_VERSION != OCU_CFG_H_AR_RELEASE_MINOR_VERSION)
    #error "AUTOSAR Minor Version Number mismatch between Ocu_Tmr_Types.h and Ocu_Cfg.h"
#endif
/* Make sure the AUTOSAR revision version number is the same between Ocu_Tmr_Types.h and Ocu_Cfg.h */
#if (OCU_TMR_TYPES_H_AR_RELEASE_REVISION_VERSION != OCU_CFG_H_AR_RELEASE_REVISION_VERSION)
    #error "AUTOSAR Revision Version Number mismatch between Ocu_Tmr_Types.h and Ocu_Cfg.h"
#endif

/* Make sure the software major version number is the same between Ocu_Tmr_Types.h and Ocu_Cfg.h */
#if (OCU_TMR_TYPES_H_SW_MAJOR_VERSION != OCU_CFG_H_SW_MAJOR_VERSION)
    #error "Software Major Version Number mismatch between Ocu_Tmr_Types.h and Ocu_Cfg.h"
#endif
/* Make sure the software minor version number is the same between Ocu_Tmr_Types.h and Ocu_Cfg.h */
#if (OCU_TMR_TYPES_H_SW_MINOR_VERSION != OCU_CFG_H_SW_MINOR_VERSION)
    #error "Software Minor Version Number mismatch between Ocu_Tmr_Types.h and Ocu_Cfg.h"
#endif
/* Make sure the software patch version number is the same between Ocu_Tmr_Types.h and Ocu_Cfg.h */
#if (OCU_TMR_TYPES_H_SW_PATCH_VERSION != OCU_CFG_H_SW_PATCH_VERSION)
    #error "Software Patch Version Number mismatch between Ocu_Tmr_Types.h and Ocu_Cfg.h"
#endif

/**********************************************************************************************************************
                                             OTHER TYPE DEFINITION
***********************************************************************************************************************/
/** @defgroup OCU_Typedef
  @{
*/
/** The control register value of the OCU TMR module */
typedef uint8 Ocu_TmrModCtrlType;

/** The type of OCU Tmr HW module */
typedef uint8 Ocu_TmrHwModType;

/** The type of OCU Tmr HW channel */
typedef uint8 Ocu_TmrHwChType;

/** The configuration structure of OCU TMR IP  */
typedef uint16 Ocu_TmrChCtrlType;

/**@} end of group OCU_Typedef */
/** @defgroup OCU_Structure
  @{
*/

/**
 * @brief            The configuration structure of OCU TMR IP module
 */
typedef struct
{
    CONST(uint8 , OCU_CONST) ocuTmrModuleId;  //!< The TMR id of OCU TMR moudle 
    CONST(uint16 , OCU_CONST) ocuTmrMaxCnt;  //!< The maximum counter value of OCU TMR moudle 
    CONST(uint16 , OCU_CONST) ocuTmrPsc;  //!< Prescaler Value 
    
#if (STD_ON == OCU_SET_CLOCK_MODE_API_ENABLE)    
    CONST(uint8, OCU_CONST) ocuTmrClkSrcCtrl;   
#endif  /* {if (STD_ON == OCU_SET_CLOCK_MODE_API_ENABLE)} */
} Ocu_TmrModConfigType;

/**
 * @brief          The OCU TMR channel specific configuration structure
 */
typedef struct
{
    CONST(Ocu_TmrHwChType, OCU_CONST) ocuTmrHwChannelId;  //!< The channel id of OCU TMR moudle 
    CONST(Ocu_ValueType, OCU_CONST) ocuTmrChThreDef;  //!< The default threshold of the channel     
    CONST(Ocu_TmrChCtrlType, OCU_CONST) ocuTmrChCtrl;  
} Ocu_TmrChConfigType;

/**
 * @brief          The OCU TMR hardware specific configuration structure
 */
typedef struct
{
    CONST(Ocu_TmrHwChType, OCU_CONST) ocuTmrChCount;     //!< The number of OCU TMR channels 
    CONST(Ocu_TmrHwModType, OCU_CONST) ocuTmrModCount;  //!< The number of OCU TMR moudles 
    CONST(Ocu_TmrChConfigType, OCU_CONST) (*ocuTmrChConfigPtr)[]; //!< The pointer of the channels configurations 
    CONST(Ocu_TmrModConfigType, OCU_CONST) (*ocuTmrModConfigPtr)[]; //!< The pointer of the TMR module configurations     
} Ocu_TmrHwConfigType;
/**@} end of group OCU_Structure */

/** @defgroup OCU_Enumerations
  @{
*/
/**
 * @brief   The clock prescaler data type of the OCU moudle
 */
typedef enum
{
    OCU_NORMAL_PSC = 0, //!< The default/normal prescaler 
    OCU_AL_PSC //!< The alternative prescaler 
}Ocu_TmrPrescalerType;

/**
 * @brief The definition of Ocu module.
 */
typedef enum
{
    OCU_TMR1 = (uint8)0x01, //!< TMR module 1
    OCU_TMR2 = (uint8)0x02, //!< TMR module 2
    OCU_TMR3 = (uint8)0x03, //!< TMR module 3
    OCU_TMR4 = (uint8)0x04  //!< TMR module 4
} Ocu_TmrModuleType;
/**@} end of group OCU_Enumerations */

#ifdef __cplusplus
}
#endif  /* ifdef __cplusplus */

#endif  /* OCU_TMR_TYPES_H */
/**@} end of group OCU_Driver */
/**@} end of group G32A10xx_StdPeriphDriver */
