/**
*   @file           Ocu_Ipw.c
*
*   @version        1.0.0
*
*   @brief          AUTOSAR Ocu - OCU Ipw API implementation.
*   @details        OCU IWP API implementation.
*
*   @addtogroup     OCU_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.
=====================================================================================================*/
/*===================================================================================================
======================================================================================================*/



#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 OCU_IPW_C_REF_1
* 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 OCU_IPW_C_REF_2
* 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 OCU_IPW_C_REF_3
*     Violates MISRA 2012 Advisory Rule 8.7, Functions and objects should not be defined with 
*     external linkage if they are referenced in only one translation unit.
*
*/


/*===============================================================================================
*                                         INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
===============================================================================================*/
/*
* @file           Ocu_Ipw.c
*/
#include "Ocu_Ipw_Types.h"
#include "Ocu_Ipw.h"
#include "Ocu_eMios.h"
#include "Ocu_Ipw_Irq.h"

/*===============================================================================================
*                                        SOURCE FILE VERSION INFORMATION
===============================================================================================*/
/**
* @{
* @file           Ocu_Ipw.c
*/
#define OCU_IPW_VENDOR_ID_C                     43
#define OCU_IPW_AR_RELEASE_MAJOR_VERSION_C      4
#define OCU_IPW_AR_RELEASE_MINOR_VERSION_C      3
#define OCU_IPW_AR_RELEASE_REVISION_VERSION_C   1
#define OCU_IPW_SW_MAJOR_VERSION_C              1
#define OCU_IPW_SW_MINOR_VERSION_C              0
#define OCU_IPW_SW_PATCH_VERSION_C              0
/**@}*/

/*===============================================================================================
*                                      FILE VERSION CHECKS
===============================================================================================*/
#if (OCU_IPW_VENDOR_ID_C != OCU_IPW_VENDOR_ID)
    #error "Ocu_Ipw.c and Ocu_Ipw.h have different vendor ids"
#endif

#if ((OCU_IPW_AR_RELEASE_MAJOR_VERSION_C    != OCU_IPW_AR_RELEASE_MAJOR_VERSION) || \
     (OCU_IPW_AR_RELEASE_MINOR_VERSION_C    != OCU_IPW_AR_RELEASE_MINOR_VERSION) || \
     (OCU_IPW_AR_RELEASE_REVISION_VERSION_C != OCU_IPW_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Ocu_Ipw.c and Ocu_Ipw.h are different"
#endif

#if ((OCU_IPW_SW_MAJOR_VERSION_C != OCU_IPW_SW_MAJOR_VERSION) || \
     (OCU_IPW_SW_MINOR_VERSION_C != OCU_IPW_SW_MINOR_VERSION) || \
     (OCU_IPW_SW_PATCH_VERSION_C != OCU_IPW_SW_PATCH_VERSION))
    #error "Software Version Numbers of Ocu_Ipw.c and Ocu_Ipw.h are different"
#endif

#if (OCU_IPW_VENDOR_ID_C != OCU_IPW_TYPES_VENDOR_ID)
    #error "Ocu_Ipw.c and Ocu_Ipw_Types.h have different vendor ids"
#endif

#if ((OCU_IPW_AR_RELEASE_MAJOR_VERSION_C    != OCU_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (OCU_IPW_AR_RELEASE_MINOR_VERSION_C    != OCU_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (OCU_IPW_AR_RELEASE_REVISION_VERSION_C != OCU_IPW_TYPES_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Ocu_Ipw.c and Ocu_Ipw_Types.h are different"
#endif

#if ((OCU_IPW_SW_MAJOR_VERSION_C != OCU_IPW_TYPES_SW_MAJOR_VERSION) || \
     (OCU_IPW_SW_MINOR_VERSION_C != OCU_IPW_TYPES_SW_MINOR_VERSION) || \
     (OCU_IPW_SW_PATCH_VERSION_C != OCU_IPW_TYPES_SW_PATCH_VERSION))
    #error "Software Version Numbers of Ocu_Ipw.c and Ocu_Ipw_Types.h are different"
#endif


#if (OCU_IPW_VENDOR_ID_C != OCU_EMIOS_VENDOR_ID)
    #error "Ocu_Ipw.c and Ocu_eMios.h have different vendor ids"
#endif

