EtherCAT slave based on SOES

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
vsluiter
Date:
Mon Mar 02 15:25:21 2015 +0000
Parent:
10:4e9069e5d698
Commit message:
Ready to publish;

Changed in this revision

EtherCAT/objectlist.h Show annotated file Show diff for this revision Revisions of this file
EtherCAT/utypes.h Show annotated file Show diff for this revision Revisions of this file
soes.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/EtherCAT/objectlist.h	Fri Dec 12 12:41:38 2014 +0000
+++ b/EtherCAT/objectlist.h	Mon Mar 02 15:25:21 2015 +0000
@@ -151,9 +151,9 @@
 /*Subindexes of Outputs*/
 _ac acName7000_01[]="Correct Offset";
 /*End of subindexes for Outputs*/
-//_ac acName8000[]="Configuration";
+_ac acName8000[]="Configuration";
 /*Subindexes of configuration*/
-//_ac acName8000_01[]="Settings 8";
+_ac acName8000_01[]="Settings 8";
 //_ac acName8000_02[]="Settings 16";
 /*End of subindexes of configuration*/
 
@@ -219,9 +219,9 @@
   {0x01,DTYPE_UNSIGNED16,16,ATYPE_R,&acNameMO[0],0x1600}           //Send objects in index 0x1600
 };
 const _objd SDO1C13[]=                                              //TxPDO Assign objects ; CHANGEABLE, thus 'RWpre' mode
-{{0x00,DTYPE_UNSIGNED8,8,ATYPE_RWpre,&acNameNOE[0],0x02},               //Number of Entries
-  {0x01,DTYPE_UNSIGNED16,16,ATYPE_RWpre,&acNameMO[0],0x1A00},            //Send objects in index 0x1A00
-  {0x02,DTYPE_UNSIGNED16,16,ATYPE_RWpre,&acNameMO[0],0x1A10}             //Send objects in index 0x1A10
+{{0x00,DTYPE_UNSIGNED8,8,ATYPE_R,&acNameNOE[0],0x02},               //Number of Entries
+  {0x01,DTYPE_UNSIGNED16,16,ATYPE_R,&acNameMO[0],0x1A00},            //Send objects in index 0x1A00
+  {0x02,DTYPE_UNSIGNED16,16,ATYPE_R,&acNameMO[0],0x1A10}             //Send objects in index 0x1A10
 };
 const _objd SDO6000[]=                                                      //TxPDO module
 {{0x00,DTYPE_UNSIGNED8  ,8,ATYPE_R,&acNameNOE[0],0x03},                     //Number of elements
@@ -242,11 +242,11 @@
 {{0x00,DTYPE_UNSIGNED8  ,8,ATYPE_R,&acNameNOE[0],0x01},                     //Number of elements
   {0x01,DTYPE_UNSIGNED8  ,8,ATYPE_RW,&acName7000_01[0],0,&(Wb.correct_offset)}   //7001:02 is correct_offset
 };
-//const _objd SDO8000[]=                                                      //Configuration mailbox
-//{{0x00,DTYPE_UNSIGNED8  ,8,ATYPE_R,&acNameNOE[0],0x02},                     //number of elements
-//  {0x01,DTYPE_UNSIGNED8  ,8,ATYPE_RW,&acName8000_01[0],0,&(Eb.setting8)},   //8000:01 is setting8
-//  {0x02,DTYPE_UNSIGNED16 ,16,ATYPE_RW,&acName8000_02[0],0,&(Eb.setting16)}  //8000:02 is setting16
-//};
+const _objd SDO8000[]=                                                      //Configuration mailbox
+{{0x00,DTYPE_UNSIGNED8  ,8,ATYPE_R,&acNameNOE[0],0x01},                     //number of elements
+  {0x01,DTYPE_UNSIGNED8  ,8,ATYPE_RW,&acName8000_01[0],0,&(Eb.setting8)}   //8000:01 is setting8
+  //{0x02,DTYPE_UNSIGNED16 ,16,ATYPE_RW,&acName8000_02[0],0,&(Eb.setting16)}  //8000:02 is setting16
+};
 /** Object list; all objects used in EtherCAT slave */
 const _objectlist SDOobjects[]=
 {{0x1000,OTYPE_VAR     , 0,0,&acName1000[0],&SDO1000[0]},       //Device Type
@@ -265,7 +265,7 @@
   {0x6000,OTYPE_ARRAY   , 0x03,0,&acName6000[0],&SDO6000[0]},   //TxPDO module
   {0x6001,OTYPE_ARRAY   , 0x05,0,&acName6001[0],&SDO6001[0]},   //TxPDO module
   {0x7000,OTYPE_ARRAY   , 0x01,0,&acName7000[0],&SDO7000[0]},   //RxPDO module
-  //{0x8000,OTYPE_ARRAY   , 0x02,0,&acName8000[0],&SDO8000[0]},   //RxPDO module
+  {0x8000,OTYPE_ARRAY   , 0x01,0,&acName8000[0],&SDO8000[0]},   //RxPDO module
   {0xffff,0xff,0xff,0xff,nil,nil}
 };
 
--- a/EtherCAT/utypes.h	Fri Dec 12 12:41:38 2014 +0000
+++ b/EtherCAT/utypes.h	Mon Mar 02 15:25:21 2015 +0000
@@ -67,16 +67,16 @@
     uint8         correct_offset;
   } _Wbuffer;
 
-//typedef struct
-//  {
-//    uint16        setting16;
-//    uint8         setting8;
-//  } _Ebuffer;
+typedef struct
+  {
+    uint16        setting16;
+    uint8         setting8;
+  } _Ebuffer;
 
 extern	uint8			APPstate;
 extern _Rbuffer			Rb;
 extern _Wbuffer			Wb;
-//extern _Ebuffer			Eb;
+extern _Ebuffer			Eb;
 
 #define EC_LITTLE_ENDIAN
 
--- a/soes.cpp	Fri Dec 12 12:41:38 2014 +0000
+++ b/soes.cpp	Mon Mar 02 15:25:21 2015 +0000
@@ -56,7 +56,7 @@
 uint16          SM2_sml,SM3_sml;
 _Rbuffer        Rb;
 _Wbuffer        Wb;
-//_Ebuffer        Eb; //EEprom
+_Ebuffer        Eb; //EEprom
 uint8           TXPDOsize,RXPDOsize;
 uint16          wd_ok = 1, wd_cnt = wd_reset;
 volatile uint8	correct_offset;