/*!
* @file     Pdl_Types.h
*
* @version  1.0.0
*
* @brief    The header of Pdl driver.
*           This header file includes the API specification and other variables of the PDL driver.
* @attention
*
* Project Name      : AUTOSAR MCAL
*
* Platform          : Arm
*
* Autosar Standard  : Classic Platform 4.4.0
*
* Compiled Version  : G32A10xx_MCAL_1_0_0_01-Otc-25
*
* Copyright (C) 2026 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (Geehy Semiconductor Software License Agreement).
*
* The program is only for reference, which is distributed in the hope
* that it will be usefull and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the Geehy Semiconductor Software License Agreement for the governing permissions
* and limitations under the License.
*/

#ifndef PDL_TYPES_H
#define PDL_TYPES_H

#ifdef __cplusplus
extern "C"
{
#endif  /* ifdef __cplusplus */

#include "CDD_Pdl_Cfg.h"
#include "Pdl_DmaTypes.h"
/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

/** @defgroup PDL_Driver
  * @brief PDL driver modules
  @{
*/

/** @defgroup PDL_Macros
  @{
*/
/**********************************************************************************************************************
*                                SOURCE FILE VERSION INFORMATION
***********************************************************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */ 
#define PDL_TYPES_H_VENDOR_ID                              0x00C1U
/** Module ID of this module, as defined in the BSW Module List. */
#define PDL_TYPES_H_MODULE_ID                              0x00FFU
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */ 
#define PDL_TYPES_H_AR_RELEASE_MAJOR_VERSION               0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define PDL_TYPES_H_AR_RELEASE_MINOR_VERSION               0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define PDL_TYPES_H_AR_RELEASE_REVISION_VERSION            0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */ 
#define PDL_TYPES_H_SW_MAJOR_VERSION                       0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define PDL_TYPES_H_SW_MINOR_VERSION                       0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define PDL_TYPES_H_SW_PATCH_VERSION                       0x00U
/**@} end of group PDL_Macros */
/**********************************************************************************************************************
                                  VERSION INFOMATION VERIFICATION
***********************************************************************************************************************/
#if (PDL_TYPES_H_VENDOR_ID != PDL_CFG_H_VENDOR_ID)
    #error "Vendor ids mismatch between Pdl_Types.h and CDD_Pdl_Cfg.h"
#endif  /* {if (PDL_TYPES_H_VENDOR_ID != PDL_CFG_H_VENDOR_ID)} */
    
/* Make sure the AUTOSAR major version number is the same between Pdl_Types.h and CDD_Pdl_Cfg.h */
#if (PDL_TYPES_H_AR_RELEASE_MAJOR_VERSION != PDL_CFG_H_AR_RELEASE_MAJOR_VERSION)
    #error "AUTOSAR Major Version Numbers mismatch between Pdl_Types.h and CDD_Pdl_Cfg.h"
#endif
/* Make sure the AUTOSAR minor version number is the same between Pdl_Types.h and CDD_Pdl_Cfg.h */
#if (PDL_TYPES_H_AR_RELEASE_MINOR_VERSION != PDL_CFG_H_AR_RELEASE_MINOR_VERSION)
    #error "AUTOSAR Minor Version Numbers mismatch between Pdl_Types.h and CDD_Pdl_Cfg.h"
#endif
/* Make sure the AUTOSAR revision version number is the same between Pdl_Types.h and CDD_Pdl_Cfg.h */
#if (PDL_TYPES_H_AR_RELEASE_REVISION_VERSION != PDL_CFG_H_AR_RELEASE_REVISION_VERSION)
    #error "AUTOSAR Revision Version Numbers mismatch between Pdl_Types.h and CDD_Pdl_Cfg.h"
#endif

/* Make sure the software major version number is the same between Pdl_Types.h and CDD_Pdl_Cfg.h */
#if (PDL_TYPES_H_SW_MAJOR_VERSION != PDL_CFG_H_SW_MAJOR_VERSION)
    #error "Software Major Version Numbers mismatch between Pdl_Types.h and CDD_Pdl_Cfg.h"
#endif
/* Make sure the software minor version number is the same between Pdl_Types.h and CDD_Pdl_Cfg.h */
#if (PDL_TYPES_H_SW_MINOR_VERSION != PDL_CFG_H_SW_MINOR_VERSION)
    #error "Software Minor Version Numbers mismatch between Pdl_Types.h and CDD_Pdl_Cfg.h"
#endif
/* Make sure the software patch version number is the same between Pdl_Types.h and CDD_Pdl_Cfg.h */
#if (PDL_TYPES_H_SW_PATCH_VERSION != PDL_CFG_H_SW_PATCH_VERSION)
    #error "Software Patch Version Numbers mismatch between Pdl_Types.h and CDD_Pdl_Cfg.h"
#endif

/**********************************************************************************************************************
                                             OTHER TYPE DEFINITION
***********************************************************************************************************************/
/** @defgroup PDL_Enumerations
  @{
*/
/**
 * @brief          The Pdl function sids type.
 */
typedef enum
{
    PDL_GET_VERSION_INFO_SID                =    ((uint8)0x17U),
    PDL_INIT_SID                            =    ((uint8)0x23U),
#if (STD_ON == CDD_PDL_DMA_SUPPORT)
    PDL_PROCESS_NOTIFICATION_SID            =    ((uint8)0x1CU),
    PDL_ENABLE_NOTIFICATION_SID             =    ((uint8)0x21U),
    PDL_DISABLE_NOTIFICATION_SID            =    ((uint8)0x22U),
    PDL_CONFIG_CH_SID                       =    ((uint8)0x24U),
    PDL_ENABLE_DMA_CH_SID                   =    ((uint8)0x25U),
    PDL_SET_PRI_SID                         =    ((uint8)0x2AU),
    PDL_DISABLE_DMA_CH_SID                  =    ((uint8)0x2BU),
    PDL_TRANSF_COMPL_SID                    =    ((uint8)0x2CU),
    PDL_SET_TRANSF_DATA_SIZE_SID            =    ((uint8)0x2DU),
    PDL_DMA_CLEAR_DONE_SID                  =    ((uint8)0x30U),
    PDL_DMA_GET_INTERRUPT_REQUEST_SID       =    ((uint8)0x33U),
    PDL_ACKNOWLEDGE_INTERRUPT_SID           =    ((uint8)0x34U),
    PDL_DMA_GET_PHYSICAL_CHANNEL_SID        =    ((uint8)0x35U),
    PDL_ENABLE_CH_INT_SID                   =    ((uint8)0x4CU),
    PDL_DISABLE_CH_INT_SID                  =    ((uint8)0x4FU),
    PDL_GET_STRT_ITER_CH_SID                =    ((uint8)0x50U),
    PDL_DISABLE_HW_REQ_SID                  =    ((uint8)0x51U),
    PDL_GET_CH_ERR_STATUS_SID               =    ((uint8)0x53U),
#endif /* {if (STD_ON == CDD_PDL_DMA_SUPPORT)} */
    PDL_DEINIT_SID                          =    ((uint8)0x56U)
}Pdl_FunctionSidType;

/**
 * @brief          The Pdl error type.
 */
typedef enum
{
#if (STD_ON == CDD_PDL_DMA_SUPPORT)
    PDL_E_POINTER_PARA                 =   (uint8)0x0A,
    PDL_E_CH                           =   (uint8)0x0B,
    PDL_E_NULL_NOTIFI_CALLBACK         =   (uint8)0x10U,
    PDL_E_UNEX_INT                     =   (uint8)0x11U,
#endif
    PDL_E_UNINIT                       =   (uint8)0x0C,
    PDL_E_INITED                       =   (uint8)0x0D,
    PDL_E_VINFO_POINTER                =   (uint8)0x0F,
    PDL_E_CONFIG_PARA                  =   (uint8)0x12U,
    PDL_E_INIT_FAILED                  =   (uint8)0x13U,
    PDL_E_DMA_TRANS_RUNNING            =   (uint8)0x15U
}Pdl_ErrType;

#if (STD_ON == CDD_PDL_DMA_SUPPORT)
typedef enum
{
    PDL_DMA_LOGIC_CH0 = (0U),
    PDL_DMA_LOGIC_CH1,
    PDL_DMA_LOGIC_CH2,
    PDL_DMA_LOGIC_CH3,
    PDL_DMA_LOGIC_CH4,
    PDL_DMA_LOGIC_CH5,
    PDL_DMA_LOGIC_CH6,
    PDL_DMA_LOGIC_CH7,
    PDL_DMA_LOGIC_CH8,
    PDL_DMA_LOGIC_CH9,
    PDL_DMA_LOGIC_CH10,
    PDL_DMA_LOGIC_CH11,
    PDL_DMA_LOGIC_CH12,
    PDL_DMA_LOGIC_CH13,
    PDL_DMA_LOGIC_CH14,
    PDL_DMA_LOGIC_CH15,
    PDL_DMA_LOGIC_CH16,
    PDL_DMA_LOGIC_CH17
}Pdl_LogicChIdType;

/**@} end of group PDL_Enumerations */
/** @defgroup PDL_Structure
  @{
*/

/**
 * @brief The high level configuration structure of the Pdl Dma channel.
 */
typedef struct
{
    CONST(Pdl_ChType, PDL_CONST) pdlChId;
#if (STD_ON == CDD_PDL_DMA_NOTIFICATION_ENABLE)
    CONST(Pdl_NotifyType,       PDL_CONST) dmaChNotifiFuncPtr;
#endif /* {if (STD_ON == CDD_PDL_DMA_NOTIFICATION_ENABLE)} */
} Pdl_ChConfigType;

/**
 * @brief  The configuration structure of the Pdl Dma. 
 */
typedef struct
{
    /** The configuration of the IPs data */
    P2CONST(Pdl_DmaConfigType, PDL_VAR, PDL_APPL_CONST) pdlDmaConfigPtr;
} Pdl_DmaHwInitConfigType;

#endif /* {if (STD_ON == CDD_PDL_DMA_SUPPORT)} */

/**
 * @brief  The high level configuration structure of the Pdl driver.
 */
typedef struct
{
#if (STD_ON == CDD_PDL_DMA_SUPPORT)
#if (STD_OFF == CDD_PDL_DEM_ERR_REP_DISABLE)
    P2CONST(Pdl_DemConfigType, PDL_VAR, PDL_APPL_CONST) pdlDemConfigPtr;
#endif  /* {if (STD_OFF == CDD_PDL_DEM_ERR_REP_DISABLE)} */
    P2CONST(Pdl_DmaHwInitConfigType, PDL_VAR, PDL_APPL_CONST) pdlDmaHwConfigPtr;
#endif /* {if (STD_ON == CDD_PDL_DMA_SUPPORT)} */
} Pdl_ConfigType;

/**@} end of group PDL_Structure */
#ifdef __cplusplus
}
#endif  /* ifdef __cplusplus */

#endif  /* ifndef PDL_TYPES_H */
/**@} end of group PDL_Driver */
/**@} end of group G32A10xx_StdPeriphDriver */
