FreeHIL
Loading...
Searching...
No Matches
FH_UART_Send_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_UART</b> (Digital Output), <b>Cmd</b> (Command), <b>Send</b>, <b>Send_S</b> (Send Set Address)\n
6 * Functions in this file, set the address of the defined <b>FH_Functions</b>, Section <b>FH_UART</b> (UART), <b>FH_UART_Send_UART01-...</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 ------------------------------------------------------------------*/
35
36#include "../../../../../../../FH_Embedded/FH_Root/FH_General/FH_GeneralFunctions/FH_GeneralFunctions.h"
37
38#ifdef FH_UART01
40#endif
41#ifdef FH_UART02
43#endif
44#ifdef FH_UART03
46#endif
47#ifdef FH_UART04
49#endif
50#ifdef FH_UART05
52#endif
53#ifdef FH_UART06
55#endif
56#ifdef FH_UART07
58#endif
59#ifdef FH_UART08
61#endif
62
63#if FH_UART_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_UART</b> (UART), <b>FH_UART_Send_UART01-...</b> to an array of function pointers
67 *
68 * @param FH_UART_Send_FuncPtr
69 * An array of function pointers with FH_UART_Send_FuncPtrModel model
70 *
71 * @return None
72 *
73
74*/
75void FH_UART_Send_S(FH_UART_Send_FuncPtrModel *FH_UART_Send_FuncPtr)
76{
77 for (uint8_t i = 0; i < FH_UART_MaxPeripheralNumber; i++) // if FH_UART_MaxPeripheralNumber > 0
78 {
79 FH_UART_Send_FuncPtr[i] = NULL_PTR; // Initialization of the function pointers with null pointer to prevent pointing to undefined addresses
80 }
81
82 #ifdef FH_UART01
83 FH_UART_Send_FuncPtr[0] = FH_UART_Send_UART01; // Set the function pointer address with the related function address
84 #endif
85 #ifdef FH_UART02
86 FH_UART_Send_FuncPtr[1] = FH_UART_Send_UART02; // Set the function pointer address with the related function address
87 #endif
88 #ifdef FH_UART03
89 FH_UART_Send_FuncPtr[2] = FH_UART_Send_UART03; // Set the function pointer address with the related function address
90 #endif
91 #ifdef FH_UART04
92 FH_UART_Send_FuncPtr[3] = FH_UART_Send_UART04; // Set the function pointer address with the related function address
93 #endif
94 #ifdef FH_UART05
95 FH_UART_Send_FuncPtr[4] = FH_UART_Send_UART05; // Set the function pointer address with the related function address
96 #endif
97 #ifdef FH_UART06
98 FH_UART_Send_FuncPtr[5] = FH_UART_Send_UART06; // Set the function pointer address with the related function address
99 #endif
100 #ifdef FH_UART07
101 FH_UART_Send_FuncPtr[6] = FH_UART_Send_UART07; // Set the function pointer address with the related function address
102 #endif
103 #ifdef FH_UART08
104 FH_UART_Send_FuncPtr[7] = FH_UART_Send_UART08; // Set the function pointer address with the related function address
105 #endif
106}
107
108#endif