/*!
* @file     Ocu_Types.h
*
* @version  1.0.0
*
* @brief    The header of Ocu generic types.
*           This header file includes the generic types 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_TYPES_H
#define OCU_TYPES_H

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

#include "Std_Types.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_TYPES_H_VENDOR_ID                              0x00C1U
/** Module ID of this module, as defined in the BSW Module List. */
#define OCU_TYPES_H_MODULE_ID                              0x007DU
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */ 
#define OCU_TYPES_H_AR_RELEASE_MAJOR_VERSION               0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define OCU_TYPES_H_AR_RELEASE_MINOR_VERSION               0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define OCU_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_TYPES_H_SW_MAJOR_VERSION                       0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define OCU_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_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_Types.h and Std_Types.h */
#if (OCU_TYPES_H_AR_RELEASE_MAJOR_VERSION != STD_TYPES_H_AR_RELEASE_MAJOR_VERSION)
    #error "AUTOSAR Major Version Number mismatch between Ocu_Types.h and Std_Types.h"
#endif
/* Make sure the AUTOSAR minor version number is the same between Ocu_Types.h and Std_Types.h */
#if (OCU_TYPES_H_AR_RELEASE_MINOR_VERSION != STD_TYPES_H_AR_RELEASE_MINOR_VERSION)
    #error "AUTOSAR Minor Version Number mismatch between Ocu_Types.h and Std_Types.h"
#endif
#endif  

/**********************************************************************************************************************
                                             OTHER TYPE DEFINITION
***********************************************************************************************************************/
/** @defgroup OCU_Enumerations
  @{
*/
/**
 *    @brief The enum of the states of the Ocu driver
 */
typedef enum
{
    OCU_GLOBAL_STS_UNINIT = 0x00,
    OCU_GLOBAL_STS_IDLE
} Ocu_GlobStsType;

/**
 * @brief      The enum of the count direction of OCU driver-AUTOSAR Standard.
 */
typedef enum
{
    OCU_UPCOUNTING = 0, //!< Counter in up counting type */
    OCU_DOWNCOUNTING    //!< Counter in down counting type */
} Ocu_CntDirType;

/**
 * @brief      The output state of the pin linked to an OCU channel-AUTOSAR Standard.
 */
typedef enum
{
    OCU_LOW = 0,  //!< The pin associated to an OCU channel is in low state */ 
    OCU_HIGH  //!< The pin associated to an OCU channel is in high state */ 
} Ocu_PinStateType;

/**
 * @brief      The return value after setting a new threshold value-AUTOSAR Standard.
 */
typedef enum
{
    OCU_CM_IN_REF_INTERVAL = 0,  //!< The compare match event will occur inside the current reference interval */
    OCU_CM_OUT_REF_INTERVAL  //!< The compare match event will not occur inside the current reference interval */
} Ocu_ReturnType;

/**
 * @brief     The automatic action to be performed on a pin linked to an OCU channel-AUTOSAR Standard.
 */
typedef enum
{
    OCU_DISABLE     = 0x00, //!< Frozen TMR output compare mode 
    OCU_SET_HIGH    = 0x01, //!< Set output to high when matching 
    OCU_SET_LOW     = 0x02, //!< Set output to low when matching 
    OCU_TOGGLE      = 0x03, //!< Toggle output when matching 
    OCU_FORCE_LOW   = 0x04, //!< Force output to be low 
    OCU_FORCE_HIGH  = 0x05, //!< Force output to be high 
    OCU_PWM1        = 0x06, //!< PWM1 mode 
    OCU_PWM2        = 0x07  //!< PWM2 mode 
} Ocu_PinActionType;

/**
 * @brief     The channel number for each TMR
 */
typedef enum
{
    OCU_TMR_CH1     = 0x00,  
    OCU_TMR_CH2     = 0x01, 
    OCU_TMR_CH3     = 0x02, 
    OCU_TMR_CH4     = 0x03
} Ocu_TmrChType;
/**@} end of group OCU_Enumerations */

/** @defgroup OCU_Typedef
  @{
*/
/** The definition of Channel notification type */
typedef void (*Ocu_NotificationType)(void);

/** The definition of Ocu channel type-AUTOSAR Standard */
typedef uint16 Ocu_ChannelType;

/** The type definition of the Ocu value type */
typedef uint16 Ocu_ValueType;
/**@} end of group OCU_Typedef */

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

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