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

File Map:
FH_Functions, Section FH_CAN (CAN), Peripheral FH_CAN01 (CAN 01)
(The CAN01 (CAN 01) could be any interested CAN of the micro-controller on which FH source code is ported)
More...

Go to the source code of this file.

Functions

FH_ErrorInfo FH_CAN_Init_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function initializes the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user should call the initialization function of the interested CAN here.
FH_ErrorInfo FH_CAN_Send_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function sends data through the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user should call the send function of the interested CAN here.
FH_ErrorInfo FH_CAN_Receive_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *FH_DataSize, uint8_t *FH_Data)
 This function retrieves the ISR (Interrupt Service Routine) receive buffer (FH_CAN01_ReceiveBuf) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user could left the present source code here intact.
FH_ErrorInfo FH_CAN_ReceiveW_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *FH_DataSize, uint8_t *FH_Data)
 This function waits to receive the specified number of bytes of data through the ISR (Interrupt Service Routine) receive buffer (FH_CAN01_ReceiveBuf) of the CAN 01
A maximum timeout is specified too
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user could left the present source code here intact.
FH_ErrorInfo FH_CAN_ResetRB_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function resets the ISR (Interrupt Service Routine) receive buffer index (FH_CAN01_ReceiveBufIndex) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user could left the present source code here intact.
FH_ErrorInfo FH_CAN_SSD8_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function sets the shared data buffer (FH_CAN01_SharedDataBuf_8Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_8Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_8Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...
FH_ErrorInfo FH_CAN_SSD16_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function sets the shared data buffer (FH_CAN01_SharedDataBuf_16Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_16Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_16Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...
FH_ErrorInfo FH_CAN_SSD32_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function sets the shared data buffer (FH_CAN01_SharedDataBuf_32Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_32Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_32Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...
FH_ErrorInfo FH_CAN_GSD8_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *SharedDataLength, uint8_t *SharedData)
 This function gets the shared data buffer (FH_CAN01_SharedDataBuf_8Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_8Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_8Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...
FH_ErrorInfo FH_CAN_GSD16_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *SharedDataLength, uint8_t *SharedData)
 This function gets the shared data buffer (FH_CAN01_SharedDataBuf_16Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_16Bits is a shared global 16 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_16Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...
FH_ErrorInfo FH_CAN_GSD32_CAN01 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *SharedDataLength, uint8_t *SharedData)
 This function gets the shared data buffer (FH_CAN01_SharedDataBuf_32Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_32Bits is a shared global 32 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_32Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...

Detailed Description

File Map:
FH_Functions, Section FH_CAN (CAN), Peripheral FH_CAN01 (CAN 01)
(The CAN01 (CAN 01) could be any interested CAN of the micro-controller on which FH source code is ported)

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

Function Documentation

◆ FH_CAN_GSD16_CAN01()

FH_ErrorInfo FH_CAN_GSD16_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message,
uint8_t * SharedDataLength,
uint8_t * SharedData )

This function gets the shared data buffer (FH_CAN01_SharedDataBuf_16Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_16Bits is a shared global 16 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_16Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...

FH user could left the present source code here intact

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
SharedDataLength*SharedDataLength will be set to FH_CAN01_SharedDataBufLength_16Bits
SharedData*SharedData will be set to FH_CAN01_SharedDataBuf_16Bits
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN01_SharedDataBuf_16Bits in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_GSD16}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_GSD16 => It is the command of the function in the message frame

Definition at line 677 of file FH_CAN01.c.

References FH_Uint8Uint16::bytes, FH_ErrorInfo::error_code, FH_CAN01_SharedDataBuf_16Bits, FH_CAN01_SharedDataBufLength_16Bits, FH_ERROR_OK, FH_ResetErrorInfo(), fh_RFCommunication_Message, and FH_Uint8Uint16::value.

◆ FH_CAN_GSD32_CAN01()

FH_ErrorInfo FH_CAN_GSD32_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message,
uint8_t * SharedDataLength,
uint8_t * SharedData )

This function gets the shared data buffer (FH_CAN01_SharedDataBuf_32Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_32Bits is a shared global 32 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_32Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...

FH user could left the present source code here intact

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
SharedDataLength*SharedDataLength will be set to FH_CAN01_SharedDataBufLength_32Bits
SharedData*SharedData will be set to FH_CAN01_SharedDataBuf_32Bits
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN01_SharedDataBuf_32Bits in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_GSD32}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_GSD32 => It is the command of the function in the message frame

Definition at line 736 of file FH_CAN01.c.

References FH_Uint8Uint32::bytes, FH_ErrorInfo::error_code, FH_CAN01_SharedDataBuf_32Bits, FH_CAN01_SharedDataBufLength_32Bits, FH_ERROR_OK, FH_ResetErrorInfo(), fh_RFCommunication_Message, and FH_Uint8Uint32::value.

◆ FH_CAN_GSD8_CAN01()

FH_ErrorInfo FH_CAN_GSD8_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message,
uint8_t * SharedDataLength,
uint8_t * SharedData )