#if ((OCU_IPW_AR_RELEASE_MAJOR_VERSION_C    != OCU_EMIOS_AR_RELEASE_MAJOR_VERSION) || \
     (OCU_IPW_AR_RELEASE_MINOR_VERSION_C    != OCU_EMIOS_AR_RELEASE_MINOR_VERSION) || \
     (OCU_IPW_AR_RELEASE_REVISION_VERSION_C != OCU_EMIOS_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Ocu_Ipw.c and Ocu_eMios.h are different"
#endif

#if ((OCU_IPW_SW_MAJOR_VERSION_C != OCU_EMIOS_SW_MAJOR_VERSION) || \
     (OCU_IPW_SW_MINOR_VERSION_C != OCU_EMIOS_SW_MINOR_VERSION) || \
     (OCU_IPW_SW_PATCH_VERSION_C != OCU_EMIOS_SW_PATCH_VERSION))
    #error "Software Version Numbers of Ocu_Ipw.c and Ocu_eMios.h are different"
#endif

#if (OCU_IPW_VENDOR_ID_C != OCU_IPW_IRQ_VENDOR_ID)
    #error "Ocu_Ipw.c and Ocu_Ipw_Irq.h have different vendor ids"
#endif

#if ((OCU_IPW_AR_RELEASE_MAJOR_VERSION_C    != OCU_IPW_IRQ_AR_RELEASE_MAJOR_VERSION) || \
     (OCU_IPW_AR_RELEASE_MINOR_VERSION_C    != OCU_IPW_IRQ_AR_RELEASE_MINOR_VERSION) || \
     (OCU_IPW_AR_RELEASE_REVISION_VERSION_C != OCU_IPW_IRQ_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Ocu_Ipw.c and Ocu_Ipw_Irq.h are different"
#endif

#if ((OCU_IPW_SW_MAJOR_VERSION_C != OCU_IPW_IRQ_SW_MAJOR_VERSION) || \
     (OCU_IPW_SW_MINOR_VERSION_C != OCU_IPW_IRQ_SW_MINOR_VERSION) || \
     (OCU_IPW_SW_PATCH_VERSION_C != OCU_IPW_IRQ_SW_PATCH_VERSION))
    #error "Software Version Numbers of Ocu_Ipw.c and Ocu_Ipw_Irq.h are different"
#endif

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

#define OCU_START_SEC_VAR_INIT_UNSPECIFIED
/**
* @violates @ref OCU_IPW_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
* @violates @ref OCU_IPW_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Ocu_MemMap.h"

static P2CONST(Ocu_IpConfigType, AUTOMATIC, OCU_APPL_CONST) pIpwGlobalConfig;

#define OCU_STOP_SEC_VAR_INIT_UNSPECIFIED
/**
* @violates @ref OCU_IPW_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
* @violates @ref OCU_IPW_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Ocu_MemMap.h"

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

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

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

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

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

/*===============================================================================================
*                                       GLOBAL FUNCTIONS
===============================================================================================*/
#define OCU_START_SEC_CODE
/**
* @violates @ref OCU_IPW_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
* @violates @ref OCU_IPW_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Ocu_MemMap.h"

/*================================================================================================*/
/**
* @brief            Ocu_Ipw_Init
* @details          This function call the supported IP initialization functions.
*
* @param[in]        pIpConfig - Pointer to OCU top configuration structure
*
* @return           void
*
*
*/
FUNC (void, OCU_CODE) Ocu_Ipw_Init
(   
    CONSTP2CONST(Ocu_IpConfigType, AUTOMATIC, OCU_APPL_CONST) pIpConfig
)
{
    if(NULL_PTR != pIpConfig->peMiosIpConfig)
    {
        /* Call EMIOS IP init function */
        pIpwGlobalConfig = pIpConfig;
        
        Ocu_eMios_Init(pIpwGlobalConfig->peMiosIpConfig);
    }
}


/*===============================================================================================*/
#if (OCU_DEINIT_API == STD_ON)
/**
* @brief            Ocu_Ipw_DeInit
* @details          This function call the supported IP de-initialization functions.
*
* @param[in]        void
*
* @return           void
*/
FUNC (void, OCU_CODE) Ocu_Ipw_DeInit
(
    CONSTP2CONST(Ocu_IpConfigType, AUTOMATIC, OCU_APPL_CONST) pIpConfig
)
{
    if(NULL_PTR != pIpConfig->peMiosIpConfig)
    {
        /* Call EMIOS IP DeInit function */
        pIpwGlobalConfig = pIpConfig;
        
        Ocu_eMios_DeInit(pIpwGlobalConfig->peMiosIpConfig);
    }
}
#endif /* OCU_DEINIT_API */


