CanOpenMatic.h File Reference

#include "pkgconf/communicationservices.h"
#include "ApparatusFramework/CommunicationServices/CanOpen/Can.h"

Go to the source code of this file.

Classes

struct  s_proc_info
struct  struct_s_SDO
struct  struct_s_PDO
struct  struct_s_transfer
struct  struct_s_process_var

Defines

#define packed
#define ALL_SET(state, mask)   ((~state & mask)? 0 /* there was a bad bit */ : 1 /* all are good*/ )
#define Rx   0
#define Tx   1
#define MAX_CAN_BUS_ID   BBVINT_COMMUNICATIONSERVICES_CANOPEN_MAX_CAN_BUS_ID
#define SDO_MAX_NODE_ID   BBVINT_COMMUNICATIONSERVICES_CANOPEN_SDO_MAX_NODE_ID
#define SDO_MAX_DOMAIN_LEN   32
#define PDO_MAX_LEN   8
#define PDO_MAX_NODE_ID   BBVINT_COMMUNICATIONSERVICES_CANOPEN_PDO_MAX_NODE_ID
#define NMT_MAX_NODE_ID   BBVINT_COMMUNICATIONSERVICES_CANOPEN_NMT_MAX_NODE_ID
#define GET_NODE_ID(m)   (m.id.w & 0x7f)
#define GET_FUNCTION_CODE(m)   (m.id.w >> 7)
#define NMT   0x0
#define SYNC   0x1
#define TIME_STAMP   0x2
#define PDO1tx   0x3
#define PDO1rx   0x4
#define PDO2tx   0x5
#define PDO2rx   0x6
#define PDO3tx   0x7
#define PDO3rx   0x8
#define PDO4tx   0x9
#define PDO4rx   0xA
#define SDOtx   0xB
#define SDOrx   0xC
#define NODE_GUARD   0xE
#define PDOnrx   0x4
#define PDOntx   0x3
#define IDD_client(n, e, s)   (0x20 | ((n & 0x03) << 2) | ((e & 0x01) << 1) | (s & 0x01))
#define DDS_client(t, n, c)   (0x00 | ((t & 0x01) << 4) | ((n & 0x07) << 1) | (c & 0x01))
#define IDU_client   0x40
#define UDS_client(t)   (0x60 | ((t & 0x01) << 4))
#define IDD_server   0x60
#define DDS_server   0x20
#define IDU_server   0x40
#define IDU_server_params(cs, n, e, s)   n = (cs & 0x0c) >> 2; e = (cs & 0x02) >> 1; s = cs & 0x01;
#define UDS_server   0x00
#define UDS_server_params(cs, t, n, c)   t = (cs & 0x10) >> 4; n = (cs & 0x0e) >> 1; c = cs & 0x01;
#define IS_SEGMENTED_RESPONSE(SCS)   !(SCS & 0x40)
#define IS_DOWNLOAD_RESPONSE(SCS)   (SCS & 0x20)
#define ADT_server   0x80
#define NMT_Start_Node   0x01
#define NMT_Stop_Node   0x02
#define NMT_Enter_PreOperational   0x80
#define NMT_Reset_Node   0x81
#define NMT_Reset_Comunication   0x82
#define S_TRANSFER_INITIALIZER   {0,0,0,0,0,{[0 ... SDO_MAX_DOMAIN_LEN - 1] = 0}}
#define S_PROCESS_VAR_INITIALIZER   {0,0,{[0 ... PDO_MAX_LEN - 1] = 0}}
#define NOW   1
#define LATER   0
#define TS_ACTIVITY(state)   (state & 0x03)
#define TS_IS_ON(state)   (state & 0x01)
#define TS_SET_ACTIVITY(state, activity)   state = ((state & ~0x03) | activity);
#define TS_INACTIV   0x00
#define TS_ACTIVATED   0x01
#define TS_WORKING   0x03
#define TS_ERROR   0x02
#define TS_IS_DOWNLOAD(state)   !(state & 0x04)
#define TS_FREE   0x00
#define TS_DOWNLOAD   0x01
#define TS_DOWNLOADING   0x02
#define TS_FINISHED   0x04
#define TS_UPLOAD   0x05
#define TS_UPLOADING   0x06
#define TS_WAIT_SERVER   0x08
#define TS_HAVE_TO_DO(state)   !(state & 0x08)
#define TS_TOGGLE   0x10

Typedefs

typedef int(* FunctionPtr )(int, Message *, const struct s_proc_info *, int)
typedef struct s_proc_info proceed_info
typedef struct struct_s_SDO s_SDO
typedef struct struct_s_PDO s_PDO
typedef struct struct_s_transfer s_transfer
typedef struct struct_s_process_var s_process_var

Functions

