/*==================================================================================================
*   Project              : RTD AUTOSAR 4.4
*   Platform             : CORTEXM
*   Peripheral           : ADC_SAR
*   Dependencies         : none
*
*   Autosar Version      : 4.4.0
*   Autosar Revision     : ASR_REL_4_4_REV_0000
*   Autosar Conf.Variant :
*   SW Version           : 0.9.0
*   Build Version        : S32K3_RTD_0_9_0__ASR_REL_4_4_REV_0000_20210326
*
*   (c) Copyright 2020 - 2021 NXP Semiconductors
*   All Rights Reserved.
*
*   NXP Confidential. This software is owned or controlled by NXP and may only be
*   used strictly in accordance with the applicable license terms. By expressly
*   accepting such terms or by downloading, installing, activating and/or otherwise
*   using the software, you are agreeing that you have read, and that you agree to
*   comply with and are bound by, such license terms. If you do not agree to be
*   bound by the applicable license terms, then you may not retain, install,
*   activate or otherwise use the software.
==================================================================================================*/

/**
*   @file
*
*   @addtogroup adc_sar_ip_config Adc Sar IPL Configuration
*   @{
*/

#ifdef __cplusplus
extern "C"{
#endif

/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Adc_Sar_Ip_BOARD_InitPeripherals_PBcfg.h"

/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define ADC_SAR_IP_VENDOR_ID_BOARD_INITPERIPHERALS_PBCFG_C                     43
#define ADC_SAR_IP_AR_RELEASE_MAJOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_C      4
#define ADC_SAR_IP_AR_RELEASE_MINOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_C      4
#define ADC_SAR_IP_AR_RELEASE_REVISION_VERSION_BOARD_INITPERIPHERALS_PBCFG_C   0
#define ADC_SAR_IP_SW_MAJOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_C              0
#define ADC_SAR_IP_SW_MINOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_C              9
#define ADC_SAR_IP_SW_PATCH_VERSION_BOARD_INITPERIPHERALS_PBCFG_C              0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
/* Check if Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.c file and Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.h file are of the same vendor */
#if (ADC_SAR_IP_VENDOR_ID_BOARD_INITPERIPHERALS_PBCFG_C != ADC_SAR_IP_VENDOR_ID_BOARD_INITPERIPHERALS_PBCFG_H)
    #error "Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.c and Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.h have different vendor ids"
#endif

/* Check if Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.c file and Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.h file are of the same Autosar version */
#if ((ADC_SAR_IP_AR_RELEASE_MAJOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_C != ADC_SAR_IP_AR_RELEASE_MAJOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_H) || \
     (ADC_SAR_IP_AR_RELEASE_MINOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_C != ADC_SAR_IP_AR_RELEASE_MINOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_H) || \
     (ADC_SAR_IP_AR_RELEASE_REVISION_VERSION_BOARD_INITPERIPHERALS_PBCFG_C != ADC_SAR_IP_AR_RELEASE_REVISION_VERSION_BOARD_INITPERIPHERALS_PBCFG_H) \
    )
    #error "AutoSar Version Numbers of Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.c and Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.h are different"
#endif

/* Check if Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.c file and Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.h file are of the same Software version */
#if ((ADC_SAR_IP_SW_MAJOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_C != ADC_SAR_IP_SW_MAJOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_H) || \
     (ADC_SAR_IP_SW_MINOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_C != ADC_SAR_IP_SW_MINOR_VERSION_BOARD_INITPERIPHERALS_PBCFG_H) || \
     (ADC_SAR_IP_SW_PATCH_VERSION_BOARD_INITPERIPHERALS_PBCFG_C != ADC_SAR_IP_SW_PATCH_VERSION_BOARD_INITPERIPHERALS_PBCFG_H) \
    )
  #error "Software Version Numbers of Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.c and Adc_Sar_Ip_BOARD_INITPERIPHERALS_PBcfg.h are different"
#endif

/*==================================================================================================
*                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/

/*==================================================================================================
*                                       LOCAL MACROS
==================================================================================================*/

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

#define ADC_START_SEC_CONFIG_DATA_UNSPECIFIED
#include "Adc_MemMap.h"

