/**
 * @file    Dio_Types.h
 * @version
 *
 * @brief   AUTOSAR Dio module interface
 * @details API implementation for DIO driver
 *
 * @addtogroup DIO_MODULE
 * @{
 */
/*==================================================================================================
 *   Project              : YTMicro AUTOSAR 4.4.0 MCAL
 *   Platform             : ARM
 *   Peripheral           : Dio
 *   Dependencies         : none
 *
 *   Autosar Version      : V4.4.0
 *   Autosar Revision     : ASR_REL_4_4_REV_0000
 *   Autosar Conf.Variant :
 *   SW Version           : V0.8.0
 *
 *
 *   (c) Copyright 2020-2026 Yuntu Microelectronics co.,ltd.
 *   All Rights Reserved.
==================================================================================================*/
#ifndef DIO_TYPES_H
#define DIO_TYPES_H

#ifdef __cplusplus
extern "C"
{
#endif

/*==================================================================================================
                                              INCLUDE FILES
==================================================================================================*/

#include "Dio_Cfg.h"

/*==================================================================================================
                                      HEADER FILE VERSION INFORMATION
==================================================================================================*/
#define DIO_TYPES_VENDOR_ID                      (180)
#define DIO_TYPES_AR_RELEASE_MAJOR_VERSION       (4)
#define DIO_TYPES_AR_RELEASE_MINOR_VERSION       (4)
#define DIO_TYPES_AR_RELEASE_REVISION_VERSION    (0)
#define DIO_TYPES_SW_MAJOR_VERSION               (0)
#define DIO_TYPES_SW_MINOR_VERSION               (8)
#define DIO_TYPES_SW_PATCH_VERSION               (0)

/*==================================================================================================
                                        FILE VERSION CHECKS
==================================================================================================*/
/* Check if source file and DIO configuration header file are of the same vendor */
#if (DIO_TYPES_VENDOR_ID != DIO_VENDOR_ID_CFG)
#error "Dio_Types.h and Dio_Cfg.h have different vendor ids"
#endif

/* Check if source file and DIO configuration header file are of the same Autosar version */
#if ((DIO_TYPES_AR_RELEASE_MAJOR_VERSION != DIO_AR_RELEASE_MAJOR_VERSION_CFG) || \
     (DIO_TYPES_AR_RELEASE_MINOR_VERSION != DIO_AR_RELEASE_MINOR_VERSION_CFG) || \
     (DIO_TYPES_AR_RELEASE_REVISION_VERSION != DIO_AR_RELEASE_REVISION_VERSION_CFG))
#error "AutoSar Version Numbers of Dio_Types.h and Dio_Cfg.h are different"
#endif

/* Check if source file and DIO configuration header file are of the same software version */
#if ((DIO_TYPES_SW_MAJOR_VERSION != DIO_SW_MAJOR_VERSION_CFG) || \
     (DIO_TYPES_SW_MINOR_VERSION != DIO_SW_MINOR_VERSION_CFG) || \
     (DIO_TYPES_SW_PATCH_VERSION != DIO_SW_PATCH_VERSION_CFG))
#error "Software Version Numbers of Dio_Types.h and Dio_Cfg.h are different"
#endif

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


/*==================================================================================================
                                                EXTERNAL CONSTANTS
==================================================================================================*/
/*==================================================================================================
                                                ENUMS
==================================================================================================*/
/*==================================================================================================
*                                             TYPEDEF
==================================================================================================*/
/**
 * @brief          These are the possible levels a DIO channel can have
 * @autosar        SWS_Dio_00185
 */
typedef uint8 Dio_LevelType;

/**
 * @brief          Numeric ID of a DIO channel.
 * @autosar        SWS_Dio_00182
 */
typedef uint16 Dio_ChannelType;

/**
 * @brief          If the MCU owns ports of different port widths (e.g. 4, 8,16...Bit), Dio_PortLevelType inherits the size of the largest port.
 * @autosar        SWS_Dio_00186
 */
typedef uint32 Dio_PortLevelType;

/**
 * @brief          Numeric ID of a DIO port.
 * @autosar        SWS_Dio_00183
 */
typedef uint8 Dio_PortType;

/**
 * @brief          Data type for the symbolic name of a DIO channel (pin). Shall cover all available DIO channels.
 * @autosar        N/A
 */
typedef uint8 Dio_PinType;

#if (DIO_CHANNEL_GROUP_NUMBER != 0)
/**
 * @brief          Type for the definition of a channel group, which consists of several adjoining channels within a port.
 * @autosar        SWS_Dio_00184
 */
typedef struct
{
    uint32 mask;                       /**< This element mask which defines the positions of the channel group. */
    uint8 offset;                      /**< This element shall be the position of the Channel Group on the port, counted from the LSB. */
    Dio_PortType port;                 /**< This shall be the port on which the Channel group is defined. */
} Dio_ChannelGroupType;
#endif /* (DIO_CHANNEL_GROUP_NUMBER != 0) */


#ifdef __cplusplus
}
#endif

#endif /* DIO_TYPES_H */

/** @} */