/*===============================================================================================*/
/**
* @brief            Ocu_Ipw_StartChannel
* @details          This function will call StartChannel function for the corresponding IP of OcuChannel
*
* @param[in]        ChannelNumber  Ocu channel id in top configuration structure
*
* @return           void
*/
FUNC (void, OCU_CODE) Ocu_Ipw_StartChannel
(
    VAR(Ocu_ChannelType,  AUTOMATIC) ChannelNumber
)
{
    /* assigned HW channel id code */    
    VAR(uint8, AUTOMATIC) u8ChannelIndex;
    /* Pointer to eMios channel specific configuration */
    P2CONST(Ocu_eMios_ChannelConfigType, AUTOMATIC, OCU_APPL_CONST) peMiosChannelConfig;
    
    u8ChannelIndex = (*pIpwGlobalConfig->pIpChannelsConfig)[ChannelNumber].u8IdxChannelConfig;
    peMiosChannelConfig = &(*(pIpwGlobalConfig->peMiosIpConfig)->pChannelsConfig)[u8ChannelIndex];
    
    Ocu_eMios_StartChannel(peMiosChannelConfig->HwChannel);
}


/*===============================================================================================*/

/**
* @brief            Ocu_Ipw_StopChannel
* @details          This function will call StopChannel function for the corresponding IP of OcuChannel
*
* @param[in]        ChannelNumber  Ocu channel id in top configuration structure
*
* @return           void
*/
FUNC (void, OCU_CODE) Ocu_Ipw_StopChannel
(
    VAR(Ocu_ChannelType,  AUTOMATIC) ChannelNumber
)
{
    /* assigned HW channel id code */    
    VAR(uint8, AUTOMATIC) u8ChannelIndex; 
    /* Pointer to eMios channel specific configuration */
    P2CONST(Ocu_eMios_ChannelConfigType, AUTOMATIC, OCU_APPL_CONST) peMiosChannelConfig;
    
    u8ChannelIndex = (*pIpwGlobalConfig->pIpChannelsConfig)[ChannelNumber].u8IdxChannelConfig;
    peMiosChannelConfig = &(*(pIpwGlobalConfig->peMiosIpConfig)->pChannelsConfig)[u8ChannelIndex];
    
    Ocu_eMios_StopChannel(peMiosChannelConfig->HwChannel);
}


/*===============================================================================================*/
#if (OCU_SET_PIN_STATE_API == STD_ON)
/**
* @brief            Ocu_Ipw_SetPinState
* @details          This function will call SetPinState function for the corresponding IP of OcuChannel
*
* @param[in]        ChannelNumber  Ocu channel id in top configuration structure
* @param[in]        PinState        Expected Pin State for the given channel
*
* @return           void
*/
FUNC (void, OCU_CODE) Ocu_Ipw_SetPinState
(
    VAR(Ocu_ChannelType,  AUTOMATIC) ChannelNumber,
    VAR(Ocu_PinStateType, AUTOMATIC) PinState
)
{  
    /* assigned HW channel id code */    
    VAR(uint8, AUTOMATIC) u8ChannelIndex; 
    /* Pointer to eMios channel specific configuration */
    P2CONST(Ocu_eMios_ChannelConfigType, AUTOMATIC, OCU_APPL_CONST) peMiosChannelConfig;
    
    u8ChannelIndex = (*pIpwGlobalConfig->pIpChannelsConfig)[ChannelNumber].u8IdxChannelConfig;
    peMiosChannelConfig = &(*(pIpwGlobalConfig->peMiosIpConfig)->pChannelsConfig)[u8ChannelIndex];
    
    Ocu_eMios_SetPinState(peMiosChannelConfig->HwChannel, PinState);
}
#endif /* OCU_SET_PIN_STATE_API */