static const Adc_Sar_Ip_ChanConfigType AdcSarIpChansConfig_0_BOARD_INITPERIPHERALS[1] =
{
    {
        .u8ChannelIndex = 6U,
        .bPresamplingEnable = FALSE,
        .bEndOfConvNotification = TRUE,
        .bWdgNotification = FALSE
    }
};

static const Adc_Sar_Ip_ChanConfigType AdcSarIpChansConfig_1_BOARD_INITPERIPHERALS[2] =
{
    {
        .u8ChannelIndex = 43U,
        .bPresamplingEnable = FALSE,
        .bEndOfConvNotification = TRUE,
        .bWdgNotification = FALSE
    },
    {
        .u8ChannelIndex = 2U,
        .bPresamplingEnable = FALSE,
        .bEndOfConvNotification = TRUE,
        .bWdgNotification = FALSE
    }
};

static const Adc_Sar_Ip_ChanConfigType AdcSarIpChansConfig_2_BOARD_INITPERIPHERALS[3] =
{
    {
        .u8ChannelIndex = 3U,
        .bPresamplingEnable = FALSE,
        .bEndOfConvNotification = TRUE,
        .bWdgNotification = FALSE
    },
    {
        .u8ChannelIndex = 4U,
        .bPresamplingEnable = FALSE,
        .bEndOfConvNotification = TRUE,
        .bWdgNotification = FALSE
    },
    {
        .u8ChannelIndex = 5U,
        .bPresamplingEnable = FALSE,
        .bEndOfConvNotification = TRUE,
        .bWdgNotification = FALSE
    }
};


/*==================================================================================================
*                                      LOCAL VARIABLES
==================================================================================================*/

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

/*==================================================================================================
*                                      GLOBAL VARIABLES
==================================================================================================*/

const Adc_Sar_Ip_ConfigType AdcHwUnit_0_BOARD_INITPERIPHERALS =
{
    .eConvMode = ADC_SAR_IP_CONV_MODE_ONESHOT,
    .eClkSelect = ADC_SAR_IP_CLK_QUARTER_BUS,
    .eCalibrationClkSelect = ADC_SAR_IP_CLK_FULL_BUS,
#if FEATURE_ADC_HAS_CTU
    .eCtuMode = ADC_SAR_IP_CTU_MODE_DISABLED,
#endif /* FEATURE_ADC_HAS_CTU */
#if FEATURE_ADC_HAS_INJ_EXT_TRIGGER
    .eInjectedEdge = ADC_SAR_IP_EXT_TRIG_EDGE_DISABLED,
#endif /* FEATURE_ADC_HAS_INJ_EXT_TRIGGER */
#if FEATURE_ADC_HAS_EXT_TRIGGER
    .eExtTrigger = ADC_SAR_IP_EXT_TRIG_EDGE_DISABLED,
    .bNormalExtTrgEn = FALSE,
    .bNormalAuxExtTrgEn = FALSE,
#endif /* FEATURE_ADC_HAS_EXT_TRIGGER */
    .aSampleTime = { 255U, 255U, 255U },
    .bBypassSampling = FALSE,
    .aPresamplingSource = { ADC_SAR_IP_PRESAMPLE_VREFL, ADC_SAR_IP_PRESAMPLE_VREFL, ADC_SAR_IP_PRESAMPLE_VREFL },
    .bAutoClockOff = FALSE,
    .bOverwriteEnable = TRUE,
    .eDataAlign = ADC_SAR_IP_DATA_ALIGNED_RIGHT,
#if FEATURE_ADC_SAR_DECODE_DELAY
    .u16DecodeDelay = 0U,
#endif /* FEATURE_ADC_SAR_DECODE_DELAY */
    .u8PowerDownDelay = 0U,
#if FEATURE_ADC_HAS_AVERAGING
    .bAvgEn = FALSE,
    .eAvgSel = ADC_SAR_IP_AVG_4_CONV,
#endif /* FEATURE_ADC_HAS_AVERAGING */
    .u8UsrOffset = 0U,
    .u16UsrGain = 0U,
#if (ADC_SAR_IP_SET_RESOLUTION == STD_ON)
    .eAdcResolution = RESOLUTION_12,
#endif /* (ADC_SAR_IP_SET_RESOLUTION == STD_ON) */
    .eDmaClearSource = ADC_SAR_IP_DMA_REQ_CLEAR_ON_ACK,
    .pChanMaskNormal = { 0x40U, 0x0U, 0x0U },
    .pChanMaskInjected = { 0x0U, 0x0U, 0x0U },
    .u8NumChannels = 1U,
    .pChannelConfigs = AdcSarIpChansConfig_0_BOARD_INITPERIPHERALS,
    .u8NumWdgThresholds = 0U,
    .pWdgThresholds = NULL_PTR,
    .pfEndOfNormalChainNotification = Adc0EndOfChainNoti,
    .pfEndOfInjectedChainNotification = NULL_PTR,
#if FEATURE_ADC_HAS_CTU
    .pfEndOfCtuConversionNotification = NULL_PTR,
#endif /* FEATURE_ADC_HAS_CTU */
    .pfEndOfConvNotification = NULL_PTR,
    .pfWdgOutOfRangeNotification = NULL_PTR
};

