-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCan_Cfg.h
More file actions
244 lines (173 loc) · 10.8 KB
/
Can_Cfg.h
File metadata and controls
244 lines (173 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
#ifndef CAN_CFG_H_
#define CAN_CFG_H_
#include "Can_Definitions.h"
/*********************Can General*******************************/
//Pre-compile time
#define CanDevErrorDetect STD_OFF // boolean
/*Switches the development error detection and notification on or off.
true: detection and notification is enabled.
false: detection and notification is disabled*/
#define CanIndex ((uint8)15u) //Range 0-255
/*Specifies the Instance Id of this module instance.
If only one instance is present it shall have the Id 0.*/
#define CanLPduReceiveCalloutFunction CANMessageGet
/*parameter defines existence and name of a callout function which called after a successful
reception of a received CAN Rx L-PDU.If this parameter is omitted no callout shall take place.
*/
#define CanMainFunctionBusoffPeriod //Range 0-inf
/*This parameter describes the period for cyclic call to Can_MainFunction_Busoff. Unit is seconds.*/
#define CanMainFunctionModePeriod //Range 0-inf
/*This parameter describes the period for cyclic call to Can_MainFunction_Mode. Unit is seconds*/
#define CanMainFunctionWakeupPeriod //Range 0-inf
/*This parameter describes the period for cyclic call to Can_MainFunction_Wakeup. Unit is seconds*/
#define CanMultiplexedTransmission STD_OFF // Boolean
/*Specifies if multiplexed transmission shall be supported.ON or OFF*/
#define CanPublicIcomSupport STD_ON //Boolean
/*Selects support of Pretended Network features in Can driver.
True: Enabled
False: Disabled*/
#define CanSetBaudrateApi STD_ON //Boolean
/*The support of the Can_SetBaudrate API is optional.
If parameter is true the Can_SetBaudrate API shall be supported. Otherwise it's not supported.*/
#define CanTimeoutDuration //Float
/*Specifies the maximum time for blocking function until a timeout is detected. Unit is seconds.*/
#define CanVersionInfoApi STD_OFF //Boolean
/*Switches the Can_GetVersionInfo() API ON or OFF.*/
#define CanOsCounterRef ((uint32)80000000)//type Reference to [ OsCounter ]
/*This parameter contains a reference to the OsCounter, which is used by the CAN driver.*/
#define CanSupportTTCANRef //Reference to [ CanIfPrivateCfg ]
/*The parameter refers to CanIfSupportTTCAN parameter in the CAN Interface Module configuration*/
/****************************************************/
/*********************CanController*******************************/
#define CanBusoffProcessing INTERRUPT //type enum INTERRUPT,POLLING
/*Enables / disables API Can_MainFunction_BusOff() for handling busoff events in polling mode.*/
#define CanControllerActivation STD_ON //Boolean
/*Defines if a CAN controller is used in the configuration.*/
#define CanControllerBaseAddress 0x40040000/*((uint32) 0x40040000u)*/ //CAN0: 0x40040xxx CAN1: 0x40041xxx //Range 0=>4294967295
/*Specifies the CAN controller base address.*/
#define CanControllerId ((uint8)30u) //Range 0=>255
/*This parameter provides the controller ID which is unique in a given CAN Driver.*/
#define CanRxProcessing INTERRUPT //type enum INTERRUPT,POLLING,MIXED
/*Enables / disables API Can_MainFunction_Read() for handling PDU reception*/
#define CanTxProcessing INTERRUPT //type enum INTERRUPT,POLLING.MIXED
/*Enables / disables API Can_MainFunction_Write() for handling PDU transmission events in polling mode*/
#define CanWakeupFunctionalityAPI True //Boolean
/* Adds / removes the service Can_CheckWakeup() from the code.
True: Can_CheckWakeup can be used.
False: Can_CheckWakeup cannot be used.*/
#define CanWakeupProcessing INTERRUPT //type enum INTERRUPT,POLLING
/*Enables / disables API Can_MainFunction_Wakeup() for handling wakeup events in polling mode.*/
#define CanControllerDefaultBaudrate 512//Reference to [ CanControllerBaudrateConfig ]
/*Reference to baudrate configuration container configured for the Can Controller.*/
#define McuClockReferencePoint ((uint32) 80000000)
#define CanCpuClockRef McuClockReferencePoint //Reference to [ McuClockReferencePoint ]
/*Reference to the CPU clock configuration, which is set in the MCU driver configuration*/
#define CanWakeupSourceRef //Symbolic name reference to [ EcuMWakeupSource ]
/*This parameter contains a reference
to the Wakeup Source for this controller as defined in the ECU State Manager.*/
/****************************************************/
/*********************CanControllerBaudrateConfig*******************************/
#define CanControllerBaudRate ((uint32)1300) //Range 0..2000
/*Specifies the baudrate of the controller in kbps.*/
#define CanControllerBaudRateConfigID ((uint16)1u) //Range 0 .. 65535
/*Uniquely identifies a specific baud rate configuration. This ID is used by SetBaudrate API.*/
#define CanControllerPropSeg ((uint8)2u) //Range 0 .. 255
/*Specifies propagation delay in time quantas.*/
#define CanControllerSeg1 ((uint8)3u) //Range 0 .. 255
/*Specifies phase segment 1 in time quantas.*/
#define CanControllerSeg2 ((uint8)1u) //Range 0 .. 255
/*Specifies phase segment 2 in time quantas.*/
#define CanControllerSyncJumpWidth ((uint8)1u) //Range 0 .. 255
/*Specifies the synchronization jump width for the controller in time quantas.*/
/****************************************************/
/*********************CanHardwareObject*******************************/
/* HRH=> Hardware recieve handel
HTH=> Hardware transmite handel
HOH=> Hardware object handle
*/
#define CanHandleType BASIC //enum BASIC,FULL
/*Specifies the type (Full-CAN or Basic-CAN) of a hardware object.*/
#define CanHardwareObjectUsesPolling False //Boolean
/*Enables polling of this hardware object.*/
#define CanHwObjectCount ((uint16)u) //Range 0 .. 65535
/*In case of a HRH this parameter defines the number of elements in the hardware FIFO or the number of
shadow buffers,
in case of a HTH it defines the number of hardware objects used for multiplexed transmission */
#define CanIdType STANDARD //enum EXTENDED(29bit),STANDARD(11bit)
/*Specifies whether the IdValue is of type
- standard identifier
- extended identifier
- mixed mode
ImplementationType: Can_IdType*/
#define CanObjectId ((uint16)25u) //Range 0 .. 65535
/*Holds the handle ID of HRH or HTH.*/
#define CanObjectType //enum RECEIVE,TRANSMIT
/*Specifies if the HardwareObject is used as Transmit or as Receive object*/
#define CanTriggerTransmitEnable //Boolean
/*This parameter defines if or if not Can supports the trigger-transmit API for this handle.*/
#define CanControllerRef //Reference to [ CanController ]
/*Reference to CAN Controller to which the HOH is associated to.*/
#define CanMainFunctionRWPeriodRef //Reference to [ CanMainFunctionRWPeriods ]
/*Reference to CanMainFunctionPeriod*/
/****************************************************/
/*********************CanHwFilter*******************************/
#define CanHwFilterCode ((uint32)5u) //Range 0=>4294967295
/*Specifies (together with the filter mask) the identifiers range that passes the hardware filter.*/
#if (CanIdType == EXTENDED)
#define CanHwFilterMask ((uint32)0u) //29 bit Range 0=>4294967295
#elif (CanIdType == STANDARD)
#define CanHwFilterMask ((uint16)0u) //11 bit
#endif
/*Describes a mask for hardware-based filtering of CAN identifiers. The CAN identifiers of
incoming messages are masked with the appropriate CanFilterMaskValue. Bits holding a 0 mean don't care,
i.e. do not compare the message's identifier in the respective bit position.
The mask shall be build by filling with leading 0.
In case of CanIdType EXTENDED or MIXED a 29 bit mask shall be build.
In case of CanIdType STANDARD a 11 bit mask shall be build*/
/****************************************************/
/*********************CanMainFunctionRWPeriods*******************************/
#define CanMainFunctionPeriod //Float 0.. inf
/*This parameter describes the period for cyclic call to Can_MainFunction_Read or Can_MainFunction_Write*/
/****************************************************/
/*********************CanIcomConfig*******************************/
#define CanIcomConfigId ((uint8)13u) //Range 1 .. 256
/*This parameter identifies the ID of the ICOM configuration.*/
#define CanIcomWakeOnBusOff False //Boolean
/*This parameter defines that the MCU shall wake if the bus off is detected or not.*/
/****************************************************/
/*********************CanIcomGeneral*******************************/
#define CanIcomLevel CAN_ICOM_LEVEL_ONE //enum CAN_ICOM_LEVEL_ONE,CAN_ICOM_LEVEL_TWO
/*Defines the level of Pretended Networking.*/
#define CanIcomVariant CAN_ICOM_VARIANT_NONE //enum CAN_ICOM_VARIANT_HW,CAN_ICOM_VARIANT_NONE,CAN_ICOM_VARIANT_SW
/*Defines the variant, which is supported by this CanController*/
/****************************************************/
/*********************CanIcomRxMessage*******************************/
#define CanIcomCounterValue ((uint16)u) //Range 1 .. 65536
/*defines that the MCU shall wake if the message with the ID is received n times on the communication
channel.*/
#define CanIcomMessageId ((uint32)u) //Range 0=>536870912
/*This parameter defines the message ID the wakeup causes of this CanIcomRxMessage are configured for*/
#define CanIcomMessageIdMask ((uint32)u) //Range 0=>536870912
/*Describes a mask for filtering of CAN identifiers.
The CAN identifiers of incoming messages are masked with this CanIcomMessageIdMask*/
#define CanIcomMissingMessageTimerValue //Float [-INF .. INF]
/*This parameter defines that the MCU shall wake if the message with the ID is not received for a
specific time in s on the
communication channel*/
#define CanIcomPayloadLengthError //Boolean
/*This parameter defines that the MCU shall wake if a payload error occurs*/
/****************************************************/
/*********************CanIcomRxMessageSignalConfig*******************************/
#define CanIcomSignalMask ((uint64)u) //Range 0=>18446744073709551615
/*This parameter shall be used to mask a signal in the payload of a CAN message*/
#define CanIcomSignalOperation //enum AND,EQUAL,GREATER,SMALLER,XOR
/*This parameter defines the operation, which shall be used to verify the signal value creates a wakeup
condition*/
#define CanIcomSignalValue ((uint64)u) //Range 0=>18446744073709551615
/*This parameter shall be used to define a signal value which shall be compared (CanIcomSignalOperation)
with the masked*/
#define CanIcomSignalRef //Reference to [ ComSignal ]
/*This parameter defines a reference to the signal which shall be checked additional to the message id
(CanIcomMessageId).*/
/****************************************************/
#endif