|
FreeHIL
|
File Map:
FH_Root, Section FH_Perif, FH_PWMO (PWM Output)
Functions in this file, handle RFCommunication (RobotFramework Communication) for all commands related to PWMO (PWM Output)
More...
#include "../../../../FH_Embedded/FH_Root/FH_Perif/FH_PWMO/FH_PWMO.h"#include "stdio.h"#include "../../../../FH_Embedded/FH_Root/FH_General/FH_GeneralFunctions/FH_GeneralFunctions.h"#include "../../../../FH_Embedded/FH_Setup/FH_DeviceAddress/FH_DeviceAddress.h"#include "../../../../FH_Embedded/FH_Setup/FH_RFCommunication/FH_RFCommunication.h"#include "../../../../FH_Embedded/FH_Root/FH_Perif/FH_PWMO/Cmd/Init/Init_H/FH_PWMO_Init_H.h"#include "../../../../FH_Embedded/FH_Root/FH_Perif/FH_PWMO/Cmd/Init/Init_C/FH_PWMO_Init_C.h"#include "../../../../FH_Embedded/FH_Root/FH_Perif/FH_PWMO/Cmd/Init/Init_S/FH_PWMO_Init_S.h"#include "../../../../FH_Embedded/FH_Root/FH_Perif/FH_PWMO/Cmd/SetStatus/SetStatus_H/FH_PWMO_SetStatus_H.h"#include "../../../../FH_Embedded/FH_Root/FH_Perif/FH_PWMO/Cmd/SetStatus/SetStatus_C/FH_PWMO_SetStatus_C.h"#include "../../../../FH_Embedded/FH_Root/FH_Perif/FH_PWMO/Cmd/SetStatus/SetStatus_S/FH_PWMO_SetStatus_S.h"Go to the source code of this file.
Functions | |
| FH_ErrorInfo | FH_PWMO_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 PWMO (PWM Output) This function is called from FH_RFCommunication(). | |
| FH_ErrorInfo | FH_PWMO_ProcessCommand_Init (FH_RFCommunication_Message *fh_RFCommunication_Message) |
| This function handles FH_PWMO_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_PWMO (PWM Output) to an array of function pointer 3 - Calling the related function in FH_Functions, Section FH_PWMO (PWM Output) according to the first parameter of the Data in the message frame. | |
| FH_ErrorInfo | FH_PWMO_ProcessCommand_SetStatus (FH_RFCommunication_Message *fh_RFCommunication_Message) |
| This function handles FH_PWMO_Commands_SetStatus 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_PWMO (PWM Output) to an array of function pointer 3 - Calling the related function in FH_Functions, Section FH_PWMO (PWM Output) according to the first parameter of the Data in the message frame (The next 4 parameters after the first one, resemble the PWM data to be set as one 32 bit data). | |
File Map:
FH_Root, Section FH_Perif, FH_PWMO (PWM Output)
Functions in this file, handle RFCommunication (RobotFramework Communication) for all commands related to PWMO (PWM Output)
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_PWMO.c.
| FH_ErrorInfo FH_PWMO_ProcessCommand_Init | ( | FH_RFCommunication_Message * | fh_RFCommunication_Message | ) |
This function handles FH_PWMO_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_PWMO (PWM Output) to an array of function pointer
3 - Calling the related function in FH_Functions, Section FH_PWMO (PWM Output) according to the first parameter of the Data in the message frame.
| fh_RFCommunication_Message | The message frame set by RobotFramework |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${PWMO01}
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_PWMO} Command=${PWMO_Commands_Init} Data=@{MessageData}
${Result} SendMessage &{Message}
Comments:
PWMO01 => It indicates the PWM Output 01
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_PWMO => It is the function in the message frame
PWMO_Commands_Init => It is the command of the function in the message frame
Definition at line 114 of file FH_PWMO.c.
References FH_ErrorInfo::error_code, FH_ERROR_OK, FH_PWMO_MaxPeripheralNumber, FH_ResetErrorInfo(), and fh_RFCommunication_Message.
Referenced by FH_PWMO_RFCommunication().
| FH_ErrorInfo FH_PWMO_ProcessCommand_SetStatus | ( | FH_RFCommunication_Message * | fh_RFCommunication_Message | ) |
This function handles FH_PWMO_Commands_SetStatus 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_PWMO (PWM Output) to an array of function pointer
3 - Calling the related function in FH_Functions, Section FH_PWMO (PWM Output) according to the first parameter of the Data in the message frame
(The next 4 parameters after the first one, resemble the PWM data to be set as one 32 bit data).
| fh_RFCommunication_Message | The message frame set by RobotFramework |
==============================================================================
##### RobotFramework Example #####
==============================================================================
@{MessageData} = Create List ${PWMO01} 00 00 00 F0 32
&{Message} = Create Dictionary DeviceAddress=${DeviceAddress_01} Function=${Function_PWMO} Command=${PWMO_Commands_SetStatus} Data=@{MessageData}
${Result} SendMessage &{Message}
Comments:
PWMO01 => It indicates the PWM Output 01
00 00 00 F0 => Example data as PWM frequency (0x000000F0) to be set through the <b>PWM Output 01</b>\n
32 => Example data as PWM duty cycle (0x32 => as 50% duty cycle) to be set through the <b>PWM Output 01</b>\n
DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
Function_PWMO => It is the function in the message frame
PWMO_Commands_SetStatus => It is the command of the function in the message frame
Definition at line 169 of file FH_PWMO.c.
References FH_ErrorInfo::error_code, FH_ERROR_OK, FH_PWMO_MaxPeripheralNumber, FH_ResetErrorInfo(), and fh_RFCommunication_Message.
Referenced by FH_PWMO_RFCommunication().
| FH_ErrorInfo FH_PWMO_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 PWMO (PWM Output)
This function is called from FH_RFCommunication().
| fh_RFCommunication_Message | The message frame set by RobotFramework |
Definition at line 61 of file FH_PWMO.c.
References FH_ErrorInfo::error_code, FH_PWMO_Commands_Init, FH_PWMO_Commands_SetStatus, FH_PWMO_ProcessCommand_Init(), FH_PWMO_ProcessCommand_SetStatus(), FH_ResetErrorInfo(), FH_RFCommunication_DeviceAddress, fh_RFCommunication_Message, FH_RFCommunication_Send(), and FH_RFCommunication_SendBuf.
Referenced by FH_RFCommunication().