FreeHIL
Loading...
Searching...
No Matches
FH_CAN_Configs.h
Go to the documentation of this file.
1/**
2 * @file
3 * @brief
4 * <b>File Map:</b>\n
5 * <b>FH_Root</b>, Section <b>FH_Perif</b>, <b>FH_CAN</b>, <b>FH_CAN_Configs</b>\n
6 * In this file, different configurations of <b>FH_CAN</b> could be set
7 *
8 * @attention <b>FH</b> user could left this file intact
9 *
10 *******************************************************************************
11 * SPDX-License-Identifier: Apache-2.0
12 *
13 * Copyright 2026 Vahid Hasirchi
14 *
15 * Licensed under the Apache License, Version 2.0 (the "License");
16 * you may not use this file except in compliance with the License.
17 * You may obtain a copy of the License at
18 *
19 * http://www.apache.org/licenses/LICENSE-2.0
20 *
21 * Unless required by applicable law or agreed to in writing, software
22 * distributed under the License is distributed on an "AS IS" BASIS,
23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 * See the License for the specific language governing permissions and
25 * limitations under the License.
26 ********************************************************************************
27
28 *
29 * <b>For more information refer to FreeHIL.com</b>
30 *
31*/
32/* Define to prevent recursive inclusion -------------------------------------*/
33#ifndef FH_CAN_Configs_H
34#define FH_CAN_Configs_H
35
36/* Includes ------------------------------------------------------------------*/
40
41/*!
42 <b>FH_CAN01 - FH_CAN08</b> shall be defined here to be utilized in different parts of the <b>FH</b> source code\n
43 <b>FH_CAN_MaxPeripheralNumber</b> is the maximum number of the <b>FH_CAN</b>
44*/
45
46#if FH_CAN_MaxPeripheralNumber > 0
47#define FH_CAN01
48#endif
49#if FH_CAN_MaxPeripheralNumber > 1
50#define FH_CAN02
51#endif
52#if FH_CAN_MaxPeripheralNumber > 2
53#define FH_CAN03
54#endif
55#if FH_CAN_MaxPeripheralNumber > 3
56#define FH_CAN04
57#endif
58#if FH_CAN_MaxPeripheralNumber > 4
59#define FH_CAN05
60#endif
61#if FH_CAN_MaxPeripheralNumber > 5
62#define FH_CAN06
63#endif
64#if FH_CAN_MaxPeripheralNumber > 6
65#define FH_CAN07
66#endif
67#if FH_CAN_MaxPeripheralNumber > 7
68#define FH_CAN08
69#endif
70
71#if FH_CAN_MaxPeripheralNumber > 0 // If at least one <b>FH_CAN</b> is defined
72
73/*!
74 <b>FH_CAN_Init_FuncPtrModel</b> Function pointer definition
75*/
77
78/*!
79 <b>FH_CAN_Send_FuncPtrModel</b> Function pointer definition
80*/
82
83/*!
84 <b>FH_CAN_Receive_FuncPtrModel</b> Function pointer definition
85*/
86typedef FH_ErrorInfo (*FH_CAN_Receive_FuncPtrModel) (FH_RFCommunication_Message* fh_RFCommunication_Message, uint8_t* FH_CAN_DataSize, uint8_t* FH_CAN_Data);
87
88/*!
89 <b>FH_CAN_ReceiveW_FuncPtrModel</b> Function pointer definition
90*/
91typedef FH_ErrorInfo (*FH_CAN_ReceiveW_FuncPtrModel) (FH_RFCommunication_Message* fh_RFCommunication_Message, uint8_t* FH_CAN_DataSize, uint8_t* FH_CAN_Data);
92
93/*!
94 <b>FH_CAN_ResetRB_FuncPtrModel</b> Function pointer definition
95*/
97
98/*!
99 <b>FH_CAN_SSD8_FuncPtrModel</b> Function pointer definition
100*/
102
103/*!
104 <b>FH_CAN_SSD16_FuncPtrModel</b> Function pointer definition
105*/
107
108/*!
109 <b>FH_CAN_SSD32_FuncPtrModel</b> Function pointer definition
110*/
112
113/*!
114 <b>FH_CAN_GSD8_FuncPtrModel</b> Function pointer definition
115*/
116typedef FH_ErrorInfo (*FH_CAN_GSD8_FuncPtrModel) (FH_RFCommunication_Message* fh_RFCommunication_Message, uint8_t* FH_CAN_DataLength, uint8_t* FH_CAN_FH_CAN_Data);
117
118/*!
119 <b>FH_CAN_GSD16_FuncPtrModel</b> Function pointer definition
120*/
121typedef FH_ErrorInfo (*FH_CAN_GSD16_FuncPtrModel) (FH_RFCommunication_Message* fh_RFCommunication_Message, uint8_t* FH_CAN_DataLength, uint8_t* FH_CAN_FH_CAN_Data);
122
123/*!
124 <b>FH_CAN_GSD32_FuncPtrModel</b> Function pointer definition
125*/
126typedef FH_ErrorInfo (*FH_CAN_GSD32_FuncPtrModel) (FH_RFCommunication_Message* fh_RFCommunication_Message, uint8_t* FH_CAN_DataLength, uint8_t* FH_CAN_FH_CAN_Data);
127
128/*!
129 Different commands for <b>CAN</b> Function
130*/
145
146/*!
147 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>Init</b> command of <b>CAN</b> Function, are defined here
148*/
149#define FH_CAN_MinCommandSize_Init 1
150
151/*!
152 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>Send</b> command of <b>CAN</b> Function, are defined here
153*/
154#define FH_CAN_MinCommandSize_Send 3
155
156/*!
157 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>Receive</b> command of <b>CAN</b> Function, are defined here
158*/
159#define FH_CAN_MinCommandSize_Receive 1
160
161/*!
162 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>ReceiveW</b> command of <b>CAN</b> Function, are defined here
163*/
164#define FH_CAN_MinCommandSize_ReceiveW 6
165
166/*!
167 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>ResetRB</b> command of <b>CAN</b> Function, are defined here
168*/
169#define FH_CAN_MinCommandSize_ResetRB 1
170
171/*!
172 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>SSD8</b> command of <b>CAN</b> Function, are defined here
173*/
174#define FH_CAN_MinCommandSize_SSD8 3
175
176/*!
177 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>SSD16</b> command of <b>CAN</b> Function, are defined here
178*/
179#define FH_CAN_MinCommandSize_SSD16 4
180
181/*!
182 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>SSD32</b> command of <b>CAN</b> Function, are defined here
183*/
184#define FH_CAN_MinCommandSize_SSD32 6
185
186/*!
187 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>GSD8</b> command of <b>CAN</b> Function, are defined here
188*/
189#define FH_CAN_MinCommandSize_GSD8 1
190
191/*!
192 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>GSD16</b> command of <b>CAN</b> Function, are defined here
193*/
194#define FH_CAN_MinCommandSize_GSD16 1
195
196/*!
197 Minimum size of the <b>Data</b> part in the message frame (<b>FH_RFCommunication_Message</b>) for the <b>GSD32</b> command of <b>CAN</b> Function, are defined here
198*/
199#define FH_CAN_MinCommandSize_GSD32 1
200
201/*!
202 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the Init command of <b>CAN</b> Function, are defined here
203*/
208
209/*!
210 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the Send command of <b>CAN</b> Function, are defined here
211*/
218
219/*!
220 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the Receive command of <b>CAN</b> Function, are defined here
221*/
226
227/*!
228 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the ReceiveW command of <b>CAN</b> Function, are defined here
229*/
236
237/*!
238 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the ResetRB command of <b>CAN</b> Function, are defined here
239*/
244
245/*!
246 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the SSD8 command of <b>CAN</b> Function, are defined here
247*/
254
255/*!
256 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the SSD16 command of <b>CAN</b> Function, are defined here
257*/
264
265/*!
266 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the SSD32 command of <b>CAN</b> Function, are defined here
267*/
274
275/*!
276 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the GSD8 command of <b>CAN</b> Function, are defined here
277*/
282
283/*!
284 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the GSD16 command of <b>CAN</b> Function, are defined here
285*/
290
291/*!
292 Different elements of the Data part in the message frame (<b>FH_RFCommunication_Message</b>) for the GSD32 command of <b>CAN</b> Function, are defined here
293*/
298
299#endif
300
301#endif