include/objdictdef.h
changeset 71 95cd3376cc9f
parent 0 4472ee7c6c3e
child 161 c4908cc776a9
equal deleted inserted replaced
70:f36f09f08b62 71:95cd3376cc9f
    60 #define pdo_communication_parameter 0x20
    60 #define pdo_communication_parameter 0x20
    61 #define pdo_mapping                 0x21
    61 #define pdo_mapping                 0x21
    62 #define sdo_parameter               0x22
    62 #define sdo_parameter               0x22
    63 #define identity                    0x23
    63 #define identity                    0x23
    64 
    64 
    65 // CanFestival is using 0x24 to 0xFF to define some types containing a 
    65 /* CanFestival is using 0x24 to 0xFF to define some types containing a 
    66 // value range (See how it works in objdict.c)
    66  value range (See how it works in objdict.c)
       
    67  */
    67 
    68 
    68 
    69 
    69 
    70 
    70 /** definitions of the different types of PDOs' transmission
    71 /** definitions of the different types of PDOs' transmission
    71  * 
    72  * 
    92  *  of the object dictionary.
    93  *  of the object dictionary.
    93  */
    94  */
    94 typedef struct td_subindex
    95 typedef struct td_subindex
    95 {
    96 {
    96     UNS8                    bAccessType;
    97     UNS8                    bAccessType;
    97     UNS8                    bDataType; // Defines of what datatype the entry is
    98     UNS8                    bDataType; /* Defines of what datatype the entry is */
    98     UNS8                    size;      // The size (in Byte) of the variable
    99     UNS8                    size;      /* The size (in Byte) of the variable */
    99     void*                   pObject;   // This is the pointer of the Variable
   100     void*                   pObject;   /* This is the pointer of the Variable */
   100 } subindex;
   101 } subindex;
   101 
   102 
   102 /** Struct for creating entries in the communictaion profile
   103 /** Struct for creating entries in the communictaion profile
   103  */
   104  */
   104 typedef struct td_indextable
   105 typedef struct td_indextable
   105 {
   106 {
   106     subindex*   pSubindex;   // Pointer to the subindex
   107     subindex*   pSubindex;   /* Pointer to the subindex */
   107     UNS8   bSubCount;   // the count of valid entries for this subindex
   108     UNS8   bSubCount;   /* the count of valid entries for this subindex
   108                         // This count here defines how many memory has been
   109                          * This count here defines how many memory has been
   109                         // allocated. this memory does not have to be used.
   110                          * allocated. this memory does not have to be used.
       
   111                          */
   110     UNS16   index;
   112     UNS16   index;
   111 } indextable;
   113 } indextable;
   112 
   114 
   113 typedef struct s_quick_index{
   115 typedef struct s_quick_index{
   114 	UNS16 SDO_SVR;
   116 	UNS16 SDO_SVR;
   118 	UNS16 PDO_TRS;
   120 	UNS16 PDO_TRS;
   119 	UNS16 PDO_TRS_MAP;
   121 	UNS16 PDO_TRS_MAP;
   120 }quick_index;
   122 }quick_index;
   121 
   123 
   122 
   124 
   123 //typedef struct struct_CO_Data CO_Data;
   125 /*typedef struct struct_CO_Data CO_Data; */
   124 typedef UNS32 (*ODCallback_t)(CO_Data* d, const indextable *, UNS8 bSubindex);
   126 typedef UNS32 (*ODCallback_t)(CO_Data* d, const indextable *, UNS8 bSubindex);
   125 typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODCallback_t **Callback);
   127 typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODCallback_t **Callback);
   126 
   128 
   127 /************************** MACROS *********************************/
   129 /************************** MACROS *********************************/
   128 
   130 
   129 ///CANopen usefull helpers
   131 /* CANopen usefull helpers */
   130 #define GET_NODE_ID(m)         (m.cob_id.w & 0x7f)
   132 #define GET_NODE_ID(m)         (m.cob_id.w & 0x7f)
   131 #define GET_FUNCTION_CODE(m)     (m.cob_id.w >> 7)
   133 #define GET_FUNCTION_CODE(m)     (m.cob_id.w >> 7)
   132 
   134 
   133 #endif // __objdictdef_h__
   135 #endif /* __objdictdef_h__ */