include/data.h
changeset 235 f812bf6b7237
parent 204 44ce74232ccb
child 251 cab66ef3e68e
equal deleted inserted replaced
234:5a17bcb520ef 235:f812bf6b7237
    44 /* This structurs contains all necessary information for a CanOpen node */
    44 /* This structurs contains all necessary information for a CanOpen node */
    45 struct struct_CO_Data {
    45 struct struct_CO_Data {
    46 	/* Object dictionary */
    46 	/* Object dictionary */
    47 	UNS8 *bDeviceNodeId;
    47 	UNS8 *bDeviceNodeId;
    48 	const indextable *objdict;
    48 	const indextable *objdict;
    49 	UNS8 *count_sync;
    49 	s_PDO_status *PDO_status;
    50 	quick_index *firstIndex;
    50 	quick_index *firstIndex;
    51 	quick_index *lastIndex;
    51 	quick_index *lastIndex;
    52 	UNS16 *ObjdictSize;
    52 	UNS16 *ObjdictSize;
    53 	const UNS8 *iam_a_slave;
    53 	const UNS8 *iam_a_slave;
    54 	valueRangeTest_t valueRangeTest;
    54 	valueRangeTest_t valueRangeTest;
    79 	UNS32 *COB_ID_Sync;
    79 	UNS32 *COB_ID_Sync;
    80 	UNS32 *Sync_Cycle_Period;
    80 	UNS32 *Sync_Cycle_Period;
    81 	/*UNS32 *Sync_window_length;;*/
    81 	/*UNS32 *Sync_window_length;;*/
    82 	post_sync_t post_sync;
    82 	post_sync_t post_sync;
    83 	post_TPDO_t post_TPDO;
    83 	post_TPDO_t post_TPDO;
    84 	
       
    85 	/* PDO */
       
    86 	s_process_var process_var;
       
    87 	
    84 	
    88 	/* General */
    85 	/* General */
    89 	UNS8 toggle;
    86 	UNS8 toggle;
    90 	CAN_HANDLE canHandle;	
    87 	CAN_HANDLE canHandle;	
    91 	scanIndexOD_t scanIndexOD;
    88 	scanIndexOD_t scanIndexOD;
   119 /* CO_Data structure */
   116 /* CO_Data structure */
   120 #define CANOPEN_NODE_DATA_INITIALIZER(NODE_PREFIX) {\
   117 #define CANOPEN_NODE_DATA_INITIALIZER(NODE_PREFIX) {\
   121 	/* Object dictionary*/\
   118 	/* Object dictionary*/\
   122 	& NODE_PREFIX ## _bDeviceNodeId,     /* bDeviceNodeId */\
   119 	& NODE_PREFIX ## _bDeviceNodeId,     /* bDeviceNodeId */\
   123 	NODE_PREFIX ## _objdict,             /* objdict  */\
   120 	NODE_PREFIX ## _objdict,             /* objdict  */\
   124 	NODE_PREFIX ## _count_sync,          /* count_sync */\
   121 	NODE_PREFIX ## _PDO_status,          /* PDO_status */\
   125 	& NODE_PREFIX ## _firstIndex,        /* firstIndex */\
   122 	& NODE_PREFIX ## _firstIndex,        /* firstIndex */\
   126 	& NODE_PREFIX ## _lastIndex,         /* lastIndex */\
   123 	& NODE_PREFIX ## _lastIndex,         /* lastIndex */\
   127 	& NODE_PREFIX ## _ObjdictSize,       /* ObjdictSize */\
   124 	& NODE_PREFIX ## _ObjdictSize,       /* ObjdictSize */\
   128 	& NODE_PREFIX ## _iam_a_slave,       /* iam_a_slave */\
   125 	& NODE_PREFIX ## _iam_a_slave,       /* iam_a_slave */\
   129 	NODE_PREFIX ## _valueRangeTest,      /* valueRangeTest */\
   126 	NODE_PREFIX ## _valueRangeTest,      /* valueRangeTest */\
   166 	& NODE_PREFIX ## _obj1006,                 /* Sync_Cycle_Period */\
   163 	& NODE_PREFIX ## _obj1006,                 /* Sync_Cycle_Period */\
   167 	/*& NODE_PREFIX ## _obj1007, */            /* Sync_window_length */\
   164 	/*& NODE_PREFIX ## _obj1007, */            /* Sync_window_length */\
   168 	_post_sync,                 /* post_sync */\
   165 	_post_sync,                 /* post_sync */\
   169 	_post_TPDO,                 /* post_TPDO */\
   166 	_post_TPDO,                 /* post_TPDO */\
   170 	\
   167 	\
   171 	/* PDO, structure s_process_var */\
       
   172         {\
       
   173 		0,          /* count */\
       
   174 		{0}         /* data (static use, so that all the table is initialize at 0)*/\
       
   175         },\
       
   176         \
       
   177 	/* General */\
   168 	/* General */\
   178 	0,                                         /* toggle */\
   169 	0,                                         /* toggle */\
   179 	NULL,                   /* canSend */\
   170 	NULL,                   /* canSend */\
   180 	NODE_PREFIX ## _scanIndexOD,                /* scanIndexOD */\
   171 	NODE_PREFIX ## _scanIndexOD,                /* scanIndexOD */\
   181 	_storeODSubIndex,                /* storeODSubIndex */\
   172 	_storeODSubIndex,                /* storeODSubIndex */\