This function gets the shared data buffer (FH_CAN01_SharedDataBuf_8Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_8Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_8Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...

FH user could left the present source code here intact

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
SharedDataLength*SharedDataLength will be set to FH_CAN01_SharedDataBufLength_8Bits
SharedData*SharedData will be set to FH_CAN01_SharedDataBuf_8Bits
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN01_SharedDataBuf_8Bits in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_GSD8}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_GSD8 => It is the command of the function in the message frame

Definition at line 622 of file FH_CAN01.c.

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

Referenced by FH_CAN_GSD8_S().

◆ FH_CAN_Init_CAN01()

FH_ErrorInfo FH_CAN_Init_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function initializes the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user should call the initialization function of the interested CAN here.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
Returns
FH_ErrorInfo is returned
Note
To have a clean code, just include the related header file
Then just call the function here
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_Init}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_Init => It is the command of the function in the message frame
Warning
To be able to send or receive data through the CAN 01 of the micro-controller on which FH source code is ported, this function shall be invoked once by RobotFramework firstly
In other words, before invoking for example FH_CAN_Send_CAN01 or FH_CAN_Receive_CAN01 functions or ... from RobotFramework, this function shall be invoked in order to initialize the CAN

Definition at line 137 of file FH_CAN01.c.

References FH_ResetErrorInfo(), and fh_RFCommunication_Message.

Referenced by FH_CAN_Init_S().

◆ FH_CAN_Receive_CAN01()

FH_ErrorInfo FH_CAN_Receive_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message,
uint8_t * DataSize,
uint8_t * Data )

This function retrieves the ISR (Interrupt Service Routine) receive buffer (FH_CAN01_ReceiveBuf) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user could left the present source code here intact.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
DataSize*DataSize will be set to the ISR (Interrupt Service Routine) receive buffer index (FH_CAN01_ReceiveBufIndex) of the CAN 01
Data*Data will be set to the ISR (Interrupt Service Routine) receive buffer (FH_CAN01_ReceiveBuf) of the CAN 01
Returns
FH_ErrorInfo is returned
Note
FH user shall use FH_CAN01_ReceiveBuf and FH_CAN01_ReceiveBufIndex in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
In other word, FH_CAN01_ReceiveBuf array shall receive every byte of the received data there with FH_CAN01_ReceiveBufIndex as index of the array
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_Receive}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_Receive => It is the command of the function in the message frame
Warning
To be able to receive data through the CAN 01 of the micro-controller on which FH source code is ported, the FH_CAN_Init_CAN01 function shall be invoked once by RobotFramework firstly
In other words, before invoking FH_CAN_Receive_CAN01 function from RobotFramework, FH_CAN_Init_CAN01 function shall be invoked in order to initialize the CAN
Note
The only solution for resetting the receive buffer index (FH_CAN01_ReceiveBufIndex) is using FH_CAN_ResetRB_CAN01 function
In other words, FH_CAN01_ReceiveBufIndex may have been already increased if any data has been already received
So it is normally required to invoke FH_CAN_ResetRB_CAN01 through RobotFramework to reset the receive buffer index (FH_CAN01_ReceiveBufIndex) before invoking FH_CAN_Receive_CAN01

Definition at line 251 of file FH_CAN01.c.

References FH_CAN01_ReceiveBuf, FH_CAN01_ReceiveBufIndex, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

◆ FH_CAN_ReceiveW_CAN01()

FH_ErrorInfo FH_CAN_ReceiveW_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message,
uint8_t * DataSize,
uint8_t * Data )