int Send_NODE_GUARD (int, int)
int Send_PDO (int, s_PDO, int)
int Send_SDO (int, s_SDO, int)
int Send_Sync (int)
int Send_NMT (int, int, char)
int ReadDictionaryEntry (int, int, unsigned short, char, char *)
int ReadNodeState (int, int)
int Message_Handler (int)
int Flux_MGR (int, int)
int ProceedSDO (int, Message *, const proceed_info *, int)
int Process_MGR (int, int)
int ProceedPDO (int, Message *, const proceed_info *, int)
int ProceedNODE_GUARD (int, Message *, const proceed_info *, int)
int WriteProcessVar (int, int, int, unsigned int, char *)
int DownloadProcessVars (int)
int ReadProcessVar (int, int, char *)
int WriteDictionaryEntry (int, int, unsigned short, char, unsigned int, void *)

Variables

struct struct_s_SDO packed

Define Documentation

#define ADT_server   0x80

Definition at line 139 of file CanOpenMatic.h.

#define ALL_SET ( state,
mask   )     ((~state & mask)? 0 /* there was a bad bit */ : 1 /* all are good*/ )

Definition at line 63 of file CanOpenMatic.h.

#define DDS_client ( t,
n,
 )     (0x00 | ((t & 0x01) << 4) | ((n & 0x07) << 1) | (c & 0x01))

Definition at line 118 of file CanOpenMatic.h.

#define DDS_server   0x20

Definition at line 127 of file CanOpenMatic.h.

#define GET_FUNCTION_CODE (  )     (m.id.w >> 7)

Definition at line 82 of file CanOpenMatic.h.

#define GET_NODE_ID (  )     (m.id.w & 0x7f)

Definition at line 81 of file CanOpenMatic.h.

#define IDD_client ( n,
e,
 )     (0x20 | ((n & 0x03) << 2) | ((e & 0x01) << 1) | (s & 0x01))

Definition at line 116 of file CanOpenMatic.h.

#define IDD_server   0x60

Definition at line 125 of file CanOpenMatic.h.

#define IDU_client   0x40

Definition at line 120 of file CanOpenMatic.h.

#define IDU_server   0x40

Definition at line 129 of file CanOpenMatic.h.

#define IDU_server_params ( cs,
n,
e,
 )     n = (cs & 0x0c) >> 2; e = (cs & 0x02) >> 1; s = cs & 0x01;

Definition at line 130 of file CanOpenMatic.h.

#define IS_DOWNLOAD_RESPONSE ( SCS   )     (SCS & 0x20)

Definition at line 136 of file CanOpenMatic.h.

#define IS_SEGMENTED_RESPONSE ( SCS   )     !(SCS & 0x40)

Definition at line 135 of file CanOpenMatic.h.

#define LATER   0

Definition at line 209 of file CanOpenMatic.h.

#define MAX_CAN_BUS_ID   BBVINT_COMMUNICATIONSERVICES_CANOPEN_MAX_CAN_BUS_ID

Definition at line 69 of file CanOpenMatic.h.

#define NMT   0x0

Definition at line 85 of file CanOpenMatic.h.

#define NMT_Enter_PreOperational   0x80

Definition at line 146 of file CanOpenMatic.h.

#define NMT_MAX_NODE_ID   BBVINT_COMMUNICATIONSERVICES_CANOPEN_NMT_MAX_NODE_ID

Definition at line 78 of file CanOpenMatic.h.

#define NMT_Reset_Comunication   0x82

Definition at line 148 of file CanOpenMatic.h.

#define NMT_Reset_Node   0x81

Definition at line 147 of file CanOpenMatic.h.

#define NMT_Start_Node   0x01

Definition at line 144 of file CanOpenMatic.h.

#define NMT_Stop_Node   0x02

Definition at line 145 of file CanOpenMatic.h.

#define NODE_GUARD   0xE

Definition at line 98 of file CanOpenMatic.h.

#define NOW   1

Definition at line 208 of file CanOpenMatic.h.

#define packed

Definition at line 51 of file CanOpenMatic.h.

#define PDO1rx   0x4

Definition at line 89 of file CanOpenMatic.h.

#define PDO1tx   0x3

Definition at line 88 of file CanOpenMatic.h.

#define PDO2rx   0x6

Definition at line 91 of file CanOpenMatic.h.

#define PDO2tx   0x5

Definition at line 90 of file CanOpenMatic.h.

#define PDO3rx   0x8

Definition at line 93 of file CanOpenMatic.h.

#define PDO3tx   0x7

Definition at line 92 of file CanOpenMatic.h.

#define PDO4rx   0xA

Definition at line 95 of file CanOpenMatic.h.

#define PDO4tx   0x9

Definition at line 94 of file CanOpenMatic.h.

#define PDO_MAX_LEN   8

Definition at line 73 of file CanOpenMatic.h.

#define PDO_MAX_NODE_ID   BBVINT_COMMUNICATIONSERVICES_CANOPEN_PDO_MAX_NODE_ID

Definition at line 76 of file CanOpenMatic.h.

#define PDOnrx   0x4

Definition at line 101 of file CanOpenMatic.h.

#define PDOntx   0x3

Definition at line 102 of file CanOpenMatic.h.

#define Rx   0

Definition at line 65 of file CanOpenMatic.h.

#define S_PROCESS_VAR_INITIALIZER   {0,0,{[0 ... PDO_MAX_LEN - 1] = 0}}

Definition at line 205 of file CanOpenMatic.h.

