12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157 |
- /*==================================================================================================
- * Project : RTD AUTOSAR 4.4
- * Platform : CORTEXM
- * Peripheral : FLEXCAN
- * Dependencies :
- *
- * Autosar Version : 4.4.0
- * Autosar Revision : ASR_REL_4_4_REV_0000
- * Autosar Conf.Variant :
- * SW Version : 1.0.0
- * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
- *
- * (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.
- ==================================================================================================*/
- /*==================================================================================================
- ==================================================================================================*/
- /**
- * @file Can_PBcfg_VS_0.c
- * @version 1.0.0
- *
- * @brief AUTOSAR Can - module interface
- * @details Configuration Structures for PostBuild
- *
- * @addtogroup CAN_DRIVER
- * @{
- */
- #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.
- *
- * @section Can_PBcfg_VS_0_c_REF_1
- * Violates MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents
- * of a header file being included more than once
- * This violation is not fixed since the inclusion of <MA>_MemMap.h is as per AUTOSAR requirement [SWS_MemMap_00003].
- *
- * @section Can_PBcfg_VS_0_c_REF_2
- * Violates MISRA 2012 Advisory Rule 20.1, #include directives should only be preceded by preprocessor directives or comments.
- * AUTOSAR imposes the specification of the sections in which certain parts of the driver must be placed.
- *
- * @section Can_PBcfg_VS_0_c_REF_3
- * Violates MISRA 2012 Advisory Rule 8.7, Function and objects should not be defined with external linkage if they
- * are referenced in only one translation unit.
- * This constant variable will be called by higher layer.
- *
- * @section Can_PBcfg_VS_0_c_REF_4
- * Violates MISRA 2012 Advisory Rule 8.9, An object should be defined at block scope if identifier only appears in a single function.
- * These objects are used when Precompile is supported.
- *
- * @section Can_PBcfg_VS_0_c_REF_5
- * Violates MISRA 2012 Required Rule 8.4, A compatible declaration shall be visible when an object or function with external linkage is defined.
- *
- */
- /*
- (CAN078) The code file structure shall not be defined within this specification completely.
- At this point it shall be pointed out that the code-file structure shall include the following file named: Can_PBcfg_VS_0.c.
- This file shall contain all post-build time configurable parameters.
- (CAN221) VariantPB: (Mix of precompile and Post Build multiple selectable configurable configurations.
- */
- /*==================================================================================================
- * INCLUDE FILES
- * 1) system and project includes
- * 2) needed interfaces from external units
- * 3) internal and external interfaces from this unit
- ==================================================================================================*/
- #include "Can.h"
- #include "Can_Ipw_Types.h"
- #include "USER_CONFIG.h"
- /*==================================================================================================
- * SOURCE FILE VERSION INFORMATION
- ==================================================================================================*/
- /*
- * @file Can_PBcfg_VS_0.c
- */
- #define CAN_VENDOR_ID_PBCFG_VS_0_C 43
- #define CAN_AR_RELEASE_MAJOR_VERSION_PBCFG_VS_0_C 4
- #define CAN_AR_RELEASE_MINOR_VERSION_PBCFG_VS_0_C 4
- #define CAN_AR_RELEASE_REVISION_VERSION_PBCFG_VS_0_C 0
- #define CAN_SW_MAJOR_VERSION_PBCFG_VS_0_C 1
- #define CAN_SW_MINOR_VERSION_PBCFG_VS_0_C 0
- #define CAN_SW_PATCH_VERSION_PBCFG_VS_0_C 0
- /*==================================================================================================
- * FILE VERSION CHECKS
- ==================================================================================================*/
- /* Check if current file and Can.h are of the same vendor */
- #if (CAN_VENDOR_ID_PBCFG_VS_0_C != CAN_VENDOR_ID)
- #error "Can_PBcfg_VS_0.c and Can.h have different vendor ids"
- #endif
- /* Check if current file and Can.h are of the same Autosar version */
- #if ((CAN_AR_RELEASE_MAJOR_VERSION_PBCFG_VS_0_C != CAN_AR_RELEASE_MAJOR_VERSION) || \
- (CAN_AR_RELEASE_MINOR_VERSION_PBCFG_VS_0_C != CAN_AR_RELEASE_MINOR_VERSION) || \
- (CAN_AR_RELEASE_REVISION_VERSION_PBCFG_VS_0_C != CAN_AR_RELEASE_REVISION_VERSION))
- #error "AutoSar Version Numbers of Can_PBcfg_VS_0.c and Can.h are different"
- #endif
- /* Check if current file and Can.h are of the same Software version */
- #if ((CAN_SW_MAJOR_VERSION_PBCFG_VS_0_C != CAN_SW_MAJOR_VERSION) || \
- (CAN_SW_MINOR_VERSION_PBCFG_VS_0_C != CAN_SW_MINOR_VERSION) || \
- (CAN_SW_PATCH_VERSION_PBCFG_VS_0_C != CAN_SW_PATCH_VERSION))
- #error "Software Version Numbers of Can_PBcfg_VS_0.c and Can.h are different"
- #endif
- /* Check if current file and Can_Ipw_Types.h are of the same vendor */
- #if (CAN_VENDOR_ID_PBCFG_VS_0_C != CAN_IPW_TYPES_VENDOR_ID_H)
- #error "Can_PBcfg_VS_0.c and Can_Ipw_Types.h have different vendor ids"
- #endif
- /* Check if current file and Can_Ipw_Types.h are of the same Autosar version */
- #if ((CAN_AR_RELEASE_MAJOR_VERSION_PBCFG_VS_0_C != CAN_IPW_TYPES_AR_RELEASE_MAJOR_VERSION_H) || \
- (CAN_AR_RELEASE_MINOR_VERSION_PBCFG_VS_0_C != CAN_IPW_TYPES_AR_RELEASE_MINOR_VERSION_H) || \
- (CAN_AR_RELEASE_REVISION_VERSION_PBCFG_VS_0_C != CAN_IPW_TYPES_AR_RELEASE_REVISION_VERSION_H))
- #error "AutoSar Version Numbers of Can_PBcfg_VS_0.c and Can_Ipw_Types.h are different"
- #endif
- /* Check if current file and Can_Ipw_Types.h are of the same Software version */
- #if ((CAN_SW_MAJOR_VERSION_PBCFG_VS_0_C != CAN_IPW_TYPES_SW_MAJOR_VERSION_H) || \
- (CAN_SW_MINOR_VERSION_PBCFG_VS_0_C != CAN_IPW_TYPES_SW_MINOR_VERSION_H) || \
- (CAN_SW_PATCH_VERSION_PBCFG_VS_0_C != CAN_IPW_TYPES_SW_PATCH_VERSION_H))
- #error "Software Version Numbers of Can_PBcfg_VS_0.c and Can_Ipw_Types.h are different"
- #endif
- /*==================================================================================================
- * GLOBAL VARIABLES
- ==================================================================================================*/
- #if (CAN_FEATURE_HAS_DMA_ENABLE == STD_ON)
- /* CAN_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE */
- #define CAN_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
- #include "Can_MemMap.h"
- #define CAN_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
- #include "Can_MemMap.h"
- /* CAN_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE */
- #endif /* (CAN_FEATURE_HAS_DMA_ENABLE == STD_ON) */
- /*==================================================================================================
- * GLOBAL FUNCTION PROTOTYPES
- ==================================================================================================*/
- #define CAN_START_SEC_CODE
- /* @violates @ref Can_PBcfg_VS_0_c_REF_1 MISRA 2012 Required Directive 4.10 */
- #include "Can_MemMap.h"
- #if (CAN_TIMESTAMP_ENABLE == STD_ON)
- #endif
- #define CAN_STOP_SEC_CODE
- /* @violates @ref Can_PBcfg_VS_0_c_REF_1 MISRA 2012 Required Directive 4.10 */
- /* @violates @ref Can_PBcfg_VS_0_c_REF_2 MISRA 2012 Advisory Rule 20.1 */
- #include "Can_MemMap.h"
- /*==================================================================================================
- * LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
- ==================================================================================================*/
- /*==================================================================================================
- * LOCAL CONSTANTS
- ==================================================================================================*/
- #define CAN_START_SEC_CONFIG_DATA_32
- #include "Can_MemMap.h"
- /**
- * @brief Hardware Buffer Address of CanController_0
- */
- static const uint32 Can_au32HwBufferAddr_Ctrl0[11U]=
- {
- (FLEXCAN_0_BASE + (uint32)0x0080U),
- (FLEXCAN_0_BASE + (uint32)0x0100U),
- (FLEXCAN_0_BASE + (uint32)0x0110U),
- (FLEXCAN_0_BASE + (uint32)0x0120U),
- (FLEXCAN_0_BASE + (uint32)0x0130U),
- (FLEXCAN_0_BASE + (uint32)0x0140U),
- (FLEXCAN_0_BASE + (uint32)0x0150U),
- (FLEXCAN_0_BASE + (uint32)0x0160U),
- (FLEXCAN_0_BASE + (uint32)0x0170U),
- (FLEXCAN_0_BASE + (uint32)0x0180U),
- (FLEXCAN_0_BASE + (uint32)0x0190U)
- };
- /**
- * @brief Hardware Buffer Address of CanController_1
- */
- static const uint32 Can_au32HwBufferAddr_Ctrl1[11U]=
- {
- (FLEXCAN_1_BASE + (uint32)0x0080U),
- (FLEXCAN_1_BASE + (uint32)0x0100U),
- (FLEXCAN_1_BASE + (uint32)0x0110U),
- (FLEXCAN_1_BASE + (uint32)0x0120U),
- (FLEXCAN_1_BASE + (uint32)0x0130U),
- (FLEXCAN_1_BASE + (uint32)0x0140U),
- (FLEXCAN_1_BASE + (uint32)0x0150U),
- (FLEXCAN_1_BASE + (uint32)0x0160U),
- (FLEXCAN_1_BASE + (uint32)0x0170U),
- (FLEXCAN_1_BASE + (uint32)0x0180U),
- (FLEXCAN_1_BASE + (uint32)0x0190U)
- };
- /**
- * @brief Hardware Buffer Address of CanController_2
- */
- static const uint32 Can_au32HwBufferAddr_Ctrl2[8U]=
- {
- (FLEXCAN_2_BASE + (uint32)0x0080U),
- (FLEXCAN_2_BASE + (uint32)0x0100U),
- (FLEXCAN_2_BASE + (uint32)0x0110U),
- (FLEXCAN_2_BASE + (uint32)0x0120U),
- (FLEXCAN_2_BASE + (uint32)0x0130U),
- (FLEXCAN_2_BASE + (uint32)0x0140U),
- (FLEXCAN_2_BASE + (uint32)0x0150U),
- (FLEXCAN_2_BASE + (uint32)0x0160U)
- };
- /**
- * @brief Hardware Filter of Can0HardwareObject_RX
- */
- static const Can_HwFilterType Can_aHwFilter_Object0[8U]=
- {
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- }
- };
- /**
- * @brief Hardware Filter of Can1HardwareObject_RX
- */
- static const Can_HwFilterType Can_aHwFilter_Object1[8U]=
- {
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- }
- };
- /**
- * @brief Hardware Filter of Can2HardwareObject_RX
- */
- static const Can_HwFilterType Can_aHwFilter_Object2[8U]=
- {
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- },
- {
- (uint32)0x00000000U,
- (uint32)0x00000000U
- }
- };
- #define CAN_STOP_SEC_CONFIG_DATA_32
- #include "Can_MemMap.h"
- #define CAN_START_SEC_CONFIG_DATA_8
- #include "Can_MemMap.h"
- /**
- * @brief Mapping Controller ID to Controller hardware offset
- */
- static const uint8 Can_aCtrlOffsetToCtrlIDMap[CAN_HWCONTROLLER_SUPPORT]=
- {
- (uint8)0,
- (uint8)1,
- (uint8)2
- };
- /**
- * @brief Mapping Controller ID to Hardware Object ID
- */
- static const uint8 Can_aHwObjIDToCtrlIDMap[CAN_HWOBJECT_CONFIG_COUNT]=
- {
- (uint8)0U,
- (uint8)1U,
- (uint8)2U,
- (uint8)0U,
- (uint8)1U,
- (uint8)2U
- };
- #define CAN_STOP_SEC_CONFIG_DATA_8
- #include "Can_MemMap.h"
- #define CAN_START_SEC_CONFIG_DATA_UNSPECIFIED
- /* @violates @ref Can_PBcfg_VS_0_c_REF_1 MISRA 2012 Required Directive 4.10 */
- /* @violates @ref Can_PBcfg_VS_0_c_REF_2 MISRA 2012 Advisory Rule 20.1 */
- #include "Can_MemMap.h"
- /**
- * @brief Can Hardware Object Config
- */
- /* @violates @ref Can_PBcfg_VS_0_c_REF_5 MISRA 2012 Required Rule 8.4*/
- static const Can_HwObjectConfigType Can_aHwObjectConfig[CAN_HWOBJECT_CONFIG_COUNT]=
- {
- /* Can0HardwareObject_RX of CanController_0*/
- {
- /* Hardware Object ID */
- (Can_HwHandleType)0U,
- /* Hardware Object handle type */
- CAN_RECEIVE,
- #if (defined CAN0_MSG_TYPE)
- #if (CAN0_MSG_TYPE == CAN_MSG_EXTENDED)
- /* ID Message type */
- CAN_EXTENDED,
- #elif (CAN0_MSG_TYPE == CAN_MSG_STANDARD)
- /* ID Message type */
- CAN_STANDARD,
- #else
- #error "please select the right CAN Msg Type of CAN0
- #endif
- #else
- #error "please define the CAN0_MSG_TYPE"
- #endif
- /* Object uses polling */
- (boolean)TRUE,
- /* Object enable trigger transmit */
- (boolean)FALSE,
- /* Number of Hw Object used in one Hoh */
- (uint8)6U,
- /* MainFunction RW period reference */
- (uint8)CanMainFunctionRWPeriods_0,
- /* Data Payload length */
- (uint8)8U,
- /* Padding value */
- (uint8)0U,
- /* Hardware Filter Count */
- (uint8)8U,
- /* Hw Filter Config */
- Can_aHwFilter_Object0,
- /* Message Buffer is Legacy FIFO */
- CAN_RX_LEGACY_FIFO,
- /* Buffer Index in Message buffer ram */
- (uint8)0U,
- /* Message buffer address */
- &Can_au32HwBufferAddr_Ctrl0[0U]
- #if (CAN_TIMESTAMP_ENABLE == STD_ON)
- /* Time Stamp Enable */
- ,(boolean)FALSE
- #endif
- },
- /* Can1HardwareObject_RX of CanController_1*/
- {
- /* Hardware Object ID */
- (Can_HwHandleType)1U,
- /* Hardware Object handle type */
- CAN_RECEIVE,
- #if (defined CAN1_MSG_TYPE)
- #if (CAN1_MSG_TYPE == CAN_MSG_EXTENDED)
- /* ID Message type */
- CAN_EXTENDED,
- #elif (CAN1_MSG_TYPE == CAN_MSG_STANDARD)
- /* ID Message type */
- CAN_STANDARD,
- #else
- #error "please select the right CAN Msg Type of CAN1
- #endif
- #else
- #error "please define the CAN1_MSG_TYPE"
- #endif
- /* Object uses polling */
- (boolean)TRUE,
- /* Object enable trigger transmit */
- (boolean)FALSE,
- /* Number of Hw Object used in one Hoh */
- (uint8)6U,
- /* MainFunction RW period reference */
- (uint8)CanMainFunctionRWPeriods_0,
- /* Data Payload length */
- (uint8)8U,
- /* Padding value */
- (uint8)0U,
- /* Hardware Filter Count */
- (uint8)8U,
- /* Hw Filter Config */
- Can_aHwFilter_Object1,
- /* Message Buffer is Legacy FIFO */
- CAN_RX_LEGACY_FIFO,
- /* Buffer Index in Message buffer ram */
- (uint8)0U,
- /* Message buffer address */
- &Can_au32HwBufferAddr_Ctrl1[0U]
- #if (CAN_TIMESTAMP_ENABLE == STD_ON)
- /* Time Stamp Enable */
- ,(boolean)FALSE
- #endif
- },
- /* Can2HardwareObject_RX of CanController_2*/
- {
- /* Hardware Object ID */
- (Can_HwHandleType)2U,
- /* Hardware Object handle type */
- CAN_RECEIVE,
- #if (defined CAN2_MSG_TYPE)
- #if (CAN2_MSG_TYPE == CAN_MSG_EXTENDED)
- /* ID Message type */
- CAN_EXTENDED,
- #elif (CAN2_MSG_TYPE == CAN_MSG_STANDARD)
- /* ID Message type */
- CAN_STANDARD,
- #else
- #error "please select the right CAN Msg Type of CAN2
- #endif
- #else
- #error "please define the CAN2_MSG_TYPE"
- #endif
- /* Object uses polling */
- (boolean)TRUE,
- /* Object enable trigger transmit */
- (boolean)FALSE,
- /* Number of Hw Object used in one Hoh */
- (uint8)6U,
- /* MainFunction RW period reference */
- (uint8)CanMainFunctionRWPeriods_0,
- /* Data Payload length */
- (uint8)8U,
- /* Padding value */
- (uint8)0U,
- /* Hardware Filter Count */
- (uint8)8U,
- /* Hw Filter Config */
- Can_aHwFilter_Object2,
- /* Message Buffer is Legacy FIFO */
- CAN_RX_LEGACY_FIFO,
- /* Buffer Index in Message buffer ram */
- (uint8)0U,
- /* Message buffer address */
- &Can_au32HwBufferAddr_Ctrl2[0U]
- #if (CAN_TIMESTAMP_ENABLE == STD_ON)
- /* Time Stamp Enable */
- ,(boolean)FALSE
- #endif
- },
- /* Can0HardwareObject_TX of CanController_0*/
- {
- /* Hardware Object ID */
- (Can_HwHandleType)3U,
- /* Hardware Object handle type */
- CAN_TRANSMIT,
- #if (defined CAN0_MSG_TYPE)
- #if (CAN0_MSG_TYPE == CAN_MSG_EXTENDED)
- /* ID Message type */
- CAN_EXTENDED,
- #elif (CAN0_MSG_TYPE == CAN_MSG_STANDARD)
- /* ID Message type */
- CAN_STANDARD,
- #else
- #error "please select the right CAN Msg Type of CAN0
- #endif
- #else
- #error "please define the CAN0_MSG_TYPE"
- #endif
- /* Object uses polling */
- (boolean)TRUE,
- /* Object enable trigger transmit */
- (boolean)FALSE,
- /* Number of Hw Object used in one Hoh */
- (uint8)10U,
- /* MainFunction RW period reference */
- (uint8)CanMainFunctionRWPeriods_0,
- /* Data Payload length */
- (uint8)8U,
- /* Padding value */
- (uint8)0U,
- /* Hardware Filter Count */
- (uint8)0U,
- /* Hw Filter Config */
- NULL_PTR,
- /* Message Buffer is Tx normal */
- CAN_TX_NORMAL,
- /* Buffer Index in Message buffer ram */
- (uint8)8U,
- /* Message buffer address */
- &Can_au32HwBufferAddr_Ctrl0[1U]
- #if (CAN_TIMESTAMP_ENABLE == STD_ON)
- /* Time Stamp Enable */
- ,(boolean)FALSE
- #endif
- },
- /* Can1HardwareObject_TX of CanController_1*/
- {
- /* Hardware Object ID */
- (Can_HwHandleType)4U,
- /* Hardware Object handle type */
- CAN_TRANSMIT,
- #if (defined CAN1_MSG_TYPE)
- #if (CAN1_MSG_TYPE == CAN_MSG_EXTENDED)
- /* ID Message type */
- CAN_EXTENDED,
- #elif (CAN1_MSG_TYPE == CAN_MSG_STANDARD)
- /* ID Message type */
- CAN_STANDARD,
- #else
- #error "please select the right CAN Msg Type of CAN1
- #endif
- #else
- #error "please define the CAN1_MSG_TYPE"
- #endif
- /* Object uses polling */
- (boolean)TRUE,
- /* Object enable trigger transmit */
- (boolean)FALSE,
- /* Number of Hw Object used in one Hoh */
- (uint8)10U,
- /* MainFunction RW period reference */
- (uint8)CanMainFunctionRWPeriods_0,
- /* Data Payload length */
- (uint8)8U,
- /* Padding value */
- (uint8)0U,
- /* Hardware Filter Count */
- (uint8)0U,
- /* Hw Filter Config */
- NULL_PTR,
- /* Message Buffer is Tx normal */
- CAN_TX_NORMAL,
- /* Buffer Index in Message buffer ram */
- (uint8)8U,
- /* Message buffer address */
- &Can_au32HwBufferAddr_Ctrl1[1U]
- #if (CAN_TIMESTAMP_ENABLE == STD_ON)
- /* Time Stamp Enable */
- ,(boolean)FALSE
- #endif
- },
- /* Can2HardwareObject_TX of CanController_2*/
- {
- /* Hardware Object ID */
- (Can_HwHandleType)5U,
- /* Hardware Object handle type */
- CAN_TRANSMIT,
- #if (defined CAN2_MSG_TYPE)
- #if (CAN2_MSG_TYPE == CAN_MSG_EXTENDED)
- /* ID Message type */
- CAN_EXTENDED,
- #elif (CAN2_MSG_TYPE == CAN_MSG_STANDARD)
- /* ID Message type */
- CAN_STANDARD,
- #else
- #error "please select the right CAN Msg Type of CAN2
- #endif
- #else
- #error "please define the CAN2_MSG_TYPE"
- #endif
- /* Object uses polling */
- (boolean)TRUE,
- /* Object enable trigger transmit */
- (boolean)FALSE,
- /* Number of Hw Object used in one Hoh */
- (uint8)7U,
- /* MainFunction RW period reference */
- (uint8)CanMainFunctionRWPeriods_0,
- /* Data Payload length */
- (uint8)8U,
- /* Padding value */
- (uint8)0U,
- /* Hardware Filter Count */
- (uint8)0U,
- /* Hw Filter Config */
- NULL_PTR,
- /* Message Buffer is Tx normal */
- CAN_TX_NORMAL,
- /* Buffer Index in Message buffer ram */
- (uint8)8U,
- /* Message buffer address */
- &Can_au32HwBufferAddr_Ctrl2[1U]
- #if (CAN_TIMESTAMP_ENABLE == STD_ON)
- /* Time Stamp Enable */
- ,(boolean)FALSE
- #endif
- }
- };
- /**
- * @brief Can Baudrate Config of CanController_0
- */
- static const Can_BaudrateConfigType Can_aBaudrateConfig_Ctrl0[1U]=
- {
- {
- /*Can_bEnhanceCBTEnable*/
- (boolean)FALSE,
- /* Tx Bit Rate Switch */
- (boolean)FALSE,
- /* FD enable */
- (boolean)FALSE,
- /* Nominal bit rate */
- #if (defined CAN0_BAUDRATE)
- #if (CAN0_BAUDRATE == CAN_BAUDRATE_500K)
- {
- (uint8)4U,
- (uint8)4U,
- (uint8)4U,
- (uint16)5U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- /* Alternative Baudrate Nominal Prescaler */
- (uint16)9U,
- #endif
- (uint8)3U
- },
-
- /* Data bit rate */
- {
- (uint8)0U,
- (uint8)0U,
- (uint8)0U,
- (uint16)0U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- (uint16)0U,
- #endif
- (uint8)0U
- },
-
- /* Tx Arbitration Start delay */
- (uint8)12U,
- (boolean)FALSE,
- (uint8)0U
-
- #elif (CAN0_BAUDRATE == CAN_BAUDRATE_250K)
- {
- (uint8)2U,
- (uint8)5U,
- (uint8)5U,
- (uint16)11U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- /* Alternative Baudrate Nominal Prescaler */
- (uint16)9U,
- #endif
- (uint8)3U
- },
-
- /* Data bit rate */
- {
- (uint8)0U,
- (uint8)0U,
- (uint8)0U,
- (uint16)0U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- (uint16)0U,
- #endif
- (uint8)0U
- },
-
- /* Tx Arbitration Start delay */
- (uint8)20U,
- (boolean)FALSE,
- (uint8)0U
- #else
- #error "please define the baudrate of can0 (BAUDRATE_500K or BAUDRATE_250K)"
- #endif
- #else
- #error "please define the CAN0_BAUDRATE"
- #endif
- }
- };
- /**
- * @brief HwObject's pointer structure of CanController_0
- */
- static const Can_HwObjectConfigType * const Can_apHwObject_Ctrl0[2U]=
- {
- &Can_aHwObjectConfig[0U],
- &Can_aHwObjectConfig[3U]
- };
- /**
- * @brief Can Baudrate Config of CanController_1
- */
- static const Can_BaudrateConfigType Can_aBaudrateConfig_Ctrl1[1U]=
- {
- {
- /*Can_bEnhanceCBTEnable*/
- (boolean)FALSE,
- /* Tx Bit Rate Switch */
- (boolean)FALSE,
- /* FD enable */
- (boolean)FALSE,
- /* Nominal bit rate */
-
- #if (defined CAN1_BAUDRATE)
- #if (CAN1_BAUDRATE == CAN_BAUDRATE_500K)
- {
- (uint8)4U,
- (uint8)4U,
- (uint8)4U,
- (uint16)5U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- /* Alternative Baudrate Nominal Prescaler */
- (uint16)9U,
- #endif
- (uint8)3U
- },
-
- /* Data bit rate */
- {
- (uint8)0U,
- (uint8)0U,
- (uint8)0U,
- (uint16)0U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- (uint16)0U,
- #endif
- (uint8)0U
- },
-
- /* Tx Arbitration Start delay */
- (uint8)12U,
- (boolean)FALSE,
- (uint8)0U
-
- #elif (CAN1_BAUDRATE == CAN_BAUDRATE_250K)
- {
- (uint8)2U,
- (uint8)5U,
- (uint8)5U,
- (uint16)11U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- /* Alternative Baudrate Nominal Prescaler */
- (uint16)9U,
- #endif
- (uint8)3U
- },
-
- /* Data bit rate */
- {
- (uint8)0U,
- (uint8)0U,
- (uint8)0U,
- (uint16)0U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- (uint16)0U,
- #endif
- (uint8)0U
- },
-
- /* Tx Arbitration Start delay */
- (uint8)20U,
- (boolean)FALSE,
- (uint8)0U
- #else
- #error "please define the baudrate of can1 (BAUDRATE_500K or BAUDRATE_250K)"
- #endif
- #else
- #error "please define the CAN1_BAUDRATE"
- #endif
- }
- };
- /**
- * @brief HwObject's pointer structure of CanController_1
- */
- static const Can_HwObjectConfigType * const Can_apHwObject_Ctrl1[2U]=
- {
- &Can_aHwObjectConfig[1U],
- &Can_aHwObjectConfig[4U]
- };
- /**
- * @brief Can Baudrate Config of CanController_2
- */
- static const Can_BaudrateConfigType Can_aBaudrateConfig_Ctrl2[1U]=
- {
- {
- /*Can_bEnhanceCBTEnable*/
- (boolean)FALSE,
- /* Tx Bit Rate Switch */
- (boolean)FALSE,
- /* FD enable */
- (boolean)FALSE,
- /* Nominal bit rate */
- #if (defined CAN2_BAUDRATE)
- #if (CAN2_BAUDRATE == CAN_BAUDRATE_500K)
- {
- (uint8)4U,
- (uint8)4U,
- (uint8)4U,
- (uint16)5U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- /* Alternative Baudrate Nominal Prescaler */
- (uint16)9U,
- #endif
- (uint8)3U
- },
-
- /* Data bit rate */
- {
- (uint8)0U,
- (uint8)0U,
- (uint8)0U,
- (uint16)0U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- (uint16)0U,
- #endif
- (uint8)0U
- },
-
- /* Tx Arbitration Start delay */
- (uint8)12U,
- (boolean)FALSE,
- (uint8)0U
-
- #elif (CAN2_BAUDRATE == CAN_BAUDRATE_250K)
- {
- (uint8)2U,
- (uint8)5U,
- (uint8)5U,
- (uint16)11U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- /* Alternative Baudrate Nominal Prescaler */
- (uint16)9U,
- #endif
- (uint8)3U
- },
-
- /* Data bit rate */
- {
- (uint8)0U,
- (uint8)0U,
- (uint8)0U,
- (uint16)0U,
- #if (CAN_DUAL_CLOCK_MODE == STD_ON)
- (uint16)0U,
- #endif
- (uint8)0U
- },
-
- /* Tx Arbitration Start delay */
- (uint8)20U,
- (boolean)FALSE,
- (uint8)0U
- #else
- #error "please define the baudrate of can2 (BAUDRATE_500K or BAUDRATE_250K)"
- #endif
- #else
- #error "please define the CAN2_BAUDRATE"
- #endif
- }
- };
- /**
- * @brief HwObject's pointer structure of CanController_2
- */
- static const Can_HwObjectConfigType * const Can_apHwObject_Ctrl2[2U]=
- {
- &Can_aHwObjectConfig[2U],
- &Can_aHwObjectConfig[5U]
- };
- /* Inport external structure defined by IPW */
- CAN_IPW_EXT
- /**
- * @brief Can Controller Config
- */
- static const Can_ControllerConfigType Can_aControllerConfig[CAN_CONTROLLER_CONFIG_COUNT]=
- {
- {
- /* Abstracted CanIf Controller ID */
- (uint8)0U,
- /* Controller ID */
- (uint8)0U,
- /* Controller Offset */
- (uint8)0U,
- /* Controller Base Address */
- FLEXCAN_0_BASE,
- /* Controller Activation */
- (boolean)TRUE,
- /* Bus Off uses polling */
- (boolean)TRUE,
- /* Global mask of Legacy FIFO */
- (uint32)0xc0000000U,
- /* ID Acceptance Mode */
- CAN_LEGACY_FIFO_FORMAT_A,
- /* Legacy FIFO Warning Notification */
- NULL_PTR,
- /* Legacy FIFO Overflow Notification */
- NULL_PTR,
- /* Enhanced FIFO Overflow Notification */
- NULL_PTR,
- #if (CAN_FEATURE_HAS_DMA_ENABLE == STD_ON)
- /* Enhance FIFO Dma Error Notification */
- NULL_PTR,
- /* DMA is not enabled */
- NULL_PTR,
- #endif /* (CAN_FEATURE_HAS_DMA_ENABLE == STD_ON) */
- /* Error interrupt enable */
- (boolean)FALSE,
- /* Error Notification */
- NULL_PTR,
- /* Error FD Notification */
- NULL_PTR,
- /* Default Baudrate ID */
- (uint16)0U,
- /* Baudrate config Count*/
- (uint16)1U,
- /* Baudrate config Pointer Structure */
- Can_aBaudrateConfig_Ctrl0,
- /* Pointer to IPW structure to IP config */
- &CanIpwHwChannelConfig_VS_00,
- /* Hw Object reference count */
- (uint8)2U,
- /* Pointer point to Group of Hw Object that refer to Controller */
- Can_apHwObject_Ctrl0
- },
- {
- /* Abstracted CanIf Controller ID */
- (uint8)1U,
- /* Controller ID */
- (uint8)1U,
- /* Controller Offset */
- (uint8)1U,
- /* Controller Base Address */
- FLEXCAN_1_BASE,
- /* Controller Activation */
- (boolean)TRUE,
- /* Bus Off uses polling */
- (boolean)TRUE,
- /* Global mask of Legacy FIFO */
- (uint32)0xc0000000U,
- /* ID Acceptance Mode */
- CAN_LEGACY_FIFO_FORMAT_A,
- /* Legacy FIFO Warning Notification */
- NULL_PTR,
- /* Legacy FIFO Overflow Notification */
- NULL_PTR,
- /* Enhanced FIFO Overflow Notification */
- NULL_PTR,
- #if (CAN_FEATURE_HAS_DMA_ENABLE == STD_ON)
- /* Enhance FIFO Dma Error Notification */
- NULL_PTR,
- /* DMA is not enabled */
- NULL_PTR,
- #endif /* (CAN_FEATURE_HAS_DMA_ENABLE == STD_ON) */
- /* Error interrupt enable */
- (boolean)FALSE,
- /* Error Notification */
- NULL_PTR,
- /* Error FD Notification */
- NULL_PTR,
- /* Default Baudrate ID */
- (uint16)0U,
- /* Baudrate config Count*/
- (uint16)1U,
- /* Baudrate config Pointer Structure */
- Can_aBaudrateConfig_Ctrl1,
- /* Pointer to IPW structure to IP config */
- &CanIpwHwChannelConfig_VS_01,
- /* Hw Object reference count */
- (uint8)2U,
- /* Pointer point to Group of Hw Object that refer to Controller */
- Can_apHwObject_Ctrl1
- },
- {
- /* Abstracted CanIf Controller ID */
- (uint8)2U,
- /* Controller ID */
- (uint8)2U,
- /* Controller Offset */
- (uint8)2U,
- /* Controller Base Address */
- FLEXCAN_2_BASE,
- /* Controller Activation */
- (boolean)TRUE,
- /* Bus Off uses polling */
- (boolean)TRUE,
- /* Global mask of Legacy FIFO */
- (uint32)0xc0000000U,
- /* ID Acceptance Mode */
- CAN_LEGACY_FIFO_FORMAT_A,
- /* Legacy FIFO Warning Notification */
- NULL_PTR,
- /* Legacy FIFO Overflow Notification */
- NULL_PTR,
- /* Enhanced FIFO Overflow Notification */
- NULL_PTR,
- #if (CAN_FEATURE_HAS_DMA_ENABLE == STD_ON)
- /* Enhance FIFO Dma Error Notification */
- NULL_PTR,
- /* DMA is not enabled */
- NULL_PTR,
- #endif /* (CAN_FEATURE_HAS_DMA_ENABLE == STD_ON) */
- /* Error interrupt enable */
- (boolean)FALSE,
- /* Error Notification */
- NULL_PTR,
- /* Error FD Notification */
- NULL_PTR,
- /* Default Baudrate ID */
- (uint16)0U,
- /* Baudrate config Count*/
- (uint16)1U,
- /* Baudrate config Pointer Structure */
- Can_aBaudrateConfig_Ctrl2,
- /* Pointer to IPW structure to IP config */
- &CanIpwHwChannelConfig_VS_02,
- /* Hw Object reference count */
- (uint8)2U,
- /* Pointer point to Group of Hw Object that refer to Controller */
- Can_apHwObject_Ctrl2
- }
- };
- /* Inport external structure defined by IPW */
- CAN_IPW_ICOM_RXMESSAGE_EXT
- static const Can_IcomConfigsType Can_aIcomConfig[1U] =
- {
- {
- /* .u8CanIcomConfigId */
- (uint8)1,
- /* .bCanIcomWakeOnBusOff */
- (boolean)FALSE,
- /* .u8NumberCanIcomRxMessage */
- (uint8)1U,
- /* .pCanIcomRxMessageConfigs */
- &CanIpwIcomRxMessageConfig_VS_0_0
- }
- };
- static const Can_ControllerConfigType * const Can_apController[CAN_CONTROLLER_CONFIG_COUNT]=
- {
- &Can_aControllerConfig[0U],
- &Can_aControllerConfig[1U],
- &Can_aControllerConfig[2U]
- };
- /*==================================================================================================
- * GLOBAL CONSTANTS
- ==================================================================================================*/
- /**
- * @brief Top level structure contain all Can driver Config
- */
- /* @violates @ref Can_PBcfg_VS_0_c_REF_3 MISRA 2012 Advisory Rule 8.7 */
- /* @violates @ref Can_PBcfg_VS_0_c_REF_4 MISRA 2012 Advisory Rule 8.9 */
- /* @violates @ref Can_PBcfg_VS_0_c_REF_5 MISRA 2012 Required Rule 8.4 */
- const Can_ConfigType Can_Config =
- {
- /* Configuration Core ID */
- (uint32)0U,
- /* The HTH first Index after HRH consecutive */
- (Can_HwHandleType)3U,
- /* Mapping Controller ID to Controller Hw Offset */
- Can_aCtrlOffsetToCtrlIDMap,
- /* Mapping Controller ID to Hardware Object ID */
- Can_aHwObjIDToCtrlIDMap,
- /* Pointer point to Can Hw Object Config */
- Can_aHwObjectConfig,
- /* The size of Can Icom Configs */
- (uint8)1U,
- /* Pointer point to Can Icom Configs */
- Can_aIcomConfig,
- /* Array of Pointer to Controller infomation have aligned by Controller ID */
- Can_apController
- };
- #define CAN_STOP_SEC_CONFIG_DATA_UNSPECIFIED
- /* @violates @ref Can_PBcfg_VS_0_c_REF_1 MISRA 2012 Required Directive 4.10 */
- /* @violates @ref Can_PBcfg_VS_0_c_REF_2 MISRA 2012 Advisory Rule 20.1 */
- #include "Can_MemMap.h"
- #ifdef __cplusplus
- }
- #endif
- /** @} */
|