This function waits to receive the specified number of bytes of data through the ISR (Interrupt Service Routine) receive buffer (FH_CAN01_ReceiveBuf) of the CAN 01
A maximum timeout is specified too
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user could left the present source code here intact.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
DataSize*DataSize will be set to the ISR (Interrupt Service Routine) receive buffer index (FH_CAN01_ReceiveBufIndex) of the CAN 01
Data*Data will be set to the ISR (Interrupt Service Routine) receive buffer (FH_CAN01_ReceiveBuf) of the CAN 01
Returns
FH_ErrorInfo is returned
Note
FH user shall use FH_CAN01_ReceiveBuf and FH_CAN01_ReceiveBufIndex in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
In other word, FH_CAN01_ReceiveBuf array shall receive every byte of the received data there with FH_CAN01_ReceiveBufIndex as index of the array
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}    05    00    00    0B    B8
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_ReceiveW}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  05 => The expected number of bytes of data to be received through the <b>ISR</b> (Interrupt Service Routine) receive buffer (FH_CAN01_ReceiveBuf) of the <b>CAN 01</b>
  00    00    0B    B8 => Example data (0x00000BB8 mili-seconds) as timeout of receiving the expected number of bytes
                          FH_GlobalTimeCounter which is a global variable is utilized to calculate the timeout
                          FH_GlobalTimeCounter shall be incremented every <b>1 mili-second</b> in an interested timer <b>ISR</b> (Interrupt Service Routine) by <b>FH</b> user
                          For this to happen, <b>FH_GlobalTimerCount.h</b> shall be included in the interested timer <b>ISR</b> (Interrupt Service Routine) file
                          If the expected number of bytes are received, the function does not wait anymore for the remaining time of the timeout
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_ReceiveW => It is the command of the function in the message frame
Warning
To be able to receive data through the CAN 01 of the micro-controller on which FH source code is ported, the FH_CAN_Init_CAN01 function shall be invoked once by RobotFramework firstly
In other words, before invoking FH_CAN_ReceiveW_CAN01 function from RobotFramework, FH_CAN_Init_CAN01 function shall be invoked in order to initialize the CAN
Note
The only solution for resetting the receive buffer index (FH_CAN01_ReceiveBufIndex) is using FH_CAN_ResetRB_CAN01 function
In other words, FH_CAN01_ReceiveBufIndex may have been already increased if any data has been already received
So it is normally required to invoke FH_CAN_ResetRB_CAN01 through RobotFramework to reset the receive buffer index (FH_CAN01_ReceiveBufIndex) before invoking FH_CAN_ReceiveW_CAN01

Definition at line 322 of file FH_CAN01.c.

References CAN_ReceiveW_ExpectedDataLength, CAN_ReceiveW_MaxTimerCount, FH_CAN01_ReceiveBuf, FH_CAN01_ReceiveBufIndex, FH_ConvertUint8ToUint32(), FH_GlobalTimeCounter, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

◆ FH_CAN_ResetRB_CAN01()

FH_ErrorInfo FH_CAN_ResetRB_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function resets the ISR (Interrupt Service Routine) receive buffer index (FH_CAN01_ReceiveBufIndex) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user could left the present source code here intact.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
Returns
FH_ErrorInfo is returned
Note
FH user shall use FH_CAN01_ReceiveBuf and FH_CAN01_ReceiveBufIndex in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
In other word, FH_CAN01_ReceiveBuf array shall receive every byte of the received data there with FH_CAN01_ReceiveBufIndex as index of the array
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_ResetRB}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_ResetRB => It is the command of the function in the message frame
Warning
The only solution for resetting the receive buffer index (FH_CAN01_ReceiveBufIndex) is using FH_CAN_ResetRB_CAN01 function
In other words, FH_CAN01_ReceiveBufIndex may have been already increased if any data has been already received
So it is normally required to invoke FH_CAN_ResetRB_CAN01 through RobotFramework to reset the receive buffer index (FH_CAN01_ReceiveBufIndex) before invoking FH_CAN_Receive_CAN01 or FH_CAN_ReceiveW_CAN01 or ...

Definition at line 389 of file FH_CAN01.c.

References FH_CAN01_ReceiveBufIndex, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

◆ FH_CAN_Send_CAN01()