const Adc_Sar_Ip_ConfigType AdcHwUnit_1_BOARD_INITPERIPHERALS =
{
    .eConvMode = ADC_SAR_IP_CONV_MODE_ONESHOT,
    .eClkSelect = ADC_SAR_IP_CLK_QUARTER_BUS,
    .eCalibrationClkSelect = ADC_SAR_IP_CLK_FULL_BUS,
#if FEATURE_ADC_HAS_CTU
    .eCtuMode = ADC_SAR_IP_CTU_MODE_DISABLED,
#endif /* FEATURE_ADC_HAS_CTU */
#if FEATURE_ADC_HAS_INJ_EXT_TRIGGER
    .eInjectedEdge = ADC_SAR_IP_EXT_TRIG_EDGE_DISABLED,
#endif /* FEATURE_ADC_HAS_INJ_EXT_TRIGGER */
#if FEATURE_ADC_HAS_EXT_TRIGGER
    .eExtTrigger = ADC_SAR_IP_EXT_TRIG_EDGE_DISABLED,
    .bNormalExtTrgEn = FALSE,
    .bNormalAuxExtTrgEn = FALSE,
#endif /* FEATURE_ADC_HAS_EXT_TRIGGER */
    .aSampleTime = { 255U, 255U, 255U },
    .bBypassSampling = FALSE,
    .aPresamplingSource = { ADC_SAR_IP_PRESAMPLE_VREFL, ADC_SAR_IP_PRESAMPLE_VREFL, ADC_SAR_IP_PRESAMPLE_VREFL },
    .bAutoClockOff = FALSE,
    .bOverwriteEnable = TRUE,
    .eDataAlign = ADC_SAR_IP_DATA_ALIGNED_RIGHT,
#if FEATURE_ADC_SAR_DECODE_DELAY
    .u16DecodeDelay = 0U,
#endif /* FEATURE_ADC_SAR_DECODE_DELAY */
    .u8PowerDownDelay = 0U,
#if FEATURE_ADC_HAS_AVERAGING
    .bAvgEn = FALSE,
    .eAvgSel = ADC_SAR_IP_AVG_4_CONV,
#endif /* FEATURE_ADC_HAS_AVERAGING */
    .u8UsrOffset = 0U,
    .u16UsrGain = 0U,
#if (ADC_SAR_IP_SET_RESOLUTION == STD_ON)
    .eAdcResolution = RESOLUTION_12,
#endif /* (ADC_SAR_IP_SET_RESOLUTION == STD_ON) */
    .eDmaClearSource = ADC_SAR_IP_DMA_REQ_CLEAR_ON_ACK,
    .pChanMaskNormal = { 0x4U, 0x800U, 0x0U },
    .pChanMaskInjected = { 0x0U, 0x0U, 0x0U },
    .u8NumChannels = 2U,
    .pChannelConfigs = AdcSarIpChansConfig_1_BOARD_INITPERIPHERALS,
    .u8NumWdgThresholds = 0U,
    .pWdgThresholds = NULL_PTR,
    .pfEndOfNormalChainNotification = Adc1EndOfChainNoti,
    .pfEndOfInjectedChainNotification = NULL_PTR,
#if FEATURE_ADC_HAS_CTU
    .pfEndOfCtuConversionNotification = NULL_PTR,
#endif /* FEATURE_ADC_HAS_CTU */
    .pfEndOfConvNotification = NULL_PTR,
    .pfWdgOutOfRangeNotification = NULL_PTR
};

