/**
*   @file    eMios_Common_Types.h
*   @version 1.0.0
*
*   @brief   AUTOSAR Mcl - Brief file description (one line).
*   @details Detailed file description (can be multiple lines).
*
*   @addtogroup EMIOS_DRIVER
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : eDMA
*   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 EMIOS_COMMON_TYPES_H
#define EMIOS_COMMON_TYPES_H

#ifdef __cplusplus
extern "C"{
#endif
/**
* @page misra_violations MISRA-C:2012 violations
*
* @section EMIOS_COMMON_TYPES_H_REF_1
* Violates MISRA 2012 Advisory Rule 2.5, A project should not contain unused macro declarations.
* Define is/might be used in configuration.
*
*/
/*==================================================================================================
                                         INCLUDE FILES
 1) system and project includes
 2) needed interfaces from external units
 3) internal and external interfaces from this unit
==================================================================================================*/

/*==================================================================================================
                               SOURCE FILE VERSION INFORMATION
==================================================================================================*/
/**
* @brief   Header file version information
*/
#define EMIOS_COMMON_TYPES_VENDOR_ID                            43
#define EMIOS_COMMON_TYPES_AR_RELEASE_MAJOR_VERSION             4
#define EMIOS_COMMON_TYPES_AR_RELEASE_MINOR_VERSION             3
#define EMIOS_COMMON_TYPES_AR_RELEASE_REVISION_VERSION          1
#define EMIOS_COMMON_TYPES_SW_MAJOR_VERSION                     1
#define EMIOS_COMMON_TYPES_SW_MINOR_VERSION                     0
#define EMIOS_COMMON_TYPES_SW_PATCH_VERSION                     0

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

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

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

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

/*
*    EMIOS unified channel specific control register bits desctiption
*/
#define EMIOS_BUS_A                         (0x0U)

#define EMIOS_BUS_DIVERSE                   (0x1U)

#define EMIOS_BUS_F                         (0x2U)

#define EMIOS_BUS_INTERNAL_COUNTER          (0x3U)

/*
*  EMIOS unified channel prescaller control
*/
/**
* @violates @ref EMIOS_COMMON_TYPES_H_REF_1 Violates Advisory Rule 2.5, A project should not contain unused macro declarations.
*/
#define EMIOS_PRESCALER_DIVIDE_1            (0U)
/**
* @violates @ref EMIOS_COMMON_TYPES_H_REF_1 Violates Advisory Rule 2.5, A project should not contain unused macro declarations.
*/
#define EMIOS_PRESCALER_DIVIDE_2            (1U)
/**
* @violates @ref EMIOS_COMMON_TYPES_H_REF_1 Violates Advisory Rule 2.5, A project should not contain unused macro declarations.
*/
#define EMIOS_PRESCALER_DIVIDE_3            (2U)
/**
* @violates @ref EMIOS_COMMON_TYPES_H_REF_1 Violates Advisory Rule 2.5, A project should not contain unused macro declarations.
*/
#define EMIOS_PRESCALER_DIVIDE_4            (3U)
/**
* @violates @ref EMIOS_COMMON_TYPES_H_REF_1 Violates Advisory Rule 2.5, A project should not contain unused macro declarations.
*/
#define EMIOS_FREEZE_ENABLE                 (0x1U)


/**
* @brief EMIOS channels defines
*/
/*
 * EMIOS channel encoding
 *
 * [              3 bit | 5 bit                ]
 * [ module id: 7 ... 0 | channel id: 31 ... 0 ]
 */
#define EMIOS_MOD_MASK_U8                                       ((uint8)0xE0)
#define EMIOS_MOD_SHIFT                                         ((uint8)5U)
#define EMIOS_CH_MASK_U8                                        ((uint8)0x1F)
#define EMIOS_CH_SHIFT                                          ((uint8)0U)

/* EMIOS module and channel decoding */
#define EMIOS_MODULE_INDEX_U8(ch)      ((uint8)(((ch) & EMIOS_MOD_MASK_U8) >> EMIOS_MOD_SHIFT))
#define EMIOS_CHANNEL_INDEX_U8(ch)     ((uint8)(((ch) & EMIOS_CH_MASK_U8)  >> EMIOS_CH_SHIFT))

