/*!
* @file     Pwm_Types.h
*
* @version  1.0.0
*
* @brief    This file contains the PWM type definitions and other parameters
*
* @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 PWM_TYPES_H
#define PWM_TYPES_H

#ifdef __cplusplus
extern "C" {
#endif

#include "Std_Types.h"

/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

/** @defgroup PWM_Driver
  * @brief PWM driver modules
  @{
*/

/** @defgroup PWM_Macros
  @{
*/
/**************************************************************************
                  VENDOR ID & AUTOSAR VERSION INFO
**************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define PWM_TYPES_H_VENDOR_ID                      0x00C1U
/** Module ID of this module, as defined in the BSW Module List. */
#define PWM_TYPES_H_MODULE_ID                      0x0079U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define PWM_TYPES_H_AR_RELEASE_MAJOR_VERSION       0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define PWM_TYPES_H_AR_RELEASE_MINOR_VERSION       0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define PWM_TYPES_H_AR_RELEASE_REVISION_VERSION    0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define PWM_TYPES_H_SW_MAJOR_VERSION               0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define PWM_TYPES_H_SW_MINOR_VERSION               0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define PWM_TYPES_H_SW_PATCH_VERSION               0x00U

/**@} end of group PWM_Macros */

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

/**************************************************************************
                    OTHER TYPE DEFINITION
**************************************************************************/
/** @defgroup PWM_Structure
  @{
*/

/** pwm channel id */
typedef uint8 Pwm_ChannelType;

/**@} end of group PWM_Structure */

/**************************************************************************
                    ENUMERATION DEFINITION
**************************************************************************/
/** @defgroup PWM_Enumerations
  @{
*/

/**
 * @brief    select clock division 
 */
typedef enum
{
    PWM_CLK_DIV_DEFAULT    = 0x0U,    //!< clock division is default
    PWM_CLK_DIV_ALTERNATE  = 0x1U     //!< clock division is alternate
} Pwm_ClockDivisionType;

/**
 * @brief    pwm power state
 */
typedef enum
{
    PWM_FULL_POWER      = 0x0U,    //!< pwm module in full power state
    PWM_LOW_POWER       = 0x1U,    //!< pwm module in lower power state
    PWM_NODEFINE_POWER  = 0x2U     //!< undefined power state
} Pwm_PowerStateType;

/**
 * @brief    set pwm power result
 */
typedef enum
{
    PWM_SERVICE_ACCEPTED      = 0x0U,    //!< execute success
    PWM_NOT_INIT              = 0x1U,    //!< pwm module doesn't initialized
    PWM_SEQUENCE_ERROR        = 0x2U,    //!< API called in wrong sequence
    PWM_HW_FAILURE            = 0x3U,    //!< failed duo to hardwarw
    PWM_POWER_STATE_NOT_SUPP  = 0x4U,    //!< device doesn't support power state
    PWM_TRANS_NOT_POSSIBLE    = 0x5U     //!< power state shouldn't transform from another state 
} Pwm_PowerStateRequestResultType;

/**
 * @brief    pwm edge notification
 */
typedef enum
{
    PWM_RISING_EDGE   = 0x1U,      //!< rising edge will trig notification
    PWM_FALLING_EDGE  = 0x2U,      //!< falling edge will trig notification
    PWM_BOTH_EDGES    = 0x3U       //!< both edge will trig notification
} Pwm_EdgeNotificationType;

/**
 * @brief    pwm channel pin level
 */
typedef enum
{
    PWM_LOW   = 0x0U,     //!< low level
    PWM_HIGH  = 0x1U      //!< high level
} Pwm_OutputStateType;

/**@} end of group PWM_Enumerations */

#ifdef __cplusplus
}
#endif

#endif

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