/**
*   @file    Spi_IPW_Types.h
*   @version 1.0.0
*
*   @brief   AUTOSAR Spi - Spi middle level driver header file.
*   @details This file is the header containing all the necessary information for SPI
*            LLD.
*   @addtogroup [SPI_MODULE]
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : DSPI
*   Dependencies         : 
*
*   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 SPI_IPW_TYPES_H
#define SPI_IPW_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.
*
*/

/*==================================================================================================
*                                        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
==================================================================================================*/
#define SPI_IPW_TYPES_VENDOR_ID                       43
#define SPI_IPW_TYPES_AR_RELEASE_MAJOR_VERSION        4
#define SPI_IPW_TYPES_AR_RELEASE_MINOR_VERSION        3
#define SPI_IPW_TYPES_AR_RELEASE_REVISION_VERSION     1
#define SPI_IPW_TYPES_SW_MAJOR_VERSION                1
#define SPI_IPW_TYPES_SW_MINOR_VERSION                0
#define SPI_IPW_TYPES_SW_PATCH_VERSION                0

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

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


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

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


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

/**
* @brief Internal structure used to manage the channel attributes.
*/
typedef struct
{
    VAR(uint32, SPI_VAR) u32CMD; /**< @brief Channel attributes for CMD in PUSHR (selects CTAR to use). */
#if (SPI_FORCE_DATA_TYPE == STD_ON)
    VAR(uint8, SPI_VAR)  u8DataWidth;       /**< @brief Channel attributes for data width. */
#endif
} Spi_Ipw_DspiChannelAttributesConfigType;

/**
* @brief Internal structure used to manage the DSPI unit attributes.
*/
typedef struct
{
#if (SPI_DUAL_CLOCK_MODE == STD_ON)
    VAR(uint32, SPI_VAR) u32CTAR[2];     /**< @brief Device attributes for CTARs. */
#else
    VAR(uint32, SPI_VAR) u32CTAR;        /**< @brief Device attributes for CTARs. */
#endif
    VAR(uint32, SPI_VAR) u32CMD;         /**< @brief Device attributes for CMD in PUSHR. */
    VAR(uint32, SPI_VAR) u32MCR;         /**< @brief Device CS idle setting. */
} Spi_Ipw_DspiDeviceAttributesConfigType;

/**
* @brief Internal structure used to manage LLD attributes.
*/
typedef struct
{
    P2CONST(Spi_Ipw_DspiChannelAttributesConfigType, SPI_VAR, SPI_APPL_CONST) pcDspiChannelAttributesConfig;   /**< @brief Array of configuration channel attributes. */
    P2CONST(Spi_Ipw_DspiDeviceAttributesConfigType, SPI_VAR, SPI_APPL_CONST) *pcDspiDeviceAttributesConfig;   /**< @brief Array of DSPI units attributes. */
} Spi_AttributesConfigType;

#ifdef TSB_MODE_SUPPORTED
#if (SPI_TSB_MODE == STD_ON)
/**
* @brief Internal structure used to manage the TSB attributes.
*/
typedef struct
{
    VAR(uint32, SPI_VAR) u32DSICR;    /**< @brief Device attributes for DSICR. */
    VAR(uint32, SPI_VAR) u32DSICR1;   /**< @brief Device attributes for DSICR1. */
#if (SPI_DUAL_CLOCK_MODE == STD_ON)
    VAR(uint32, SPI_VAR) u32CTAR[2];
#else
    VAR(uint32, SPI_VAR) u32CTAR;
#endif
} Spi_Ipw_TSBAttributesConfigType;
#endif /*SPI_TSB_MODE == STD_ON*/
#endif /*TSB_MODE_SUPPORTED*/

/**
* @brief Internal structure used to manage LLD attributes.
*/
typedef struct
{
    P2CONST(Spi_Ipw_DspiDeviceAttributesConfigType, SPI_VAR, SPI_APPL_CONST) *pcDspiExternalDeviceAttrs;
} Spi_Ipw_DeviceAttributesConfigType;
/*==================================================================================================
*                                GLOBAL VARIABLE DECLARATIONS
==================================================================================================*/


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


#ifdef __cplusplus
}
#endif

#endif /*SPI_IPW_TYPES_H*/

/** @} */