/**
* @brief EMIOS Modules defines
*/
#define EMIOS_MODULE_0     ((uint8)0x00U)
#define EMIOS_MODULE_1     ((uint8)0x01U)
#define EMIOS_MODULE_2     ((uint8)0x02U)

/**
* @brief EMIOS Channels defines
*/
#define EMIOS_CHANNEL_0     ((uint8)0x00)
#define EMIOS_CHANNEL_1     ((uint8)0x01)
#define EMIOS_CHANNEL_2     ((uint8)0x02)
#define EMIOS_CHANNEL_3     ((uint8)0x03)
#define EMIOS_CHANNEL_4     ((uint8)0x04)
#define EMIOS_CHANNEL_5     ((uint8)0x05)
#define EMIOS_CHANNEL_6     ((uint8)0x06)
#define EMIOS_CHANNEL_7     ((uint8)0x07)
#define EMIOS_CHANNEL_8     ((uint8)0x08)
#define EMIOS_CHANNEL_9     ((uint8)0x09)
#define EMIOS_CHANNEL_10    ((uint8)0x0A)
#define EMIOS_CHANNEL_11    ((uint8)0x0B)
#define EMIOS_CHANNEL_12    ((uint8)0x0C)
#define EMIOS_CHANNEL_13    ((uint8)0x0D)
#define EMIOS_CHANNEL_14    ((uint8)0x0E)
#define EMIOS_CHANNEL_15    ((uint8)0x0F)
#define EMIOS_CHANNEL_16    ((uint8)0x10)
#define EMIOS_CHANNEL_17    ((uint8)0x11)
#define EMIOS_CHANNEL_18    ((uint8)0x12)
#define EMIOS_CHANNEL_19    ((uint8)0x13)
#define EMIOS_CHANNEL_20    ((uint8)0x14)
#define EMIOS_CHANNEL_21    ((uint8)0x15)
#define EMIOS_CHANNEL_22    ((uint8)0x16)
#define EMIOS_CHANNEL_23    ((uint8)0x17)
#define EMIOS_CHANNEL_24    ((uint8)0x18)
#define EMIOS_CHANNEL_25    ((uint8)0x19)
#define EMIOS_CHANNEL_26    ((uint8)0x1A)
#define EMIOS_CHANNEL_27    ((uint8)0x1B)
#define EMIOS_CHANNEL_28    ((uint8)0x1C)
#define EMIOS_CHANNEL_29    ((uint8)0x1D)
#define EMIOS_CHANNEL_30    ((uint8)0x1E)
#define EMIOS_CHANNEL_31    ((uint8)0x1F)



#define EMIOS_0_CH_0    (EMIOS_CHANNEL_0)

#define EMIOS_0_CH_1    (EMIOS_CHANNEL_1)

#define EMIOS_0_CH_2    (EMIOS_CHANNEL_2)

#define EMIOS_0_CH_3    (EMIOS_CHANNEL_3)

#define EMIOS_0_CH_4    (EMIOS_CHANNEL_4)

#define EMIOS_0_CH_5    (EMIOS_CHANNEL_5)

#define EMIOS_0_CH_6    (EMIOS_CHANNEL_6)

#define EMIOS_0_CH_7    (EMIOS_CHANNEL_7)

#define EMIOS_0_CH_8    (EMIOS_CHANNEL_8)

#define EMIOS_0_CH_9    (EMIOS_CHANNEL_9)

#define EMIOS_0_CH_10   (EMIOS_CHANNEL_10)

#define EMIOS_0_CH_11   (EMIOS_CHANNEL_11)

#define EMIOS_0_CH_12   (EMIOS_CHANNEL_12)

#define EMIOS_0_CH_13   (EMIOS_CHANNEL_13)

#define EMIOS_0_CH_14   (EMIOS_CHANNEL_14)

#define EMIOS_0_CH_15   (EMIOS_CHANNEL_15)

#define EMIOS_0_CH_16   (EMIOS_CHANNEL_16)

#define EMIOS_0_CH_17   (EMIOS_CHANNEL_17)

#define EMIOS_0_CH_18   (EMIOS_CHANNEL_18)

#define EMIOS_0_CH_19   (EMIOS_CHANNEL_19)

#define EMIOS_0_CH_20   (EMIOS_CHANNEL_20)

#define EMIOS_0_CH_21   (EMIOS_CHANNEL_21)

#define EMIOS_0_CH_22   (EMIOS_CHANNEL_22)