/*===============================================================================================*/
#if (OCU_SET_PIN_ACTION_API == STD_ON)
/**
* @brief            Ocu_Ipw_SetPinAction
* @details          This function will call SetPinAction function for the corresponding IP of OcuChannel
*
* @param[in]        ChannelNumber  Ocu channel id in top configuration structure
* @param[in]        PinAction       Expected Pin Action for the given channel
*
*/
FUNC(void, OCU_CODE) Ocu_Ipw_SetPinAction
(
    VAR(Ocu_ChannelType,   AUTOMATIC) ChannelNumber,
    VAR(Ocu_PinActionType, AUTOMATIC) PinAction,
    VAR(boolean,           AUTOMATIC) bIsRunning
)
{
    /* assigned HW channel id code */    
    VAR(uint8, AUTOMATIC) u8ChannelIndex; 
    /* Pointer to eMios channel specific configuration */
    P2CONST(Ocu_eMios_ChannelConfigType, AUTOMATIC, OCU_APPL_CONST) peMiosChannelConfig;
    
    u8ChannelIndex = (*pIpwGlobalConfig->pIpChannelsConfig)[ChannelNumber].u8IdxChannelConfig;
    peMiosChannelConfig = &(*(pIpwGlobalConfig->peMiosIpConfig)->pChannelsConfig)[u8ChannelIndex];

    Ocu_eMios_SetPinAction(peMiosChannelConfig->HwChannel, (uint8)PinAction, bIsRunning);    
}
#endif /* OCU_SET_PIN_ACTION_API */

#if (OCU_GET_COUNTER_API == STD_ON)
/*===============================================================================================*/
/**
* @brief            Ocu_Ipw_GetCounter
* @details          This function will call GetCounter function for the corresponding IP of OcuChannel
*
* @param[in]        ChannelNumber  Ocu channel id in top configuration structure
*
* @return           Ocu_ValueType
*/
FUNC (Ocu_ValueType, OCU_CODE) Ocu_Ipw_GetCounter
(
    VAR(Ocu_ChannelType,   AUTOMATIC) ChannelNumber
)
{
    /* counter value of the given eMios channel */
    VAR(Ocu_ValueType, AUTOMATIC) CounterValue = (Ocu_ValueType)0;
    /* assigned HW channel id code */    
    VAR(uint8, AUTOMATIC) u8ChannelIndex; 
    /* Pointer to eMios channel specific configuration */
    P2CONST(Ocu_eMios_ChannelConfigType, AUTOMATIC, OCU_APPL_CONST) peMiosChannelConfig;
    
    u8ChannelIndex = (*pIpwGlobalConfig->pIpChannelsConfig)[ChannelNumber].u8IdxChannelConfig;
    peMiosChannelConfig = &(*(pIpwGlobalConfig->peMiosIpConfig)->pChannelsConfig)[u8ChannelIndex];
    
    CounterValue = Ocu_eMios_GetCounter(peMiosChannelConfig->HwChannel_CounterBus);
    
    return CounterValue;
}
#endif /* OCU_GET_COUNTER_API */


#if (OCU_SET_ABSOLUTE_THRESHOLD_API == STD_ON)
/*===============================================================================================*/
/**
* @brief            Ocu_Ipw_SetAbsoluteThreshold
* @details          This function will change the compare match interval for the given timer channel
*
* @param[in]        ChannelNumber     Ocu channel id in top configuration structure
* @param[in]        ReferenceValue    Reference value for the counting interval
* @param[in]        AbsoluteValue     Reference value for the counting interval
*
* @return           TODO
*/
FUNC (Ocu_ReturnType, OCU_CODE) Ocu_Ipw_SetAbsoluteThreshold
(
    VAR(Ocu_ChannelType,   AUTOMATIC) ChannelNumber,
    VAR(Ocu_ValueType,     AUTOMATIC) ReferenceValue,
    VAR(Ocu_ValueType,     AUTOMATIC) AbsoluteValue
)
{
    VAR(Ocu_ReturnType, AUTOMATIC)  StatusValue = OCU_CM_OUT_REF_INTERVAL;
    /* assigned HW channel id code */    
    VAR(uint8, AUTOMATIC) u8ChannelIndex;
    /* Pointer to eMios channel specific configuration */
    P2CONST(Ocu_eMios_ChannelConfigType, AUTOMATIC, OCU_APPL_CONST) peMiosChannelConfig;
    
    u8ChannelIndex = (*pIpwGlobalConfig->pIpChannelsConfig)[ChannelNumber].u8IdxChannelConfig;
    peMiosChannelConfig = &(*(pIpwGlobalConfig->peMiosIpConfig)->pChannelsConfig)[u8ChannelIndex];
    
    StatusValue = Ocu_eMios_SetAbsoluteThreshold(peMiosChannelConfig->HwChannel, ReferenceValue, AbsoluteValue);
    
    return StatusValue;
}
#endif /* OCU_SET_ABSOLUTE_THRESHOLD_API */

