FreeHIL
Loading...
Searching...
No Matches
FH_DI_Init_C.c File Reference

File Map:
FH_Root, Section FH_Perif, FH_DI (Digital Input), Cmd (Command), Init, Init_C (Init Call)
Functions in this file, Call the related function in FH_Functions, Section FH_DI (Digital Input) according to the first parameter of the Data in the message frame More...

#include "../../../../../../FH_Setup/FH_DeviceAddress/FH_DeviceAddress.h"
#include "../../../../../../../FH_Embedded/FH_Root/FH_Perif/FH_DI/Cmd/Init/Init_C/FH_DI_Init_C.h"
#include "../../../../../../../FH_Embedded/FH_Root/FH_General/FH_GeneralFunctions/FH_GeneralFunctions.h"

Go to the source code of this file.

Functions

FH_ErrorInfo FH_DI_Init_C (FH_RFCommunication_Message *fh_RFCommunication_Message, FH_DI_Init_FuncPtrModel *FH_DI_Init_FuncPtr)
 This function calls the related function in FH_Functions, Section FH_DI (Digital Input) according to the first parameter of the Data in the message frame.
FH_ErrorInfo FH_DI_InitMULTI_C (FH_RFCommunication_Message *fh_RFCommunication_Message, FH_DI_Init_FuncPtrModel *FH_DI_Init_FuncPtr)
 This function calls the related function in FH_Functions, Section FH_DI (Digital Input) according to the first parameter of the Data in the message frame.

Detailed Description

File Map:
FH_Root, Section FH_Perif, FH_DI (Digital Input), Cmd (Command), Init, Init_C (Init Call)
Functions in this file, Call the related function in FH_Functions, Section FH_DI (Digital Input) according to the first parameter of the Data in the message frame

Attention
FH user could left this file intact

SPDX-License-Identifier: Apache-2.0

Copyright 2026 Vahid Hasirchi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

For more information refer to FreeHIL.com

Definition in file FH_DI_Init_C.c.

Function Documentation

◆ FH_DI_Init_C()

FH_ErrorInfo FH_DI_Init_C ( FH_RFCommunication_Message * fh_RFCommunication_Message,
FH_DI_Init_FuncPtrModel * FH_DI_Init_FuncPtr )

This function calls the related function in FH_Functions, Section FH_DI (Digital Input) according to the first parameter of the Data in the message frame.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
fH_DI_Init_FuncPtrThe array of function pointers
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${DI01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_DI}    Command=${DI_Commands_Init}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  DI01 => It indicates the Digital Input 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_DI => It is the function in the message frame
  DI_Commands_Init => It is the command of the function in the message frame
Returns
FH_ErrorInfo is returned

Definition at line 70 of file FH_DI_Init_C.c.

References DI_Init_PeripheralNumber, FH_ErrorInfo::error_code, FH_DI_MaxPeripheralNumber, FH_ERROR_MessageFrame, FH_ERROR_Root, FH_ResetErrorInfo(), fh_RFCommunication_Message, and NULL_PTR.

Referenced by FH_DI_ProcessCommand_Init().

◆ FH_DI_InitMULTI_C()

FH_ErrorInfo FH_DI_InitMULTI_C ( FH_RFCommunication_Message * fh_RFCommunication_Message,
FH_DI_Init_FuncPtrModel * FH_DI_Init_FuncPtr )

This function calls the related function in FH_Functions, Section FH_DI (Digital Input) according to the first parameter of the Data in the message frame.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
fH_DI_Init_FuncPtrThe array of function pointers
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    FF    FF    FF    FF    FF    FF    FF    FF
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_DI}    Command=${DI_Commands_InitMULTI}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  FF    FF    FF    FF    FF    FF    FF    FF => Example data as the first 8 parameters
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_DI => It is the function in the message frame
  DI_Commands_InitMULTI => It is the command of the function in the message frame
Returns
FH_ErrorInfo is returned
Warning
By default, in InitMULTI (Which is mass initialization of up to 64 DI (Digital Input)) command, 8 bytes which is 64 bits (which means 64 DI (Digital Input)) is used in the command
To use InitMULTI (Which is mass initialization of up to 64 DI (Digital Input)) command, FH_DI_MaxPeripheralNumber and FH_DI_MULTI_MaxPeripheralNumberLimit shall be set to 64

Definition at line 126 of file FH_DI_Init_C.c.

References FH_DI_MaxPeripheralNumber, FH_DI_MULTI_MaxPeripheralNumberLimit, FH_ResetErrorInfo(), fh_RFCommunication_Message, and NULL_PTR.

Referenced by FH_DI_ProcessCommand_InitMULTI().