FreeHIL
Loading...
Searching...
No Matches
FH_CAN_Receive_S.c
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> (Digital Output), <b>Cmd</b> (Command), <b>Receive</b>, <b>Receive_S</b> (Receive Set Address)\n
6 * Functions in this file, set the address of the defined <b>FH_Functions</b>, Section <b>FH_CAN</b> (CAN), <b>FH_CAN_Receive_CAN01-...</b> to an array of function pointers
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
33/* Includes ------------------------------------------------------------------*/
34#include "../../../../../../../FH_Embedded/FH_Root/FH_Perif/FH_CAN/Cmd/Receive/Receive_S/FH_CAN_Receive_S.h"
35
36#include "../../../../../../../FH_Embedded/FH_Root/FH_General/FH_GeneralFunctions/FH_GeneralFunctions.h"
37
38#ifdef FH_CAN01
40#endif
41#ifdef FH_CAN02
43#endif
44#ifdef FH_CAN03
46#endif
47#ifdef FH_CAN04
49#endif
50#ifdef FH_CAN05
52#endif
53#ifdef FH_CAN06
55#endif
56#ifdef FH_CAN07
58#endif
59#ifdef FH_CAN08
61#endif
62
63#if FH_CAN_MaxPeripheralNumber > 0 // It is configurable in FH_DevicePeripherals.h
64
65/**
66 * @brief This function sets the address of the defined <b>FH_Functions</b>, Section <b>FH_CAN</b> (CAN), <b>FH_CAN_Receive_CAN01-...</b> to an array of function pointers
67 *
68 * @param FH_CAN_Receive_FuncPtr
69 * An array of function pointers with FH_CAN_Receive_FuncPtrModel model
70 *
71 * @return None
72 *
73
74*/
75void FH_CAN_Receive_S(FH_CAN_Receive_FuncPtrModel *FH_CAN_Receive_FuncPtr)
76{
77 for (uint8_t i = 0; i < FH_CAN_MaxPeripheralNumber; i++) // if FH_CAN_MaxPeripheralNumber > 0
78 {
79 FH_CAN_Receive_FuncPtr[i] = NULL_PTR; // Initialization of the function pointers with null pointer to prevent pointing to undefined addresses
80 }
81
82 #ifdef FH_CAN01
83 FH_CAN_Receive_FuncPtr[0] = FH_CAN_Receive_CAN01; // Set the function pointer address with the related function address
84 #endif
85 #ifdef FH_CAN02
86 FH_CAN_Receive_FuncPtr[1] = FH_CAN_Receive_CAN02; // Set the function pointer address with the related function address
87 #endif
88 #ifdef FH_CAN03
89 FH_CAN_Receive_FuncPtr[2] = FH_CAN_Receive_CAN03; // Set the function pointer address with the related function address
90 #endif
91 #ifdef FH_CAN04
92 FH_CAN_Receive_FuncPtr[3] = FH_CAN_Receive_CAN04; // Set the function pointer address with the related function address
93 #endif
94 #ifdef FH_CAN05
95 FH_CAN_Receive_FuncPtr[4] = FH_CAN_Receive_CAN05; // Set the function pointer address with the related function address
96 #endif
97 #ifdef FH_CAN06
98 FH_CAN_Receive_FuncPtr[5] = FH_CAN_Receive_CAN06; // Set the function pointer address with the related function address
99 #endif
100 #ifdef FH_CAN07
101 FH_CAN_Receive_FuncPtr[6] = FH_CAN_Receive_CAN07; // Set the function pointer address with the related function address
102 #endif
103 #ifdef FH_CAN08
104 FH_CAN_Receive_FuncPtr[7] = FH_CAN_Receive_CAN08; // Set the function pointer address with the related function address
105 #endif
106}
107
108#endif