/**
*   @file    IoDal_Drv_Cfg.h
*   @version 1.0.0
*
*   @brief   Integration Framework - IO Driver Abstraction Layer component low-level configuration file
*   @details This file implements the IODAL configuration header for connection to low-level drivers.
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2018 NXP
*   All Rights Reserved.
*   This file contains sample code only. It is not part of the production code deliverables.
*
*/
/*=========================================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   
*   SW Version           : 1.0.0
*   Build Version        : MPC5777CXG_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190318
*
============================================================================================================================*/
/*============================================================================================================================
==============================================================================================================================*/
#ifndef IODAL_DRV_CFG_H
#define IODAL_DRV_CFG_H

#ifdef __cplusplus
extern "C"{
#endif

/*==================================================================================================
                                        LOCAL MACROS
==================================================================================================*/
[!AUTOSPACING!]
[!NOCODE!]
[!SELECT "IoDalBswConfig"!]
    [!VAR "AllChannelCount" = "num:i(count(IoDescriptors/*))"!]
    [!VAR "DioChannelCount" = "num:i(0)"!]
    [!VAR "AnalogChannelCount" = "num:i(0)"!]
    [!VAR "PwmChannelCount" = "num:i(0)"!]
    [!VAR "OcuChannelCount" = "num:i(0)"!]
    [!VAR "IcuChannelCount" = "num:i(0)"!]
    [!VAR "MBChannelCount" = "num:i(0)"!]	
    [!VAR "HW_Variants" = "num:i(1)"!]
    [!LOOP "IoDescriptors/*"!]
        [!IF "ReferenceType = 'Digital'"!]
            [!VAR "DioChannelCount" = "num:i($DioChannelCount + 1)"!]
        [!ELSEIF "ReferenceType = 'Analog'"!]
            [!VAR "AnalogChannelCount" = "num:i($AnalogChannelCount + 1)"!]
        [!ELSEIF "ReferenceType = 'Pwm'"!]
            [!VAR "PwmChannelCount" = "num:i($PwmChannelCount + 1)"!]
        [!ELSEIF "ReferenceType = 'Icu'"!]
            [!VAR "IcuChannelCount" = "num:i($IcuChannelCount + 1)"!]
        [!ELSEIF "ReferenceType = 'ExtDev'"!]
            [!VAR "MBChannelCount" = "num:i($MBChannelCount + 1)"!]	
        [!ELSE!]
            [!VAR "OcuChannelCount" = "num:i($OcuChannelCount + 1)"!]
        [!ENDIF!]
    [!ENDLOOP!]
[!CODE!]


[!IF "$DioChannelCount > num:i(0)"!]
#define IFWK_USE_DIO
[!ENDIF!]
[!IF "$AnalogChannelCount > num:i(0)"!]
#define IFWK_USE_ADC
[!ENDIF!]
[!IF "$PwmChannelCount > num:i(0)"!]
#define IFWK_USE_PWM
[!ENDIF!]
[!IF "$IcuChannelCount > num:i(0)"!]
#define IFWK_USE_ICU
[!ENDIF!]
[!IF "$OcuChannelCount > num:i(0)"!]
#define IFWK_USE_OCU
[!ENDIF!]
[!IF "$MBChannelCount > num:i(0)"!]
#define IFWK_USE_BRIDGE_DEV
[!ENDIF!]  
/**
    * @brief          Symbolic name for the configuration IoDal channels.
*
*/
[!ENDCODE!]
[!ENDSELECT!]
[!ENDNOCODE!]

#if defined(IFWK_USE_DIO) || defined(IFWK_USE_EXT_IN_DEV)
    #include "Dio.h"
    #include "Port.h"
#endif

#ifdef IFWK_USE_ADC
    #include "Adc.h"
#endif

#if defined(IFWK_USE_PWM) || defined(IFWK_USE_BRIDGE_DEV)
    #include "Pwm.h"
#endif

#ifdef IFWK_USE_OCU
    #include "Ocu.h"
#endif    
    
#ifdef IFWK_USE_ICU
    #include "Icu.h"
#endif
  
#ifdef IFWK_USE_ICU
    #include "Icu.h"
#endif
      
/*==================================================================================================
                                         INCLUDE FILES
 1) system and project includes
 2) needed interfaces from external units
 3) internal and external interfaces from this unit
==================================================================================================*/
#define IODAL_DRV_CFG_VENDOR_ID                       43

#define IODAL_DRV_CFG_AR_RELEASE_MAJOR_VERSION        4
#define IODAL_DRV_CFG_AR_RELEASE_MINOR_VERSION        3
#define IODAL_DRV_CFG_AR_RELEASE_REVISION_VERSION     1

#define IODAL_DRV_CFG_SW_MAJOR_VERSION                1
#define IODAL_DRV_CFG_SW_MINOR_VERSION                0
#define IODAL_DRV_CFG_SW_PATCH_VERSION                0    
    
    
typedef uint16 IoDal_PwmPeriodType;

typedef void (*IoDal_Dio_UpdateCalloutType)(uint32 *);

typedef void (*IoDal_Pwm_UpdateCalloutType)(uint16, uint16 *);  
   
/*================================================================================================*/
#ifdef __cplusplus
}
#endif

#endif  /* IODAL_TYPES_H*/
