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

File Map:
FH_Functions, Section FH_CAN (CAN), Peripheral FH_CAN03 (CAN 03)
(The CAN03 (CAN 03) 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_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function initializes the CAN 03
The CAN 03 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_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function sends data through the CAN 03
The CAN 03 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_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *DataSize, uint8_t *Data)
 This function retrieves the ISR (Interrupt Service Routine) receive buffer (FH_CAN03_ReceiveBuf) of the CAN 03
The CAN 03 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_CAN03 (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_CAN03_ReceiveBuf) of the CAN 03
A maximum timeout is specified too
The CAN 03 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_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function resets the ISR (Interrupt Service Routine) receive buffer index (FH_CAN03_ReceiveBufIndex) of the CAN 03
The CAN 03 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_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function sets the shared data buffer (FH_CAN03_SharedDataBuf_8Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_8Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 or ...
FH_ErrorInfo FH_CAN_SSD16_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function sets the shared data buffer (FH_CAN03_SharedDataBuf_16Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_16Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 or ...
FH_ErrorInfo FH_CAN_SSD32_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message)
 This function sets the shared data buffer (FH_CAN03_SharedDataBuf_32Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_32Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 or ...
FH_ErrorInfo FH_CAN_GSD8_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *SharedDataLength, uint8_t *SharedData)
 This function gets the shared data buffer (FH_CAN03_SharedDataBuf_8Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_8Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 or ...
FH_ErrorInfo FH_CAN_GSD16_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *SharedDataLength, uint8_t *SharedData)
 This function gets the shared data buffer (FH_CAN03_SharedDataBuf_16Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_16Bits is a shared global 16 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 or ...
FH_ErrorInfo FH_CAN_GSD32_CAN03 (FH_RFCommunication_Message *fh_RFCommunication_Message, uint8_t *SharedDataLength, uint8_t *SharedData)
 This function gets the shared data buffer (FH_CAN03_SharedDataBuf_32Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_32Bits is a shared global 32 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 or ...

Variables

volatile uint8_t FH_CAN03_ReceiveBuf [FH_CAN03_ReceiveBufLength]
volatile uint16_t FH_CAN03_ReceiveBufIndex = 0
volatile uint8_t FH_CAN03_SharedDataBuf_8Bits [FH_CAN03_SharedDataBufLength_8Bits]
volatile uint16_t FH_CAN03_SharedDataBuf_16Bits [FH_CAN03_SharedDataBufLength_16Bits]
volatile uint32_t FH_CAN03_SharedDataBuf_32Bits [FH_CAN03_SharedDataBufLength_32Bits]

Detailed Description

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

Note
To have a clean code, FH user should have the implementation of the initialization and send functions of the CAN 03 in a separate c file
Then FH user should include the header file (.h) of the related source file (.c) here
This header file shall include the following items:
The declaration of the initialization function of the CAN 03
The declaration of the send function of the CAN 03

FH user shall use FH_CAN03_ReceiveBuf and FH_CAN03_ReceiveBufIndex in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
In other word, FH_CAN03_ReceiveBuf array shall receive every byte of the received data there with FH_CAN03_ReceiveBufIndex as index of the array

FH_CAN03_SharedDataBuf_8Bits, FH_CAN03_SharedDataBuf_16Bits and FH_CAN03_SharedDataBuf_32Bits are optional and could be left intact
They could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 03 , ...
They are controllable with some commands (described in this file) through RobotFramework

Attention
There are a total number of 3 attentions (FH user defined code) in this file where FH user shall insert some code
Other parts could be left 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_CAN03.c.

Function Documentation

◆ FH_CAN_GSD16_CAN03()

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

This function gets the shared data buffer (FH_CAN03_SharedDataBuf_16Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_16Bits is a shared global 16 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 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_CAN03_SharedDataBufLength_16Bits
SharedData*SharedData will be set to FH_CAN03_SharedDataBuf_16Bits
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN03_SharedDataBuf_16Bits in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_GSD16}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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_CAN03.c.

References FH_Uint8Uint16::bytes, FH_ErrorInfo::error_code, FH_CAN03_SharedDataBuf_16Bits, FH_CAN03_SharedDataBufLength_16Bits, FH_ERROR_OK, FH_ResetErrorInfo(), fh_RFCommunication_Message, and FH_Uint8Uint16::value.

◆ FH_CAN_GSD32_CAN03()

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

This function gets the shared data buffer (FH_CAN03_SharedDataBuf_32Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_32Bits is a shared global 32 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 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_CAN03_SharedDataBufLength_32Bits
SharedData*SharedData will be set to FH_CAN03_SharedDataBuf_32Bits
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN03_SharedDataBuf_32Bits in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_GSD32}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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_CAN03.c.

References FH_Uint8Uint32::bytes, FH_ErrorInfo::error_code, FH_CAN03_SharedDataBuf_32Bits, FH_CAN03_SharedDataBufLength_32Bits, FH_ERROR_OK, FH_ResetErrorInfo(), fh_RFCommunication_Message, and FH_Uint8Uint32::value.

◆ FH_CAN_GSD8_CAN03()

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

This function gets the shared data buffer (FH_CAN03_SharedDataBuf_8Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_8Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 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_CAN03_SharedDataBufLength_8Bits
SharedData*SharedData will be set to FH_CAN03_SharedDataBuf_8Bits
Returns
FH_ErrorInfo is returned
Note
FH user could use FH_CAN03_SharedDataBuf_8Bits in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_GSD8}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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_CAN03.c.

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

Referenced by FH_CAN_GSD8_S().

◆ FH_CAN_Init_CAN03()

FH_ErrorInfo FH_CAN_Init_CAN03 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function initializes the CAN 03
The CAN 03 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    ${CAN03}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_Init}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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 03 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_CAN03 or FH_CAN_Receive_CAN03 functions or ... from RobotFramework, this function shall be invoked in order to initialize the CAN

Definition at line 137 of file FH_CAN03.c.

References FH_ResetErrorInfo(), and fh_RFCommunication_Message.

Referenced by FH_CAN_Init_S().

◆ FH_CAN_Receive_CAN03()

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

This function retrieves the ISR (Interrupt Service Routine) receive buffer (FH_CAN03_ReceiveBuf) of the CAN 03
The CAN 03 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_CAN03_ReceiveBufIndex) of the CAN 03
Data*Data will be set to the ISR (Interrupt Service Routine) receive buffer (FH_CAN03_ReceiveBuf) of the CAN 03
Returns
FH_ErrorInfo is returned
Note
FH user shall use FH_CAN03_ReceiveBuf and FH_CAN03_ReceiveBufIndex in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
In other word, FH_CAN03_ReceiveBuf array shall receive every byte of the received data there with FH_CAN03_ReceiveBufIndex as index of the array
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_Receive}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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 03 of the micro-controller on which FH source code is ported, the FH_CAN_Init_CAN03 function shall be invoked once by RobotFramework firstly
In other words, before invoking FH_CAN_Receive_CAN03 function from RobotFramework, FH_CAN_Init_CAN03 function shall be invoked in order to initialize the CAN
Note
The only solution for resetting the receive buffer index (FH_CAN03_ReceiveBufIndex) is using FH_CAN_ResetRB_CAN03 function
In other words, FH_CAN03_ReceiveBufIndex may have been already increased if any data has been already received
So it is normally required to invoke FH_CAN_ResetRB_CAN03 through RobotFramework to reset the receive buffer index (FH_CAN03_ReceiveBufIndex) before invoking FH_CAN_Receive_CAN03

