hi,
use S32K148 + AUTOSAR control PTE-21.22.23 LED toggle.
i do not konw how to do ?
step1: EB_tresos tool generate AUTOSAR_code.
step2: porting AUTOSAR_code to S32DS .
step3: integrated development on S32DS.
But I try to generate AUTOSAR_code are NULL , feel like useless functions.
#ifdef __cplusplus
extern "C" {
#endif
/*=================================================================================================
* INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
=================================================================================================*/
#include "Dio.h"
#if (defined(DIO_PRECOMPILE_SUPPORT) || defined(DIO_LINKTIME_SUPPORT))
/*=================================================================================================
* SOURCE FILE VERSION INFORMATION
=================================================================================================*/
#define DIO_VENDOR_ID_CFG_C 43
/** @violates @ref Dio_Cfg_C_REF_1 The used compilers use more than 31 chars for identifiers. */
#define DIO_AR_RELEASE_MAJOR_VERSION_CFG_C 4
/** @violates @ref Dio_Cfg_C_REF_1 The used compilers use more than 31 chars for identifiers. */
#define DIO_AR_RELEASE_MINOR_VERSION_CFG_C 3
/** @violates @ref Dio_Cfg_C_REF_1 The used compilers use more than 31 chars for identifiers. */
#define DIO_AR_RELEASE_REVISION_VERSION_CFG_C 1
#define DIO_SW_MAJOR_VERSION_CFG_C 1
#define DIO_SW_MINOR_VERSION_CFG_C 0
#define DIO_SW_PATCH_VERSION_CFG_C 1
/*=================================================================================================
* FILE VERSION CHECKS
=================================================================================================*/
#if (((DIO_AR_RELEASE_MAJOR_VERSION_CFG_C != DIO_AR_RELEASE_MAJOR_VERSION) || \
(DIO_AR_RELEASE_MINOR_VERSION_CFG_C != DIO_AR_RELEASE_MINOR_VERSION) \
) || \
(DIO_AR_RELEASE_REVISION_VERSION_CFG_C != DIO_AR_RELEASE_REVISION_VERSION)\
)
#error "AutoSar Version Numbers of Dio_Cfg.c and Dio.h are different"
#endif
#if ((DIO_SW_MAJOR_VERSION_CFG_C != DIO_SW_MAJOR_VERSION) || \
(DIO_SW_MINOR_VERSION_CFG_C != DIO_SW_MINOR_VERSION) || \
(DIO_SW_PATCH_VERSION_CFG_C != DIO_SW_PATCH_VERSION) \
)
#error "Software Version Numbers of Dio_Cfg.c and Dio.h are different"
#endif
#if ((DIO_VENDOR_ID_CFG_C != DIO_VENDOR_ID))
#error "VENDOR ID for Dio_Cfg.c and Dio.h is different"
#endif
/*=================================================================================================
* LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
=================================================================================================*/
/*=================================================================================================
* LOCAL MACROS
=================================================================================================*/
/*=================================================================================================
* LOCAL CONSTANTS
=================================================================================================*/
/*=================================================================================================
* LOCAL VARIABLES
=================================================================================================*/
/*=================================================================================================
* GLOBAL CONSTANTS
=================================================================================================*/
#define DIO_START_SEC_CONFIG_DATA_UNSPECIFIED
/** @violates @ref Dio_Cfg_C_REF_2 MISRA 2004 Required Rule 19.15,
Precautions to prevent the contents of a header file being included twice.*/
#include "Dio_MemMap.h"
/**
* @brief Platform implemented port pins representation.
* @details Array of bit maps reflecting the available pins in each port.
* The number of elements in the array corresponds to the number of
* ports implemented in the platform package. Rightmost bit of each
* array element corresponds to channel 0 of the associated port,
* while leftmost bit of each array element corresponds to channel 31
* of the associated port. A 0 bit means that the correspondent channel
* is not available in the platform package, while a bit of 1 means
* that the correspondent channel is available in the platform package.
*
* @api
*/
/** @violates @ref Dio_Cfg_C_REF_4 This warning appears when defining functions or objects that will be used by the upper layers. */
CONST(Dio_PortLevelType, DIO_CONST) Dio_aAvailablePinsForWrite[DIO_NUM_PORTS_U16] =
{
(Dio_PortLevelType)0xFFFFFFFFUL,
(Dio_PortLevelType)0xFFFFFFFFUL,
(Dio_PortLevelType)0xFFFFFFFFUL,
(Dio_PortLevelType)0xFFFFFFFFUL,
(Dio_PortLevelType)0x0FFFFFFFUL
};
/** @violates @ref Dio_Cfg_C_REF_4 This warning appears when defining functions or objects that will be used by the upper layers. */
CONST(Dio_PortLevelType, DIO_CONST) Dio_aAvailablePinsForRead[DIO_NUM_PORTS_U16] =
{
(Dio_PortLevelType)0xFFFFFFFFUL,
(Dio_PortLevelType)0xFFFFFFFFUL,
(Dio_PortLevelType)0xFFFFFFFFUL,
(Dio_PortLevelType)0xFFFFFFFFUL,
(Dio_PortLevelType)0x0FFFFFFFUL
};
/* ========== DioConfig ========== */
/**
* @brief Data structure for configuration DioConfig.
*/
/** @violates @ref Dio_Cfg_C_REF_4 This warning appears when defining functions or objects that will be used by the upper layers. */
CONST(Dio_ConfigType, DIO_CONST) DioConfig =
{
(uint8)0x0,
NULL_PTR
};
#define DIO_STOP_SEC_CONFIG_DATA_UNSPECIFIED
/** @violates @ref Dio_Cfg_C_REF_2 MISRA 2004 Required Rule 19.15,
Precautions to prevent the contents of a header file being included twice.*/
/** @violates @ref Dio_Cfg_C_REF_3 MISRA 2004 Advisory Rule 19.1,
Only preprocessor statements and comments before '#include'.*/
#include "Dio_MemMap.h"
/*=================================================================================================
* GLOBAL VARIABLES
=================================================================================================*/
/*=================================================================================================
* LOCAL FUNCTION PROTOTYPES
=================================================================================================*/
/*=================================================================================================
* LOCAL FUNCTIONS
=================================================================================================*/
/*=================================================================================================
* GLOBAL FUNCTIONS
=================================================================================================*/
#endif /* (defined(DIO_PRECOMPILE_SUPPORT) || defined(DIO_LINKTIME_SUPPORT)) */
#ifdef __cplusplus
}
#endif
/** @} */
BRS
Grayli
Hello WANG LI,
I see that you just configure one "DIO channel" and do not have any "DIO channel group".
So the generated code in file Dio_Cfg.c will be:
CONST(Dio_ConfigType, DIO_CONST) DioConfig =
{
(uint8)0x0,
NULL_PTR
};
because this variable is used for "DIO channel group" (function Dio_ReadChannelGroup and Dio_WriteChannelGroup)
The configuration you set for "DIO channel" just effect to file Dio_Cfg.h:
#define DioConf_DioChannel_DioChannel_0 ((uint16)0x0015U)
and it will use as input of function Dio_ReadChannel or Dio_WriteChannel.