mirror of
https://github.com/Dev-KATECH/ADM.git
synced 2026-05-17 01:43:59 +09:00
189 lines
10 KiB
C
189 lines
10 KiB
C
/*==================================================================================================
|
|
* Project : RTD AUTOSAR 4.4
|
|
* Platform : CORTEXM
|
|
* Peripheral : Emios Flexio
|
|
* Dependencies : none
|
|
*
|
|
* Autosar Version : 4.4.0
|
|
* Autosar Revision : ASR_REL_4_4_REV_0000
|
|
* Autosar Conf.Variant :
|
|
* SW Version : 0.9.0
|
|
* Build Version : S32K3_RTD_0_9_0__ASR_REL_4_4_REV_0000_20210326
|
|
*
|
|
* (c) Copyright 2020 - 2021 NXP Semiconductors
|
|
* All Rights Reserved.
|
|
*
|
|
* NXP Confidential. This software is owned or controlled by NXP and may only be
|
|
* used strictly in accordance with the applicable license terms. By expressly
|
|
* accepting such terms or by downloading, installing, activating and/or otherwise
|
|
* using the software, you are agreeing that you have read, and that you agree to
|
|
* comply with and are bound by, such license terms. If you do not agree to be
|
|
* bound by the applicable license terms, then you may not retain, install,
|
|
* activate or otherwise use the software.
|
|
==================================================================================================*/
|
|
|
|
#ifndef EMIOS_PWM_IP_CFG_H
|
|
#define EMIOS_PWM_IP_CFG_H
|
|
|
|
/**
|
|
* @file Emios_Pwm_Ip_Cfg.h
|
|
*
|
|
* @addtogroup emios_pwm_ip Emios Pwm IPL
|
|
* @{
|
|
*/
|
|
|
|
#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
|
|
==================================================================================================*/
|
|
/* Standard Types */
|
|
#include "StandardTypes.h"
|
|
|
|
/* DevAssert implementation */
|
|
#include "Devassert.h"
|
|
|
|
/* Register definitions */
|
|
#include "S32K344_EMIOS.h"
|
|
|
|
/* Include all variants header files. */
|
|
#include "Emios_Pwm_Ip_BOARD_InitPeripherals_PBcfg.h"
|
|
|
|
/*==================================================================================================
|
|
* SOURCE FILE VERSION INFORMATION
|
|
==================================================================================================*/
|
|
#define EMIOS_PWM_IP_CFG_VENDOR_ID 43
|
|
#define EMIOS_PWM_IP_CFG_MODULE_ID 121
|
|
#define EMIOS_PWM_IP_CFG_AR_RELEASE_MAJOR_VERSION 4
|
|
#define EMIOS_PWM_IP_CFG_AR_RELEASE_MINOR_VERSION 4
|
|
#define EMIOS_PWM_IP_CFG_AR_RELEASE_REVISION_VERSION 0
|
|
#define EMIOS_PWM_IP_CFG_SW_MAJOR_VERSION 0
|
|
#define EMIOS_PWM_IP_CFG_SW_MINOR_VERSION 9
|
|
#define EMIOS_PWM_IP_CFG_SW_PATCH_VERSION 0
|
|
|
|
/*==================================================================================================
|
|
* FILE VERSION CHECKS
|
|
==================================================================================================*/
|
|
#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
|
|
/* Check if header file and StandardTypes.h are of the same AUTOSAR version */
|
|
#if ((EMIOS_PWM_IP_CFG_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
|
|
(EMIOS_PWM_IP_CFG_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
|
|
#error "AUTOSAR Version Numbers of Emios_Pwm_Ip_Cfg.h and StandardTypes.h are different"
|
|
#endif
|
|
|
|
/* Check if header file and Devassert.h are of the same AUTOSAR version */
|
|
#if ((EMIOS_PWM_IP_CFG_AR_RELEASE_MAJOR_VERSION != DEVASSERT_AR_RELEASE_MAJOR_VERSION) || \
|
|
(EMIOS_PWM_IP_CFG_AR_RELEASE_MINOR_VERSION != DEVASSERT_AR_RELEASE_MINOR_VERSION))
|
|
#error "AUTOSAR Version Numbers of Emios_Pwm_Ip_Cfg.h and Devassert.h are different"
|
|
#endif
|
|
#endif
|
|
|
|
/* Check if header file and Emios_Pwm_Ip_BOARD_InitPeripherals_Pbcfg header file are of the same vendor */
|
|
#if (EMIOS_PWM_IP_CFG_VENDOR_ID != EMIOS_PWM_IP_BOARD_InitPeripherals_PB_CFG_VENDOR_ID)
|
|
#error "Vendor IDs of Emios_Pwm_Ip_Cfg.h and Emios_Pwm_Ip_BOARD_InitPeripherals_Pbcfg.h are different."
|
|
#endif
|
|
|
|
/* Check if header file and Pwm_EnvCfg header file are of the same AUTOSAR version */
|
|
#if ((EMIOS_PWM_IP_CFG_AR_RELEASE_MAJOR_VERSION != EMIOS_PWM_IP_BOARD_InitPeripherals_PB_CFG_AR_RELEASE_MAJOR_VERSION) || \
|
|
(EMIOS_PWM_IP_CFG_AR_RELEASE_MINOR_VERSION != EMIOS_PWM_IP_BOARD_InitPeripherals_PB_CFG_AR_RELEASE_MINOR_VERSION) || \
|
|
(EMIOS_PWM_IP_CFG_AR_RELEASE_REVISION_VERSION != EMIOS_PWM_IP_BOARD_InitPeripherals_PB_CFG_AR_RELEASE_REVISION_VERSION))
|
|
#error "AUTOSAR version numbers of Emios_Pwm_Ip_Cfg.h and Emios_Pwm_Ip_BOARD_InitPeripherals_Pbcfg.h are different."
|
|
#endif
|
|
|
|
/* Check if header file and Pwm_EnvCfg header file are of the same software version */
|
|
#if ((EMIOS_PWM_IP_CFG_SW_MAJOR_VERSION != EMIOS_PWM_IP_BOARD_InitPeripherals_PB_CFG_SW_MAJOR_VERSION) || \
|
|
(EMIOS_PWM_IP_CFG_SW_MINOR_VERSION != EMIOS_PWM_IP_BOARD_InitPeripherals_PB_CFG_SW_MINOR_VERSION) || \
|
|
(EMIOS_PWM_IP_CFG_SW_PATCH_VERSION != EMIOS_PWM_IP_BOARD_InitPeripherals_PB_CFG_SW_PATCH_VERSION))
|
|
#error "Software version numbers of Emios_Pwm_Ip_Cfg.h and Emios_Pwm_Ip_BOARD_InitPeripherals_Pbcfg.h are different."
|
|
#endif
|
|
|
|
/*==================================================================================================
|
|
* CONSTANTS
|
|
==================================================================================================*/
|
|
|
|
/*==================================================================================================
|
|
* DEFINES AND MACROS
|
|
==================================================================================================*/
|
|
/** @brief Switch to enable the development error detection. */
|
|
#define EMIOS_PWM_IP_DEV_ERROR_DETECT (STD_OFF)
|
|
|
|
/** @brief The number of Emios instances available on platform */
|
|
#define EMIOS_PWM_INSTANCE_COUNT (eMIOS_INSTANCE_COUNT)
|
|
/** @brief The number of channels available on each Emios instance */
|
|
#define EMIOS_PWM_CHANNEL_COUNT (eMIOS_CH_UC_UC_COUNT)
|
|
|
|
/** @brief The number of PWM modes implemented in hardware */
|
|
#define EMIOS_PWM_MODES (4U)
|
|
/** @brief Mapping between available channels and the PWM mode supported by each of them */
|
|
#define EMIOS_PWM_CHANNEL_MODES {\
|
|
{0x00C101FFUL, 0x000000FEUL, 0x00FFFFFFUL, 0x00FFFFFFUL},\
|
|
{0x00C10101UL, 0x00000000UL, 0x00FFFFFFUL, 0x00FFFFFFUL},\
|
|
{0x00C10101UL, 0x00000000UL, 0x00FFFFFFUL, 0x00FFFFFFUL},\
|
|
}
|
|
/** @brief Mapping for channels with internal counters on each Emios instance */
|
|
#define EMIOS_PWM_INTERNAL_COUNTER_CH {0x00C101FFUL, 0x00C10101UL, 0x00C10101UL}
|
|
|
|
/** @brief Min counter value for PWM modes */
|
|
#define EMIOS_PWM_MIN_CNT_VAL (0x0001UL)
|
|
/** @brief Max counter value for PWM modes */
|
|
#define EMIOS_PWM_MAX_CNT_VAL (0xFFFFUL)
|
|
|
|
/** @brief Mapping for channels with internal counters on each Emios instance */
|
|
#define EMIOS_PWM_NOTIFICATION_HANDLERS {\
|
|
{NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR },\
|
|
{NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR },\
|
|
{NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR, NULL_PTR },\
|
|
}
|
|
|
|
/** Default Initial value */
|
|
#define EMIOS_PWM_INIT_VALUE_UINT16 {\
|
|
{(uint16)0U},\
|
|
{(uint16)0U},\
|
|
{(uint16)0U}\
|
|
}
|
|
|
|
#define EMIOS_PWM_INIT_VALUE_UINT8 {\
|
|
{(uint8)0U},\
|
|
{(uint8)0U},\
|
|
{(uint8)0U}\
|
|
}
|
|
|
|
/** @brief Counter bus channel number */
|
|
#define EMIOS_PWM_COUNTER_BUS_A (23U)
|
|
#define EMIOS_PWM_COUNTER_BUS_BCDE (248U)
|
|
#define EMIOS_PWM_COUNTER_BUS_F (22U)
|
|
|
|
/*==================================================================================================
|
|
* ENUMS
|
|
==================================================================================================*/
|
|
|
|
/*==================================================================================================
|
|
* STRUCTURES AND OTHER TYPEDEFS
|
|
==================================================================================================*/
|
|
/* Redefine eMIOS_Type from header file to comply with coding guidelines */
|
|
typedef eMIOS_Type Emios_Pwm_Ip_HwAddrType;
|
|
|
|
/*==================================================================================================
|
|
* GLOBAL VARIABLE DECLARATIONS
|
|
==================================================================================================*/
|
|
|
|
/*==================================================================================================
|
|
* FUNCTION PROTOTYPES
|
|
==================================================================================================*/
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
/** @} */
|
|
|
|
#endif /* EMIOS_PWM_IP_CFG_H */
|
|
|