2 * Configuration of module: Can (Can_Cfg.h)
\r
4 * Created by: ArcCore
\r
7 * Configured for (MCU): TMS570
\r
9 * Module vendor: ArcCore
\r
10 * Generator version: 2.0.2
\r
12 * Generated by Arctic Studio (http://arccore.com)
\r
16 #if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )
17 #error Can: Configuration file expected BSW module version to be 1.0.*
23 // Number of controller configs
\r
24 #define CAN_ARC_CTRL_CONFIG_CNT 2
\r
26 #define CAN_DEV_ERROR_DETECT STD_OFF
\r
27 #define CAN_VERSION_INFO_API STD_OFF
\r
28 #define CAN_MULTIPLEXED_TRANSMISSION STD_OFF // Not supported
\r
29 #define CAN_WAKEUP_SUPPORT STD_OFF // Not supported
\r
30 #define CAN_HW_TRANSMIT_CANCELLATION STD_OFF // Not supported
\r
39 CAN_CONTROLLER_CNT = 3
\r
40 } CanControllerIdType;
\r
43 CAN_ID_TYPE_EXTENDED,
\r
45 CAN_ID_TYPE_STANDARD
\r
49 CAN_OBJECT_TYPE_RECEIVE = 0x00000000,
\r
50 CAN_OBJECT_TYPE_TRANSMIT = 0x20000000
\r
51 } Can_ObjectTypeType;
\r
54 CAN_ARC_HANDLE_TYPE_BASIC,
\r
55 CAN_ARC_HANDLE_TYPE_FULL
\r
56 } Can_Arc_HohType; // the type (Full-CAN or Basic-CAN) of a hardware object
\r
61 } Can_Arc_HTHType; // the type of the Hardware Transmit Handle
\r
67 } Can_Arc_HRHType; // the type of the Hardware Receive Handle
\r
71 // Specifies the InstanceId of this module instance. If only one instance is
\r
72 // present it shall have the Id 0
\r
79 CAN_ARC_IDAM_2_32BIT,
\r
80 CAN_ARC_IDAM_4_16BIT,
\r
81 CAN_ARC_IDAM_8_8BIT,
\r
82 CAN_ARC_IDAM_FILTER_CLOSED,
\r
83 } Can_Arc_IDAMType; // IDAM = identifier acceptance bits
\r
85 typedef uint32 Can_FilterMaskType;
\r
88 CAN_ARC_PROCESS_TYPE_INTERRUPT = 0x00000400,
\r
89 CAN_ARC_PROCESS_TYPE_POLLING = 0x00000000
\r
90 } Can_Arc_ProcessType;
\r
94 void (*CancelTxConfirmation)( const Can_PduType * );
\r
95 void (*RxIndication)( uint8, Can_IdType, uint8, const uint8 * );
\r
96 void (*ControllerBusOff)(uint8);
\r
97 void (*TxConfirmation)(PduIdType);
\r
98 void (*ControllerWakeup)(uint8);
\r
99 void (*Arc_Error)(uint8, Can_Arc_ErrorType);
\r
100 } Can_CallbackType;
\r
102 typedef struct Can_HardwareObjectStruct {
\r
103 Can_Arc_HohType CanHandleType; /* Specifies the type (Full-CAN or Basic-CAN) of a hardware object. */
\r
104 Can_IdTypeType CanIdType; /* Specifies whether the IdValue is of type - standard identifier - extended identifier- mixed mode. ImplementationType: Can_IdType */
\r
105 uint32 CanIdValue; /* Specifies (together with the filter mask) the identifiers range that passes the hardware filter. */
\r
106 uint16 CanObjectId; /* Holds the handle ID of HRH or HTH. The value of this parameter is unique in a given CAN Driver, and it should start with 0 and continue without any gaps. */
\r
107 Can_ObjectTypeType CanObjectType; /* Specifies if the HardwareObject is used as Transmit or as Receive object. */
\r
108 //CanControllerIdType CanControllerRef; /* Reference to CAN Controller to which the HOH is associated to. */
\r
109 Can_FilterMaskType *CanFilterMaskRef; /* Reference to the filter mask that is used for hardware filtering together with the CAN_ID_VALUE. */
\r
110 uint32 Can_Arc_MbMask; /* A "1" in this mask tells the driver that that HW Message Box should be occupied by this Hoh. A "1" in bit 31(ppc) occupies Mb 0 in HW. */
\r
111 boolean Can_Arc_EOL;
\r
112 } Can_HardwareObjectType;
\r
115 Can_Arc_ProcessType CanBusOffProcessing; /* Enables / disables API Can_MainFunction_BusOff() for handling busoff events in polling mode. */
\r
116 boolean CanControllerActivation; /* Defines if a CAN controller is used in the configuration. */
\r
117 //uint32 CanControllerBaseAddress; /* Specifies the CAN controller base address. */
\r
118 CanControllerIdType CanControllerId; /* Provides the controller ID which is unique in a given CAN Driver. */
\r
119 Can_Arc_ProcessType CanRxProcessing; /* Enables / disables API Can_MainFunction_Read() for handling PDU reception events in polling mode. */
\r
120 Can_Arc_ProcessType CanTxProcessing; /* Enables / disables API Can_MainFunction_Write() for handling PDU transmission events in polling mode. */
\r
121 Can_Arc_ProcessType CanWakeupProcessing; /* Enables / disables API Can_MainFunction_Wakeup() for handling wakeup events in polling mode. */
\r
122 uint32 CanCpuClockRef; /* Reference to the CPU clock configuration, which is set in the MCU driver configuration. */
\r
123 uint32 CanWakeupSourceRef; /* Reference to the Wakeup Source for this controller as defined in the ECU State Manager. Implementation Type: reference to EcuM_WakeupSourceType */
\r
125 uint32 CanControllerBaudRate; /* Specifies the baudrate of the controller in kbps. */
\r
126 uint32 CanControllerPropSeg; /* Specifies propagation delay in time quantas. (uint8 ??) */
\r
127 uint32 CanControllerSeg1; /* Specifies phase segment 1 in time quantas. (uint8 ??) */
\r
128 uint32 CanControllerSeg2; /* Specifies phase segment 2 in time quantas. (uint8 ??) */
\r
129 uint32 CanControllerSyncJumpWidth; /* Specifies the synchronization jump width for the controller in time quantas. (uint8 ??) */
\r
130 uint32 CanControllerTimeQuanta; /* Specifies the time quanta for the controller. The calculation of the resulting prescaler value depending on module clocking and time quanta shall be done offline Hardware specific. */
\r
132 // List of Hoh id's that belong to this controller
\r
133 const Can_HardwareObjectType *Can_Arc_Hoh;
\r
135 boolean Can_Arc_Loopback;
\r
136 boolean Can_Arc_Fifo; // set this to use the fifo
\r
137 } Can_ControllerConfigType;
\r
140 const Can_ControllerConfigType *CanController; /* contains the configuration parameters of the CAN controller(s) */
\r
142 // Callbacks( Extension )
\r
143 const Can_CallbackType *CanCallbacks;
\r
144 } Can_ConfigSetType;
\r
146 /* The type of external data structure containing the overall initialization data for the CAN driver and SFR settings affecting all controllers. */
\r
148 const Can_ConfigSetType *CanConfigSet; /* the multiple configuration set container for CAN Driver */
\r
149 const Can_GeneralType *CanGeneral; /* contains the parameters related each CAN Driver Unit. */
\r
152 extern const Can_ConfigType CanConfigData;
\r
153 extern const Can_ControllerConfigType CanControllerConfigData[];
\r
154 extern const Can_ConfigSetType Can_ConfigSet;
\r
156 #endif /*CAN_CFG_H_*/
\r