FH_ErrorInfo FH_CAN_Send_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function sends data through the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH user should call the send function of the interested CAN here.

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
Returns
FH_ErrorInfo is returned
Note
To have a clean code, just include the related header file
Then just call the function here
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}    02    B1     FF
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_Send}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  B1     FF => Example data (0xB1, 0xFF) to be sent (or apart from the data to be sent, it may include some other data like ID, Filter, ... to be processed too, if need be) through the <b>CAN 01</b>\n
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_Send => It is the command of the function in the message frame
Warning
To be able to send data through the CAN 01 of the micro-controller on which FH source code is ported, the FH_CAN_Init_CAN01 function shall be invoked once by RobotFramework firstly
In other words, before invoking FH_CAN_Send_CAN01 function from RobotFramework, FH_CAN_Init_CAN01 function shall be invoked in order to initialize the CAN

Definition at line 189 of file FH_CAN01.c.

References FH_ResetErrorInfo(), and fh_RFCommunication_Message.

Referenced by FH_CAN_Send_S().

◆ FH_CAN_SSD16_CAN01()

FH_ErrorInfo FH_CAN_SSD16_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function sets the shared data buffer (FH_CAN01_SharedDataBuf_16Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_16Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_16Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...

FH user could left the present source code here intact

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN01_SharedDataBuf_16Bits in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}    02    AA    BB    CC    DD
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_SSD16}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  02 => Example interested length of the 16 bit data to be set
  AA    BB    CC    DD => Example data (0xAABB and 0xCCDD) to be set in <b>FH_CAN01_SharedDataBuf_16Bits</b>
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_SSD16 => It is the command of the function in the message frame

Definition at line 495 of file FH_CAN01.c.

References CAN_SSD16_SharedData, CAN_SSD16_SharedDataLength, FH_ErrorInfo::error_code, FH_CAN01_SharedDataBuf_16Bits, FH_CAN01_SharedDataBufLength_16Bits, FH_ConvertUint8ToUint16(), FH_ERROR_Functions, FH_ERROR_OK, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

◆ FH_CAN_SSD32_CAN01()

FH_ErrorInfo FH_CAN_SSD32_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function sets the shared data buffer (FH_CAN01_SharedDataBuf_32Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_32Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_32Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...

FH user could left the present source code here intact

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN01_SharedDataBuf_32Bits in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}    02    AA    BB    CC    DD    01    02    03    04
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_SSD32}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  02 => Example interested length of the 32 bit data to be set
  AA    BB    CC    DD    01    02    03    04 => Example data (0xAABBCCDD and 0x01020304) to be set in <b>FH_CAN01_SharedDataBuf_32Bits</b>
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_SSD32 => It is the command of the function in the message frame

Definition at line 557 of file FH_CAN01.c.

References CAN_SSD32_SharedData, CAN_SSD32_SharedDataLength, FH_ErrorInfo::error_code, FH_CAN01_SharedDataBuf_32Bits, FH_CAN01_SharedDataBufLength_32Bits, FH_ConvertUint8ToUint32(), FH_ERROR_Functions, FH_ERROR_OK, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

◆ FH_CAN_SSD8_CAN01()

FH_ErrorInfo FH_CAN_SSD8_CAN01 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function sets the shared data buffer (FH_CAN01_SharedDataBuf_8Bits) of the CAN 01
The CAN 01 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN01_SharedDataBuf_8Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN01_SharedDataBuf_8Bits is optional
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 01 or ...

FH user could left the present source code here intact

Parameters
fh_RFCommunication_MessageThe message frame set by RobotFramework
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN01_SharedDataBuf_8Bits in the receive ISR (Interrupt Service Routine) of the CAN 01 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN01_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN01}    04    AA    BB    CC    DD
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_SSD8}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN01 => It indicates the CAN 01
  04 => Example interested length of the 8 bit data to be set
  AA    BB    CC    DD => Example data (0xAA, 0xBB, 0xCC, 0xDD) to be set in <b>FH_CAN01_SharedDataBuf_8Bits</b>
  DeviceAddress_01 => It shall be equal to the address of the device: FH_RFCommunication_DeviceAddress
  Function_CAN => It is the function in the message frame
  CAN_Commands_SSD8 => It is the command of the function in the message frame

Definition at line 437 of file FH_CAN01.c.

References CAN_SSD8_SharedData, CAN_SSD8_SharedDataLength, FH_ErrorInfo::error_code, FH_CAN01_SharedDataBuf_8Bits, FH_CAN01_SharedDataBufLength_8Bits, FH_ERROR_Functions, FH_ERROR_OK, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

Referenced by FH_CAN_SSD8_S().