Definition at line 251 of file FH_CAN03.c.

References FH_CAN03_ReceiveBuf, FH_CAN03_ReceiveBufIndex, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

◆ FH_CAN_ReceiveW_CAN03()

FH_ErrorInfo FH_CAN_ReceiveW_CAN03 ( 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_CAN03_ReceiveBuf) of the CAN 03
A maximum timeout is specified too
The CAN 03 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_CAN03_ReceiveBufIndex) of the CAN 03
Data*Data will be set to the ISR (Interrupt Service Routine) receive buffer (FH_CAN03_ReceiveBuf) of the CAN 03
Returns
FH_ErrorInfo is returned
Note
FH user shall use FH_CAN03_ReceiveBuf and FH_CAN03_ReceiveBufIndex in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
In other word, FH_CAN03_ReceiveBuf array shall receive every byte of the received data there with FH_CAN03_ReceiveBufIndex as index of the array
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}    05    00    00    0B    B8
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_ReceiveW}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  05 => The expected number of bytes of data to be received through the <b>ISR</b> (Interrupt Service Routine) receive buffer (FH_CAN03_ReceiveBuf) of the <b>CAN 03</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 03 of the micro-controller on which FH source code is ported, the FH_CAN_Init_CAN03 function shall be invoked once by RobotFramework firstly
In other words, before invoking FH_CAN_ReceiveW_CAN03 function from RobotFramework, FH_CAN_Init_CAN03 function shall be invoked in order to initialize the CAN
Note
The only solution for resetting the receive buffer index (FH_CAN03_ReceiveBufIndex) is using FH_CAN_ResetRB_CAN03 function
In other words, FH_CAN03_ReceiveBufIndex may have been already increased if any data has been already received
So it is normally required to invoke FH_CAN_ResetRB_CAN03 through RobotFramework to reset the receive buffer index (FH_CAN03_ReceiveBufIndex) before invoking FH_CAN_ReceiveW_CAN03

