/**
*   @file       Pwm_Types.h
*
*   @version    1.0.0
*
*   @brief      AUTOSAR Pwm - Pwm generic types file.
*   @details    Contains generic Pwm types and structures.
*
*   @addtogroup PWM_MODULE
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : eMios
*   Dependencies         : none
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   Autosar Conf.Variant :
*   SW Version           : 1.0.0
*   Build Version        : MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2019 NXP
*   All Rights Reserved.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/

#ifndef PWM_TYPES_H
#define PWM_TYPES_H

#ifdef __cplusplus
extern "C" {
#endif

/**
* @page misra_violations MISRA-C:2012 violations
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.1, External identifiers shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and name space shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names.
* The used compilers use more than 31 chars for identifiers.
*
* @section Pwm_Types_h_REF_1
* Violates MISRA 2012 Advisory Rule 20.1, #include directives should only be preceded by preprocessor directives or comments.
* <MA>_MemMap.h is included after each section define in order to set the current memory section as defined by AUTOSAR.
*
* @section Pwm_Types_h_REF_2
* Violates MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents of a header
* file being included more than once.
* This violation is not fixed since the inclusion of <MA>_MemMap.h is as per AUTOSAR requirement [SWS_MemMap_00003].
*
* @section Pwm_Types_h_REF_3
* Violates MISRA 2012 Advisory Rule 2.3, A project should not contain unused type declarations
* Typedef that are in <MDL>.h or <MDL>_Cfg.h… that are needed for the client (and are used only in tests)
*
*/



/*==================================================================================================
*                                         INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/

#include "Std_Types.h"



/*==================================================================================================
*                               SOURCE FILE VERSION INFORMATION
==================================================================================================*/

/**
* @{
* @file           Pwm_Types.h
*/
#define PWM_TYPES_VENDOR_ID                         43
#define PWM_TYPES_AR_RELEASE_MAJOR_VERSION          4
#define PWM_TYPES_AR_RELEASE_MINOR_VERSION          3
#define PWM_TYPES_AR_RELEASE_REVISION_VERSION       1
#define PWM_TYPES_SW_MAJOR_VERSION                  1
#define PWM_TYPES_SW_MINOR_VERSION                  0
#define PWM_TYPES_SW_PATCH_VERSION                  0
/**@}*/



/*==================================================================================================
*                                      FILE VERSION CHECKS
==================================================================================================*/

#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
/* Check if header file and Std_Types.h are of the same AUTOSAR version */
#if ((PWM_TYPES_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
     (PWM_TYPES_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
    #error "AUTOSAR version numbers of Pwm_Types.h and Std_Types.h are different."
#endif
#endif



/*==================================================================================================
*                                           CONSTANTS
==================================================================================================*/




/*==================================================================================================
*                                       DEFINES AND MACROS
==================================================================================================*/




/*==================================================================================================
*                                              ENUMS
==================================================================================================*/

/**
* @brief        Output signal level
* @details      This enumeration specifies the return type of Pwm_GetOutputState
* 
* @implements   Pwm_OutputStateType_enumeration
*
*/
typedef enum
{
    /** @brief  PWM level is logic low */
    PWM_LOW = 0,
    /** @brief  PWM level is logic high */
    PWM_HIGH
} Pwm_OutputStateType;

/**
* @brief        Prescaler type
* @details      This enumeration specifies the possible types of prescalers used to configure base-clock timers
*
*/
typedef enum
{
    /** @brief  Selected value is the default/primary prescaler */
    PWM_PRIMARY_PRESCALER = 0,
    /** @brief  Selected value is the alternative configured prescaler */
    PWM_ALTERNATIVE_PRESCALER
} Pwm_PrescalerType;

/**
* @brief        Edge notification type
* @details      This enumeration defines the type of edge transition that can  generate a notification
*
* @implements   Pwm_EdgeNotificationType_enumeration
*
*/
typedef enum
{
    /** @brief  A notification will be generated on the rising edge */
    PWM_RISING_EDGE = 1,
    /** @brief  A notification will be generated on the falling edge */
    PWM_FALLING_EDGE,
    /** @brief  A notification will be generated on any state transition */
    PWM_BOTH_EDGES
} Pwm_EdgeNotificationType;

/**
* @brief        Power state type
* @details      Power state currently active or set as target power state.
*
* @implements   Pwm_PowerStateType_enumeration
* 
*/
typedef enum
{
    /** @brief  PWM full power mode */
    PWM_FULL_POWER = 0,
    /** @brief  PWM low power mode */
    PWM_LOW_POWER,
    /** @brief  PWM no define power mode */
    PWM_NODEFINE_POWER
/* @violates @ref Pwm_Types_h_REF_3 This typedef is AUTOSAR requirement */
} Pwm_PowerStateType;

/**
* @brief        Result of power state type
* @details      Result of the requests related to power state transitions.
*
* @implements   Pwm_PowerStateRequestResultType_enumeration
* 
*/
typedef enum
{
    /** @brief  Power state change executed. */
    PWM_SERVICE_ACCEPTED = 0,
    /** @brief  Module not initialized. */
    PWM_NOT_INIT,
    /** @brief  Wrong API call sequence. */
    PWM_SEQUENCE_ERROR,
    /** @brief  The HW module has a failure which prevents it to enter the required power state. */
    PWM_HW_FAILURE,
    /** @brief  Module does not support the requested power state. */
    PWM_POWER_STATE_NOT_SUPP,
    /** @brief  Module cannot transition directly from the current power state to the requested power state */
    PWM_TRANS_NOT_POSSIBLE
/* @violates @ref Pwm_Types_h_REF_3 This typedef is AUTOSAR requirement */
} Pwm_PowerStateRequestResultType;



/*==================================================================================================
*                                  STRUCTURES AND OTHER TYPEDEFS
==================================================================================================*/

/**
* @brief        PWM channel type
* @implements   Pwm_ChannelType_typedef
*/
typedef uint8 Pwm_ChannelType;



/*==================================================================================================
*                                  GLOBAL VARIABLE DECLARATIONS
==================================================================================================*/




/*==================================================================================================
*                                      FUNCTION PROTOTYPES
==================================================================================================*/




#ifdef __cplusplus
}
#endif

#endif    /*PWM_TYPES_H*/

/** @} */