const Adc_Sar_Ip_ConfigType AdcHwUnit_2_BOARD_INITPERIPHERALS =
{
    .eConvMode = ADC_SAR_IP_CONV_MODE_ONESHOT,
    .eClkSelect = ADC_SAR_IP_CLK_QUARTER_BUS,
    .eCalibrationClkSelect = ADC_SAR_IP_CLK_FULL_BUS,
#if FEATURE_ADC_HAS_CTU
    .eCtuMode = ADC_SAR_IP_CTU_MODE_DISABLED,
#endif /* FEATURE_ADC_HAS_CTU */
#if FEATURE_ADC_HAS_INJ_EXT_TRIGGER
    .eInjectedEdge = ADC_SAR_IP_EXT_TRIG_EDGE_DISABLED,
#endif /* FEATURE_ADC_HAS_INJ_EXT_TRIGGER */
#if FEATURE_ADC_HAS_EXT_TRIGGER
    .eExtTrigger = ADC_SAR_IP_EXT_TRIG_EDGE_DISABLED,
    .bNormalExtTrgEn = FALSE,
    .bNormalAuxExtTrgEn = FALSE,
#endif /* FEATURE_ADC_HAS_EXT_TRIGGER */
    .aSampleTime = { 255U, 255U, 255U },
    .bBypassSampling = FALSE,
    .aPresamplingSource = { ADC_SAR_IP_PRESAMPLE_VREFL, ADC_SAR_IP_PRESAMPLE_VREFL, ADC_SAR_IP_PRESAMPLE_VREFL },
    .bAutoClockOff = FALSE,
    .bOverwriteEnable = TRUE,
    .eDataAlign = ADC_SAR_IP_DATA_ALIGNED_RIGHT,
#if FEATURE_ADC_SAR_DECODE_DELAY
    .u16DecodeDelay = 0U,
#endif /* FEATURE_ADC_SAR_DECODE_DELAY */
    .u8PowerDownDelay = 0U,
#if FEATURE_ADC_HAS_AVERAGING
    .bAvgEn = FALSE,
    .eAvgSel = ADC_SAR_IP_AVG_4_CONV,
#endif /* FEATURE_ADC_HAS_AVERAGING */
    .u8UsrOffset = 0U,
    .u16UsrGain = 0U,
#if (ADC_SAR_IP_SET_RESOLUTION == STD_ON)
    .eAdcResolution = RESOLUTION_12,
#endif /* (ADC_SAR_IP_SET_RESOLUTION == STD_ON) */
    .eDmaClearSource = ADC_SAR_IP_DMA_REQ_CLEAR_ON_ACK,
    .pChanMaskNormal = { 0x38U, 0x0U, 0x0U },
    .pChanMaskInjected = { 0x0U, 0x0U, 0x0U },
    .u8NumChannels = 3U,
    .pChannelConfigs = AdcSarIpChansConfig_2_BOARD_INITPERIPHERALS,
    .u8NumWdgThresholds = 0U,
    .pWdgThresholds = NULL_PTR,
    .pfEndOfNormalChainNotification = Adc2EndOfChainNoti,
    .pfEndOfInjectedChainNotification = NULL_PTR,
#if FEATURE_ADC_HAS_CTU
    .pfEndOfCtuConversionNotification = NULL_PTR,
#endif /* FEATURE_ADC_HAS_CTU */
    .pfEndOfConvNotification = NULL_PTR,
    .pfWdgOutOfRangeNotification = NULL_PTR
};


#define ADC_STOP_SEC_CONFIG_DATA_UNSPECIFIED
#include "Adc_MemMap.h"

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

/*==================================================================================================
*                                       LOCAL FUNCTIONS
==================================================================================================*/

/*==================================================================================================
*                                       GLOBAL FUNCTIONS
==================================================================================================*/

#ifdef __cplusplus
}
#endif

/** @} */