Definition at line 322 of file FH_CAN03.c.

References CAN_ReceiveW_ExpectedDataLength, CAN_ReceiveW_MaxTimerCount, FH_CAN03_ReceiveBuf, FH_CAN03_ReceiveBufIndex, FH_ConvertUint8ToUint32(), FH_GlobalTimeCounter, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

◆ FH_CAN_ResetRB_CAN03()

FH_ErrorInfo FH_CAN_ResetRB_CAN03 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function resets the ISR (Interrupt Service Routine) receive buffer index (FH_CAN03_ReceiveBufIndex) of the CAN 03
The CAN 03 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_CAN03_ReceiveBuf and FH_CAN03_ReceiveBufIndex in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
In other word, FH_CAN03_ReceiveBuf array shall receive every byte of the received data there with FH_CAN03_ReceiveBufIndex as index of the array
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_ResetRB}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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_CAN03_ReceiveBufIndex) is using FH_CAN_ResetRB_CAN03 function
In other words, FH_CAN03_ReceiveBufIndex may have been already increased if any data has been already received
So it is normally required to invoke FH_CAN_ResetRB_CAN03 through RobotFramework to reset the receive buffer index (FH_CAN03_ReceiveBufIndex) before invoking FH_CAN_Receive_CAN03 or FH_CAN_ReceiveW_CAN03 or ...

Definition at line 389 of file FH_CAN03.c.

References FH_CAN03_ReceiveBufIndex, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

◆ FH_CAN_Send_CAN03()

FH_ErrorInfo FH_CAN_Send_CAN03 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function sends data through the CAN 03
The CAN 03 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    ${CAN03}    02    B1     FF
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_Send}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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 03</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 03 of the micro-controller on which FH source code is ported, the FH_CAN_Init_CAN03 function shall be invoked once by RobotFramework firstly
In other words, before invoking FH_CAN_Send_CAN03 function from RobotFramework, FH_CAN_Init_CAN03 function shall be invoked in order to initialize the CAN

Definition at line 189 of file FH_CAN03.c.

References FH_ResetErrorInfo(), and fh_RFCommunication_Message.

Referenced by FH_CAN_Send_S().

◆ FH_CAN_SSD16_CAN03()

FH_ErrorInfo FH_CAN_SSD16_CAN03 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function sets the shared data buffer (FH_CAN03_SharedDataBuf_16Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_16Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 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_CAN03_SharedDataBuf_16Bits in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}    02    AA    BB    CC    DD
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_SSD16}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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_CAN03_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_CAN03.c.

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

◆ FH_CAN_SSD32_CAN03()

FH_ErrorInfo FH_CAN_SSD32_CAN03 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function sets the shared data buffer (FH_CAN03_SharedDataBuf_32Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_32Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 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_CAN03_SharedDataBuf_32Bits in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}    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:

  CAN03 => It indicates the CAN 03
  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_CAN03_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_CAN03.c.

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

◆ FH_CAN_SSD8_CAN03()

FH_ErrorInfo FH_CAN_SSD8_CAN03 ( FH_RFCommunication_Message * fh_RFCommunication_Message)