#if (OCU_SET_RELATIVE_THRESHOLD_API == STD_ON)
/*===============================================================================================*/
/**
* @brief            Ocu_Ipw_SetRelativeThreshold
* @details          This function will change the compare match interval for the given timer channel
*
* @param[in]        ChannelNumber     Ocu channel id in top configuration structure
* @param[in]        RelativeValue     Reference value for the counting interval
*
* @return           TODO
*/
FUNC (Ocu_ReturnType, OCU_CODE) Ocu_Ipw_SetRelativeThreshold
(
    VAR(Ocu_ChannelType,   AUTOMATIC) ChannelNumber,
    VAR(Ocu_ValueType,     AUTOMATIC) RelativeValue
)
{
    VAR(Ocu_ReturnType, AUTOMATIC)  StatusValue = OCU_CM_OUT_REF_INTERVAL;
    /* assigned HW channel id code */
    VAR(uint8, AUTOMATIC) u8ChannelIndex;
    /* @brief Pointer to eMios channel specific configuration */
    P2CONST(Ocu_eMios_ChannelConfigType, AUTOMATIC, OCU_APPL_CONST) peMiosChannelConfig;
    
    u8ChannelIndex = (*pIpwGlobalConfig->pIpChannelsConfig)[ChannelNumber].u8IdxChannelConfig;
    peMiosChannelConfig = &(*(pIpwGlobalConfig->peMiosIpConfig)->pChannelsConfig)[u8ChannelIndex];
    
    StatusValue = Ocu_eMios_SetRelativeThreshold(peMiosChannelConfig->HwChannel, RelativeValue);
    
    return StatusValue;
}
#endif /*OCU_SET_RELATIVE_THRESHOLD_API*/

/*===============================================================================================*/
#if (OCU_SET_CLOCK_MODE_API == STD_ON)
/**
* @brief            Ocu_Ipw_SetClockMode
* @details          This function will call SetClockMode function of all configured Hw IPs
*
* @param[in]        pIpConfig - Pointer to OCU top configuration structure
* @param[in]        ePrescaler      OCU_PRIMARY_PRESCALER for normal clock mode or 
*                                   OCU_ALTERNATIVE_PRESCALER for a different prescaler for the driver
*/
FUNC (void, OCU_CODE) Ocu_Ipw_SetClockMode
(
    CONSTP2CONST(Ocu_IpConfigType, AUTOMATIC, OCU_APPL_CONST) pIpConfig,
    VAR(Ocu_SelectPrescalerType,   AUTOMATIC) ePrescaler
)
{
    if (NULL_PTR != pIpConfig->peMiosIpConfig)
    { 
        /* Call eMios IP function */
        Ocu_eMios_SetClockMode(pIpConfig->peMiosIpConfig, (uint8)ePrescaler);
    }
    else
    {
        /* do nothing */
    }
}
#endif

/*===============================================================================================*/
#if ((OCU_SET_RELATIVE_THRESHOLD_API == STD_ON) || (OCU_SET_ABSOLUTE_THRESHOLD_API == STD_ON))
/**
* @brief            Ocu_Ipw_GetMaxCountValue
* @details          This function will return max counter value for given channel
*
* @param[in]        u8ChannelNumber - Logic channel
* @return           Ocu_ValueType   - Max counter value for given channel
*/

/** 
* @violates @ref OCU_IPW_C_REF_3 MISRA 2012  Advisory Rule 8.7, These functions represent the API 
*   of the driver. External linkage is needed to ""export"" the API.
*/
FUNC (Ocu_ValueType, OCU_CODE) Ocu_Ipw_GetMaxCountValue
(
    VAR(Ocu_ChannelType,   AUTOMATIC) u8ChannelNumber
)
{
    P2CONST(Ocu_eMios_ChannelConfigType, AUTOMATIC, OCU_APPL_CONST) peMiosChannelConfig;
    VAR(Ocu_ValueType, AUTOMATIC)  ReturnMaxCountValue = 0U;
    
    peMiosChannelConfig = &(*(pIpwGlobalConfig->peMiosIpConfig)->pChannelsConfig)[u8ChannelNumber];
    
    ReturnMaxCountValue = Ocu_eMios_GetMaxCountValue(peMiosChannelConfig->HwChannel);

    return ReturnMaxCountValue;
}
#endif


#define OCU_STOP_SEC_CODE
/**
* @violates @ref OCU_IPW_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
* @violates @ref OCU_IPW_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Ocu_MemMap.h"

#ifdef __cplusplus
}
#endif

/** @} */