#define EMIOS_0_CH_23   (EMIOS_CHANNEL_23)

#define EMIOS_0_CH_24   (EMIOS_CHANNEL_24)

#define EMIOS_0_CH_25   (EMIOS_CHANNEL_25)

#define EMIOS_0_CH_26   (EMIOS_CHANNEL_26)

#define EMIOS_0_CH_27   (EMIOS_CHANNEL_27)

#define EMIOS_0_CH_28   (EMIOS_CHANNEL_28)

#define EMIOS_0_CH_29   (EMIOS_CHANNEL_29)

#define EMIOS_0_CH_30   (EMIOS_CHANNEL_30)

#define EMIOS_0_CH_31   (EMIOS_CHANNEL_31)

#define EMIOS_1_CH_0    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_0))

#define EMIOS_1_CH_1    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_1))

#define EMIOS_1_CH_2    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_2))

#define EMIOS_1_CH_3    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_3))

#define EMIOS_1_CH_4    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_4))

#define EMIOS_1_CH_5    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_5))

#define EMIOS_1_CH_6    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_6))

#define EMIOS_1_CH_7    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_7))

#define EMIOS_1_CH_8    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_8))

#define EMIOS_1_CH_9    ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_9))

#define EMIOS_1_CH_10   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_10))

#define EMIOS_1_CH_11   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_11))

#define EMIOS_1_CH_12   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_12))

#define EMIOS_1_CH_13   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_13))

#define EMIOS_1_CH_14   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_14))

#define EMIOS_1_CH_15   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_15))

#define EMIOS_1_CH_16   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_16))

#define EMIOS_1_CH_17   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_17))

#define EMIOS_1_CH_18   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_18))

#define EMIOS_1_CH_19   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_19))

#define EMIOS_1_CH_20   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_20))

#define EMIOS_1_CH_21   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_21))

#define EMIOS_1_CH_22   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_22))

#define EMIOS_1_CH_23   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_23))

#define EMIOS_1_CH_24   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_24))

#define EMIOS_1_CH_25   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_25))

#define EMIOS_1_CH_26   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_26))

#define EMIOS_1_CH_27   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_27))

#define EMIOS_1_CH_28   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_28))

#define EMIOS_1_CH_29   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_29))

#define EMIOS_1_CH_30   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_30))

#define EMIOS_1_CH_31   ((uint8)((uint8)(1U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_31))


#define EMIOS_2_CH_0    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_0))

#define EMIOS_2_CH_1    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_1))

#define EMIOS_2_CH_2    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_2))

#define EMIOS_2_CH_3    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_3))

#define EMIOS_2_CH_4    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_4))

#define EMIOS_2_CH_5    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_5))

#define EMIOS_2_CH_6    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_6))

#define EMIOS_2_CH_7    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_7))

#define EMIOS_2_CH_8    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_8))

#define EMIOS_2_CH_9    ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_9))

#define EMIOS_2_CH_10   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_10))

#define EMIOS_2_CH_11   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_11))

#define EMIOS_2_CH_12   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_12))

#define EMIOS_2_CH_13   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_13))

#define EMIOS_2_CH_14   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_14))

#define EMIOS_2_CH_15   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_15))

#define EMIOS_2_CH_16   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_16))

#define EMIOS_2_CH_17   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_17))

#define EMIOS_2_CH_18   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_18))

#define EMIOS_2_CH_19   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_19))

#define EMIOS_2_CH_20   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_20))

#define EMIOS_2_CH_21   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_21))

#define EMIOS_2_CH_22   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_22))

#define EMIOS_2_CH_23   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_23))

#define EMIOS_2_CH_24   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_24))

#define EMIOS_2_CH_25   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_25))

#define EMIOS_2_CH_26   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_26))

#define EMIOS_2_CH_27   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_27))

#define EMIOS_2_CH_28   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_28))

#define EMIOS_2_CH_29   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_29))

#define EMIOS_2_CH_30   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_30))

#define EMIOS_2_CH_31   ((uint8)((uint8)(2U<<EMIOS_MOD_SHIFT) + EMIOS_CHANNEL_31))
/*==================================================================================================
                                             ENUMS
==================================================================================================*/

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

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

#ifdef __cplusplus
}
#endif

#endif /* EMIOS_COMMON_TYPES_H */
/** @} */