This function sets the shared data buffer (FH_CAN03_SharedDataBuf_8Bits) of the CAN 03
The CAN 03 could be any interested CAN of the micro-controller on which FH source code is ported
FH_CAN03_SharedDataBuf_8Bits is a shared global 8 bit array which is a data bridge between RobotFramework and FH user code
FH_CAN03_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 03 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_CAN03_SharedDataBuf_8Bits in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file or anywhere else interested
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
  ==============================================================================
                        ##### RobotFramework Example #####
  ==============================================================================
  @{MessageData} =    Create List    ${CAN03}    04    AA    BB    CC    DD
  &{Message}     =    Create Dictionary    DeviceAddress=${DeviceAddress_01}    Function=${Function_CAN}    Command=${CAN_Commands_SSD8}    Data=@{MessageData}
  ${Result}    SendMessage    &{Message}

  Comments:

  CAN03 => It indicates the CAN 03
  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_CAN03_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_CAN03.c.

References CAN_SSD8_SharedData, CAN_SSD8_SharedDataLength, FH_ErrorInfo::error_code, FH_CAN03_SharedDataBuf_8Bits, FH_CAN03_SharedDataBufLength_8Bits, FH_ERROR_Functions, FH_ERROR_OK, FH_ResetErrorInfo(), and fh_RFCommunication_Message.

Referenced by FH_CAN_SSD8_S().

Variable Documentation

◆ FH_CAN03_ReceiveBuf

volatile uint8_t FH_CAN03_ReceiveBuf[FH_CAN03_ReceiveBufLength]

FH user shall use FH_CAN03_ReceiveBuf in the receive ISR (Interrupt Service Routine) of the CAN 03 in a separate c file
For this to happen, FH user shall just include FH_CAN03_GlobalVariables.h there
In other word, FH_CAN03_ReceiveBuf array shall receive every byte of the received data there
It is configurable in FH_CAN03_Configs.h

Definition at line 70 of file FH_CAN03.c.

Referenced by FH_CAN_Receive_CAN03(), and FH_CAN_ReceiveW_CAN03().

◆ FH_CAN03_ReceiveBufIndex

volatile uint16_t FH_CAN03_ReceiveBufIndex = 0

FH_CAN03_ReceiveBufIndex is the index of FH_CAN03_ReceiveBuf

Definition at line 75 of file FH_CAN03.c.

Referenced by FH_CAN_Receive_CAN03(), FH_CAN_ReceiveW_CAN03(), and FH_CAN_ResetRB_CAN03().

◆ FH_CAN03_SharedDataBuf_16Bits

volatile uint16_t FH_CAN03_SharedDataBuf_16Bits[FH_CAN03_SharedDataBufLength_16Bits]

FH_CAN03_SharedDataBuf_16Bits is optional and could be left intact
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 03 , ... It are controllable with some commands (described in this file) through RobotFramework
It is configurable in FH_CAN03_Configs.h

Definition at line 91 of file FH_CAN03.c.

Referenced by FH_CAN_GSD16_CAN03(), and FH_CAN_SSD16_CAN03().

◆ FH_CAN03_SharedDataBuf_32Bits

volatile uint32_t FH_CAN03_SharedDataBuf_32Bits[FH_CAN03_SharedDataBufLength_32Bits]

FH_CAN03_SharedDataBuf_32Bits is optional and could be left intact
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 03 , ... It are controllable with some commands (described in this file) through RobotFramework
It is configurable in FH_CAN03_Configs.h

Definition at line 98 of file FH_CAN03.c.

Referenced by FH_CAN_GSD32_CAN03(), and FH_CAN_SSD32_CAN03().

◆ FH_CAN03_SharedDataBuf_8Bits

volatile uint8_t FH_CAN03_SharedDataBuf_8Bits[FH_CAN03_SharedDataBufLength_8Bits]

FH_CAN03_SharedDataBuf_8Bits is optional and could be left intact
It could be used by FH user to set some special data like receive filters on ISR (Interrupt Service Routine) of the CAN 03 , ... It are controllable with some commands (described in this file) through RobotFramework
It is configurable in FH_CAN03_Configs.h

Definition at line 83 of file FH_CAN03.c.

Referenced by FH_CAN_GSD8_CAN03(), and FH_CAN_SSD8_CAN03().