#define S_TRANSFER_INITIALIZER   {0,0,0,0,0,{[0 ... SDO_MAX_DOMAIN_LEN - 1] = 0}}

Definition at line 193 of file CanOpenMatic.h.

#define SDO_MAX_DOMAIN_LEN   32

Definition at line 72 of file CanOpenMatic.h.

#define SDO_MAX_NODE_ID   BBVINT_COMMUNICATIONSERVICES_CANOPEN_SDO_MAX_NODE_ID

Definition at line 70 of file CanOpenMatic.h.

#define SDOrx   0xC

Definition at line 97 of file CanOpenMatic.h.

#define SDOtx   0xB

Definition at line 96 of file CanOpenMatic.h.

#define SYNC   0x1

Definition at line 86 of file CanOpenMatic.h.

#define TIME_STAMP   0x2

Definition at line 87 of file CanOpenMatic.h.

#define TS_ACTIVATED   0x01

Definition at line 217 of file CanOpenMatic.h.

#define TS_ACTIVITY ( state   )     (state & 0x03)

Definition at line 213 of file CanOpenMatic.h.

#define TS_DOWNLOAD   0x01

Definition at line 223 of file CanOpenMatic.h.

#define TS_DOWNLOADING   0x02

Definition at line 224 of file CanOpenMatic.h.

#define TS_ERROR   0x02

Definition at line 219 of file CanOpenMatic.h.

#define TS_FINISHED   0x04

Definition at line 225 of file CanOpenMatic.h.

#define TS_FREE   0x00

Definition at line 222 of file CanOpenMatic.h.

#define TS_HAVE_TO_DO ( state   )     !(state & 0x08)

Definition at line 230 of file CanOpenMatic.h.

#define TS_INACTIV   0x00

Definition at line 216 of file CanOpenMatic.h.

#define TS_IS_DOWNLOAD ( state   )     !(state & 0x04)

Definition at line 221 of file CanOpenMatic.h.

#define TS_IS_ON ( state   )     (state & 0x01)

Definition at line 214 of file CanOpenMatic.h.

#define TS_SET_ACTIVITY ( state,
activity   )     state = ((state & ~0x03) | activity);

Definition at line 215 of file CanOpenMatic.h.

#define TS_TOGGLE   0x10

Definition at line 231 of file CanOpenMatic.h.

#define TS_UPLOAD   0x05

Definition at line 226 of file CanOpenMatic.h.

#define TS_UPLOADING   0x06

Definition at line 227 of file CanOpenMatic.h.

#define TS_WAIT_SERVER   0x08

Definition at line 229 of file CanOpenMatic.h.

#define TS_WORKING   0x03

Definition at line 218 of file CanOpenMatic.h.

#define Tx   1

Definition at line 66 of file CanOpenMatic.h.

#define UDS_client (  )     (0x60 | ((t & 0x01) << 4))

Definition at line 122 of file CanOpenMatic.h.

#define UDS_server   0x00

Definition at line 132 of file CanOpenMatic.h.

#define UDS_server_params ( cs,
t,
n,
 )     t = (cs & 0x10) >> 4; n = (cs & 0x0e) >> 1; c = cs & 0x01;

Definition at line 133 of file CanOpenMatic.h.


Typedef Documentation

typedef int(* FunctionPtr)(int, Message *, const struct s_proc_info *, int)

Definition at line 104 of file CanOpenMatic.h.

typedef struct s_proc_info proceed_info
typedef struct struct_s_PDO s_PDO

Definition at line 178 of file CanOpenMatic.h.

Definition at line 203 of file CanOpenMatic.h.

typedef struct struct_s_SDO s_SDO

Definition at line 169 of file CanOpenMatic.h.

typedef struct struct_s_transfer s_transfer

Definition at line 191 of file CanOpenMatic.h.


Function Documentation

int DownloadProcessVars ( int   ) 
int Flux_MGR ( int  ,
int   
)
int Message_Handler ( int   ) 
int ProceedNODE_GUARD ( int  ,
Message ,
const proceed_info ,
int   
)
int ProceedPDO ( int  ,
Message ,
const proceed_info ,
int   
)
int ProceedSDO ( int  ,
Message ,
const proceed_info ,
int   
)
int Process_MGR ( int  ,
int   
)
int ReadDictionaryEntry ( int  ,
int  ,
unsigned  short,
char  ,
char *   
)
int ReadNodeState ( int  ,
int   
)
int ReadProcessVar ( int  ,
int  ,
char *   
)
int Send_NMT ( int  ,
int  ,
char   
)
int Send_NODE_GUARD ( int  ,
int   
)
int Send_PDO ( int  ,
s_PDO  ,
int   
)
int Send_SDO ( int  ,
s_SDO  ,
int   
)
int Send_Sync ( int   ) 
int WriteDictionaryEntry ( int  ,
int  ,
unsigned  short,
char  ,
unsigned  int,
void *   
)
int WriteProcessVar ( int  ,
int  ,
int  ,
unsigned  int,
char *   
)

Variable Documentation

© 2004-2010 bbv Software Services AG / Apparatus Services