FreeHIL
Loading...
Searching...
No Matches
FH_RFCommunication_GlobalVariables.h
Go to the documentation of this file.
1/**
2 * @file
3 * @brief
4 * <b>File Map:</b>\n
5 * <b>FH_Setup</b>, Section <b>FH_RFCommunication</b>\n
6 * The micro-controller on which <b>FH</b> source code is ported, could be simply utilized in a <b>RS485 network</b>\n
7 * In other word, multiple devices or multiple cards could be simply utilized where every device or every card has its own address\n
8 * Address of the device (or card) for every device (or card) is set by <b>FH</b> user in <b>FH_DeviceAddress.h</b>\n
9 * An interested UART (called <b>Communication Dedicated UART</b>) by the <b>FH</b> user for the communication between <b>RobotFramework</b> and the micro-controller on which <b>FH</b> source code is ported, shall be dedicated\n
10 * Global variables and arrays of <b>Communication Dedicated UART</b> are defined here
11 * This header file could be included whenever interested by <b>FH user</b>
12 *
13 * @attention <b>FH</b> user could left this file intact
14 *
15 *******************************************************************************
16 * SPDX-License-Identifier: Apache-2.0
17 *
18 * Copyright 2026 Vahid Hasirchi
19 *
20 * Licensed under the Apache License, Version 2.0 (the "License");
21 * you may not use this file except in compliance with the License.
22 * You may obtain a copy of the License at
23 *
24 * http://www.apache.org/licenses/LICENSE-2.0
25 *
26 * Unless required by applicable law or agreed to in writing, software
27 * distributed under the License is distributed on an "AS IS" BASIS,
28 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 * See the License for the specific language governing permissions and
30 * limitations under the License.
31 ********************************************************************************
32
33 *
34 * <b>For more information refer to FreeHIL.com</b>
35 *
36*/
37
38/* Define to prevent recursive inclusion -------------------------------------*/
39#ifndef FH_RFCommunication_GlobalVariables_H
40#define FH_RFCommunication_GlobalVariables_H
41
42/* Includes ------------------------------------------------------------------*/
45
46/*!
47 <b>FH_RFCommunication_Message</b> is the structure for receiving the message frame from <b>RobotFramework</b>\n
48*/
49typedef struct
50{
51 /*!
52 The 1st data in the message frame is the <b>DeviceAddress</b>\n
53 If a message (from <b>RobotFramework</b>) with a different <b>DeviceAddress</b> than the one set in <b>FH_DeviceAddress.h</b> is received, it will be ignored and not processed
54 */
56 /*!
57 The 2nd data in the message frame is the <b>Function</b>\n
58 <b>Function</b> could be <b>DO</b> (Digital Output), <b>DI</b> (Digital Input), <b>AO</b> (Analog Output), <b>AI</b> (Analog Input), <b>UART</b>, <b>CAN</b> , ... in <b>FH_RFCommunication_Function<b>
59 */
60 uint8_t Function;
61 /*!
62 The 3rd data in the message frame is the <b>Command</b>\n
63 There are different commands for <b>DO</b> (Digital Output), <b>DI</b> (Digital Input), <b>AO</b> (Analog Output), <b>AI</b> (Analog Input), <b>UART</b>, <b>CAN</b> , ...\n
64 For example for <b>DO</b> (Digital Output), different commands are available in <b>FH_DO_Configs.h</b>
65 */
66 uint8_t Command;
67 /*!
68 The 4th data in the message frame is the <b>DataLength</b>\n
69 It is the length of the Data in the message frame\n
70 Since DataLength is just one byte, <b>Data</b> bytes can't be more than 255
71 */
72 uint8_t DataLength;
73 /*!
74 The <b>Data</b> could be from 0 byte to up to (FH_RFCommunication_ReceiveBufLength - FH_RFCommunication_MinCommandSize) bytes\n
75 Since DataLength is just one byte, <b>Data</b> bytes can't be more than 255\n
76 <b>FH_RFCommunication_ReceiveBufLength</b> and <b>FH_RFCommunication_MinCommandSize</b> are configurable in <b>FH_RFCommunication_Configs.h</b>
77 */
79 /*!
80 The checksum of the message\n
81 */
82 uint8_t Checksum;
84
86extern volatile uint8_t FH_RFCommunication_ReceiveBuf[];
87extern volatile uint16_t FH_RFCommunication_ReceiveBufIndex;
88extern char FH_RFCommunication_SendBuf[];
89
90#endif