FreeHIL
Loading...
Searching...
No Matches
FH_PWMI.h File Reference

File Map:
FH_Root, Section FH_Perif, FH_PWMI (PWM Input)
Functions in this file, handle RFCommunication (RobotFramework Communication) for all commands related to PWMI (PWM Input) More...

Go to the source code of this file.

Functions

FH_ErrorInfo FH_PWMI_RFCommunication (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function is the basic function of handling RFCommunication (RobotFramework Communication) for all the Commands related to the Function PWMI (PWM Input)
This function is called from FH_RFCommunication().
FH_ErrorInfo FH_PWMI_ProcessCommand_Init (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function handles FH_PWMI_Commands_Init command
There are 3 main items handled in this function as following:
1 - Verifying the health of the received message
2 - Setting the addresses of the functions in FH_Functions, Section FH_PWMI (PWM Input) to an array of function pointer
3 - Calling the related function in FH_Functions, Section FH_PWMI (PWM Input) according to the first parameter of the Data in the message frame.
FH_ErrorInfo FH_PWMI_ProcessCommand_GetStatus (FH_RFCommunication_Message *fh_RFCommunication_Message, uint32_t *FH_PWMI_Frequency, uint8_t *FH_PWMI_DutyCycle)
 This function handles FH_PWMI_Commands_GetStatus command
There are 3 main items handled in this function as following:
1 - Verifying the health of the received message
2 - Setting the addresses of the functions in FH_Functions, Section FH_PWMI (PWM Input) to an array of function pointer
3 - Calling the related function in FH_Functions, Section FH_PWMI (PWM Input) according to the first parameter of the Data in the message frame.

Detailed Description

File Map:
FH_Root, Section FH_Perif, FH_PWMI (PWM Input)
Functions in this file, handle RFCommunication (RobotFramework Communication) for all commands related to PWMI (PWM Input)

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_PWMI.h.

Function Documentation

◆ FH_PWMI_ProcessCommand_GetStatus()

FH_ErrorInfo FH_PWMI_ProcessCommand_GetStatus ( FH_RFCommunication_Message * fh_RFCommunication_Message,
uint32_t * FH_PWMI_Frequency,
uint8_t * FH_PWMI_DutyCycle )

This function handles FH_PWMI_Commands_GetStatus command
There are 3 main items handled in this function as following:
1 - Verifying the health of the received message
2 - Setting the addresses of the functions in FH_Functions, Section FH_PWMI (PWM Input) to an array of function pointer
3 - Calling the related function in FH_Functions, Section FH_PWMI (PWM Input) according to the first parameter of the Data in the message frame.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${PWMI01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_PWMI}    Command=${PWMI_Commands_GetStatus}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  PWMI01 => It indicates the PWM Input 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_PWMI => It is the function in the message frame
  PWMI_Commands_GetStatus => It is the command of the function in the message frame
Returns
FH_ErrorInfo is returned

Definition at line 186 of file FH_PWMI.c.

References FH_ErrorInfo::error_code, FH_ERROR_OK, FH_PWMI_MaxPeripheralNumber, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

Referenced by FH_PWMI_RFCommunication().

◆ FH_PWMI_ProcessCommand_Init()

FH_ErrorInfo FH_PWMI_ProcessCommand_Init ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function handles FH_PWMI_Commands_Init command
There are 3 main items handled in this function as following:
1 - Verifying the health of the received message
2 - Setting the addresses of the functions in FH_Functions, Section FH_PWMI (PWM Input) to an array of function pointer
3 - Calling the related function in FH_Functions, Section FH_PWMI (PWM Input) according to the first parameter of the Data in the message frame.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${PWMI01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_PWMI}    Command=${PWMI_Commands_Init}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  PWMI01 => It indicates the PWM Input 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_PWMI => It is the function in the message frame
  PWMI_Commands_Init => It is the command of the function in the message frame
Returns
FH_ErrorInfo is returned

Definition at line 133 of file FH_PWMI.c.

References FH_ErrorInfo::error_code, FH_ERROR_OK, FH_PWMI_MaxPeripheralNumber, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

Referenced by FH_PWMI_RFCommunication().

◆ FH_PWMI_RFCommunication()

FH_ErrorInfo FH_PWMI_RFCommunication ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function is the basic function of handling RFCommunication (RobotFramework Communication) for all the Commands related to the Function PWMI (PWM Input)
This function is called from FH_RFCommunication().

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
Returns
FH_ErrorInfo is returned

Definition at line 61 of file FH_PWMI.c.

References FH_Uint8Uint32::bytes, FH_ErrorInfo::error_code, FH_PWMI_Commands_GetStatus, FH_PWMI_Commands_Init, FH_PWMI_ProcessCommand_GetStatus(), FH_PWMI_ProcessCommand_Init(), FH_ResetErrorInfo(), FH_RFCommunication_DeviceAddress, fh_RFCommunication_Message, FH_RFCommunication_Send(), FH_RFCommunication_SendBuf, and FH_Uint8Uint32::value.

Referenced by FH_RFCommunication().