CANopenNode

Files

file  CO_GFC.c
 CANopen Global fail-safe command protocol.
 
file  CO_GFC.h
 CANopen Global fail-safe command protocol.
 

Data Structures

struct  CO_GFC_t
 GFC object. More...
 

Functions

CO_ReturnError_t CO_GFC_init (CO_GFC_t *GFC, uint8_t *valid, CO_CANmodule_t *GFC_CANdevRx, uint16_t GFC_rxIdx, uint16_t CANidRxGFC, CO_CANmodule_t *GFC_CANdevTx, uint16_t GFC_txIdx, uint16_t CANidTxGFC)
 Initialize GFC object. More...
 
void CO_GFC_initCallbackEnterSafeState (CO_GFC_t *GFC, void *object, void(*pFunctSignalSafe)(void *object))
 Initialize GFC callback function. More...
 
CO_ReturnError_t CO_GFCsend (CO_GFC_t *GFC)
 Send GFC message. More...
 

Detailed Description

Global fail-safe command protocol.

Very simple consumer/producer protocol. A net can have multiple GFC producer and multiple GFC consumer. On a safety-relevant the producer can send a GFC message (ID 0, DLC 0). The consumer can use this message to start the transition to a safe state. The GFC is optional for the security protocol and is not monitored (timed).

Function Documentation

◆ CO_GFC_init()

CO_ReturnError_t CO_GFC_init ( CO_GFC_t GFC,
uint8_t valid,
CO_CANmodule_t GFC_CANdevRx,
uint16_t  GFC_rxIdx,
uint16_t  CANidRxGFC,
CO_CANmodule_t GFC_CANdevTx,
uint16_t  GFC_txIdx,
uint16_t  CANidTxGFC 
)

Initialize GFC object.

Function must be called in the communication reset section.

Parameters
GFCThis object will be initialized.
validpointer to the valid flag in OD (0x1300)
GFC_CANdevRxCAN device used for SRDO reception.
GFC_rxIdxIndex of receive buffer in the above CAN device.
CANidRxGFCGFC CAN ID for reception
GFC_CANdevTxAN device used for SRDO transmission.
GFC_txIdxIndex of transmit buffer in the above CAN device.
CANidTxGFCGFC CAN ID for transmission
Returns
CO_ReturnError_t: CO_ERROR_NO or CO_ERROR_ILLEGAL_ARGUMENT.

◆ CO_GFC_initCallbackEnterSafeState()

void CO_GFC_initCallbackEnterSafeState ( CO_GFC_t GFC,
void *  object,
void(*)(void *object)  pFunctSignalSafe 
)

Initialize GFC callback function.

Function initializes optional callback function, that is called when GFC is received. Callback is called from receive function (interrupt).

Parameters
GFCThis object.
objectPointer to object, which will be passed to pFunctSignalSafe(). Can be NULL
pFunctSignalSafePointer to the callback function. Not called if NULL.

◆ CO_GFCsend()

CO_ReturnError_t CO_GFCsend ( CO_GFC_t GFC)

Send GFC message.

It should be called by application, for example after a safety-relevant change.

Parameters
GFCGFC object.
Returns
Same as CO_CANsend().