Go to the documentation of this file.
26 #define EC_LOCALDELAY 200
223 memset(&Ec, 0,
sizeof(Ec));
244 memset(&Ec, 0,
sizeof(Ec));
269 memset(&Ec, 0,
sizeof(Ec));
352 mapb = address - (mapw << 5);
356 retval = context->
esibuf[address];
380 mapb = (eadr << 1) - (mapw << 5);
381 for(lp = 0 ; lp < cnt ; lp++)
384 context->
esimap[mapw] |= (1 << mapb);
392 retval = context->
esibuf[address];
416 while ((p != cat) && (p != 0xffff))
459 for (i = 1; i <= Sn; i++)
469 for (
j = 1;
j <= l;
j++)
616 uint16 a , w, c, e, er, Size;
649 for (er = 1; er <= e; er++)
671 while (c < PDO->Length);
681 #define MAX_FPRD_MULTI 64
691 port = context->
port;
697 while(++slcnt < (n - 1))
710 for(slcnt = 0 ; slcnt < n ; slcnt++)
712 memcpy(slstatlst + slcnt, &(port->
rxbuf[idx][sldatapos[slcnt]]),
sizeof(
ec_alstatust));
725 uint16 slave, fslave, lslave, configadr, lowest, rval, bitwisestate;
728 boolean noerrorflag, allslavessamestate;
729 boolean allslavespresent =
FALSE;
739 allslavespresent =
TRUE;
743 bitwisestate = (rval & 0x0f);
755 switch (bitwisestate)
762 allslavessamestate =
TRUE;
766 allslavessamestate =
FALSE;
770 if (noerrorflag && allslavessamestate && allslavespresent)
781 lowest = bitwisestate;
802 slca[
slave - fslave] = configadr;
803 sl[
slave - fslave] = zero;
811 if ((rval & 0xf) < lowest)
813 lowest = (rval & 0xf);
835 uint16 configadr, slstate;
864 uint16 configadr, state, rval;
885 slstat.alstatuscode = 0;
887 rval =
etohs(slstat.alstatus);
890 state = rval & 0x000f;
891 if (state != reqstate)
945 SMstat =
etohs(SMstat);
953 if ((
wkc > 0) && ((SMstat & 0x08) == 0))
970 uint16 mbxwo,mbxl,configadr;
1003 uint16 mbxro,mbxl,configadr;
1024 SMstat =
etohs(SMstat);
1032 if ((
wkc > 0) && ((SMstat & 0x08) > 0))
1039 if ((
wkc > 0) && ((mbxh->mbxtype & 0x0f) == 0x00))
1048 if ((
etohs(EMp->CANOpen) >> 12) == 0x01)
1079 SMstat =
htoes(SMstat);
1081 SMstat =
etohs(SMstat);
1089 SMstat =
etohs(SMstat);
1191 int wkc = 1, cnt = 0;
1224 int wkc = 1, cnt = 0;
1245 int wkc, cnt = 0, retval = 0;
1257 *estat =
etohs(*estat);
1281 int wkc, cnt, nackcnt = 0;
1296 ed.addr =
htoes(eeproma);
1341 while ((nackcnt > 0) && (nackcnt < 3));
1359 int wkc, rval = 0, cnt = 0, nackcnt = 0;
1406 while ((nackcnt > 0) && (nackcnt < 3));
1414 int wkc, cnt = 0, retval = 0;
1426 *estat =
etohs(*estat);
1450 int wkc, cnt, nackcnt = 0;
1465 ed.addr =
htoes(eeproma);
1510 while ((nackcnt > 0) && (nackcnt < 3));
1528 int wkc, rval = 0, cnt = 0, nackcnt = 0;
1573 while ((nackcnt > 0) && (nackcnt < 3));
1601 ed.addr =
htoes(eeproma);
1701 int length, sublength;
1705 boolean first=
FALSE;
1706 uint16 currentsegment = 0;
1716 if(use_overlap_io ==
TRUE)
1727 iomapinputoffset = 0;
1763 context->
DCl = sublength;
1774 length -= sublength;
1775 LogAdr += sublength;
1777 }
while (length && (currentsegment < context->grouplist[group].nsegments));
1790 if((length - sublength) < 0)
1801 context->
DCl = sublength;
1812 length -= sublength;
1813 LogAdr += sublength;
1815 }
while (length && (currentsegment < context->grouplist[group].nsegments));
1829 iomapinputoffset = 0;
1842 context->
DCl = sublength;
1857 length -= sublength;
1858 LogAdr += sublength;
1860 }
while (length && (currentsegment < context->grouplist[group].nsegments));
1917 boolean first =
FALSE;
1940 memcpy(&le_DCtime, &(context->
port->
rxbuf[idx][context->
DCtO]),
sizeof(le_DCtime));
1959 memcpy(&le_DCtime, &(context->
port->
rxbuf[idx][context->
DCtO]),
sizeof(le_DCtime));
ec_errort Error[EC_MAXELIST+1]
int ecx_setupdatagram(ecx_portt *port, void *frame, uint8 com, uint8 idx, uint16 ADP, uint16 ADO, uint16 length, void *data)
int ecx_send_processdata(ecx_contextt *context)
PACKED_END PACKED_BEGIN struct PACKED ec_mbxerrort
uint16 ec_eeprom_waitnotbusyAP(uint16 aiadr, uint16 *estat, int timeout)
int ec_mbxreceive(uint16 slave, ec_mbxbuft *mbx, int timeout)
int ec_send_overlap_processdata_group(uint8 group)
static int ecx_pullindex(ecx_contextt *context)
int ecx_BRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
int ecx_siiPDO(ecx_contextt *context, uint16 slave, ec_eepromPDOt *PDO, uint8 t)
int ecx_init(ecx_contextt *context, const char *ifname)
int(* EOEhook)(ecx_contextt *context, uint16 slave, void *eoembx)
uint64 ec_readeepromFP(uint16 configadr, uint16 eeproma, int timeout)
int ec_init_redundant(const char *ifname, char *if2name)
int ec_eeprom2master(uint16 slave)
uint8 ec_mbxbuft[EC_MAXMBX+1]
uint16 ecx_statecheck(ecx_contextt *context, uint16 slave, uint16 reqstate, int timeout)
uint16 ec_siiSMnext(uint16 slave, ec_eepromSMt *SM, uint16 n)
uint16 ecx_siiSM(ecx_contextt *context, uint16 slave, ec_eepromSMt *SM)
int ec_send_processdata(void)
int ecx_writestate(ecx_contextt *context, uint16 slave)
int ecx_init_redundant(ecx_contextt *context, ecx_redportt *redport, const char *ifname, char *if2name)
PACKED_END PACKED_BEGIN struct PACKED ec_emcyt
@ EC_ERR_TYPE_PACKET_ERROR
ec_timet osal_current_time(void)
Headerfile for all ethercat headers.
boolean osal_timer_is_expired(osal_timert *self)
int ec_init(const char *ifname)
int16 ecx_siifind(ecx_contextt *context, uint16 slave, uint16 cat)
uint32 ec_readeeprom(uint16 slave, uint16 eeproma, int timeout)
uint16 oshw_htons(uint16 host)
int ecx_getindex(ecx_portt *port)
int ec_mbxsend(uint16 slave, ec_mbxbuft *mbx, int timeout)
#define EOE_HDR_FRAME_TYPE_GET(x)
void ecx_esidump(ecx_contextt *context, uint16 slave, uint8 *esibuf)
int ecx_closenic(ecx_portt *port)
#define put_unaligned64(val, ptr)
static ec_eepromFMMUt ec_FMMU
uint64 ecx_readeepromAP(ecx_contextt *context, uint16 aiadr, uint16 eeproma, int timeout)
void ec_packeterror(uint16 Slave, uint16 Index, uint8 SubIdx, uint16 ErrorCode)
void ecx_close(ecx_contextt *context)
static void ecx_clearindex(ecx_contextt *context)
int ec_mbxempty(uint16 slave, int timeout)
uint16 ecx_eeprom_waitnotbusyFP(ecx_contextt *context, uint16 configadr, uint16 *estat, int timeout)
PACKED_BEGIN struct PACKED ec_mbxheader ec_mbxheadert
static ec_idxstackT ec_idxstack
uint32 ecx_readeeprom(ecx_contextt *context, uint16 slave, uint16 eeproma, int timeout)
uint16 ec_eeprom_waitnotbusyFP(uint16 configadr, uint16 *estat, int timeout)
int ecx_send_overlap_processdata(ecx_contextt *context)
int16 ec_siifind(uint16 slave, uint16 cat)
void ec_clearmbx(ec_mbxbuft *Mbx)
int ecx_writeeepromAP(ecx_contextt *context, uint16 aiadr, uint16 eeproma, uint16 data, int timeout)
void ecx_siistring(ecx_contextt *context, char *str, uint16 slave, uint16 Sn)
uint32 IOsegment[EC_MAXIOSEGMENTS]
static int ecx_main_send_processdata(ecx_contextt *context, uint8 group, boolean use_overlap_io)
uint8 ec_siigetbyte(uint16 slave, uint16 address)
void ec_free_adapters(ec_adaptert *adapter)
PACKED_BEGIN struct PACKED ec_SMcommtype ec_SMcommtypet
uint16 ec_siiFMMU(uint16 slave, ec_eepromFMMUt *FMMU)
PACKED_END PACKED_BEGIN struct PACKED ec_PDOdesc ec_PDOdesct
static uint32 ec_esimap[EC_MAXEEPBITMAP]
uint64 ecx_readeepromFP(ecx_contextt *context, uint16 configadr, uint16 eeproma, int timeout)
PACKED_BEGIN struct PACKED ec_EOEt
int ecx_readstate(ecx_contextt *context)
void ec_esidump(uint16 slave, uint8 *esibuf)
uint16 ecx_siiFMMU(ecx_contextt *context, uint16 slave, ec_eepromFMMUt *FMMU)
int ecx_mbxsend(ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout)
int ecx_writeeepromFP(ecx_contextt *context, uint16 configadr, uint16 eeproma, uint16 data, int timeout)
uint8 ecx_siigetbyte(ecx_contextt *context, uint16 slave, uint16 address)
int ecx_BWR(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
int ec_siiPDO(uint16 slave, ec_eepromPDOt *PDO, uint8 t)
#define put_unaligned32(val, ptr)
uint16 SyncM[EC_MAXEEPDO]
int ecx_writeeeprom(ecx_contextt *context, uint16 slave, uint16 eeproma, uint16 data, int timeout)
int ecx_receive_processdata_group(ecx_contextt *context, uint8 group, int timeout)
uint16 ec_siiSM(uint16 slave, ec_eepromSMt *SM)
void osal_timer_start(osal_timert *self, uint32 timeout_usec)
int ecx_mbxreceive(ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout)
int ec_writeeeprom(uint16 slave, uint16 eeproma, uint16 data, int timeout)
int ecx_APWR(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
int ec_send_processdata_group(uint8 group)
static ec_eringt ec_elist
uint32 ec_readeeprom2(uint16 slave, int timeout)
void ec_pusherror(const ec_errort *Ec)
void ecx_readeeprom1(ecx_contextt *context, uint16 slave, uint16 eeproma)
uint64 ec_readeepromAP(uint16 aiadr, uint16 eeproma, int timeout)
static void ecx_mbxerror(ecx_contextt *context, uint16 Slave, uint16 Detail)
int osal_usleep(uint32 usec)
int ecx_receive_processdata(ecx_contextt *context, int timeout)
int ec_send_overlap_processdata(void)
PACKED_END PACKED_BEGIN struct PACKED ec_alstatus ec_alstatust
boolean ecx_poperror(ecx_contextt *context, ec_errort *Ec)
uint16 ecx_eeprom_waitnotbusyAP(ecx_contextt *context, uint16 aiadr, uint16 *estat, int timeout)
int ec_writestate(uint16 slave)
PACKED_BEGIN struct PACKED ec_eepromt
int ec_eeprom2pdi(uint16 slave)
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
int ec_receive_processdata_group(uint8 group, int timeout)
ec_adaptert * ec_find_adapters(void)
int ecx_mbxempty(ecx_contextt *context, uint16 slave, int timeout)
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
void ec_siistring(char *str, uint16 slave, uint16 Sn)
uint16 BitSize[EC_MAXEEPDO]
int ecx_eeprom2pdi(ecx_contextt *context, uint16 slave)
PACKED_BEGIN struct PACKED ec_etherheadert
int ec_writeeepromFP(uint16 configadr, uint16 eeproma, uint16 data, int timeout)
int ecx_FPRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
void oshw_free_adapters(ec_adaptert *adapter)
static void ecx_mbxemergencyerror(ecx_contextt *context, uint16 Slave, uint16 ErrorCode, uint16 ErrorReg, uint8 b1, uint16 w1, uint16 w2)
int ec_writeeepromAP(uint16 aiadr, uint16 eeproma, uint16 data, int timeout)
PACKED_END struct ec_idxstack ec_idxstackT
int ecx_APRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
uint32 ecx_readeeprom2(ecx_contextt *context, uint16 slave, int timeout)
int ecx_send_overlap_processdata_group(ecx_contextt *context, uint8 group)
boolean ec_poperror(ec_errort *Ec)
#define EC_DEFAULTRETRIES
uint16 ecx_siiSMnext(ecx_contextt *context, uint16 slave, ec_eepromSMt *SM, uint16 n)
void ec_readeeprom1(uint16 slave, uint16 eeproma)
static uint8 esibuf[EC_MAXEEPBUF]
uint16 SMbitsize[EC_MAXSM]
int ecx_outframe_red(ecx_portt *port, int idx)
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
ec_adaptert * oshw_find_adapters(void)
void ecx_pusherror(ecx_contextt *context, const ec_errort *Ec)
static void ecx_pushindex(ecx_contextt *context, uint8 idx, void *data, uint16 length)
boolean ecx_iserror(ecx_contextt *context)
uint8 ec_nextmbxcnt(uint8 cnt)
int ecx_FPWRw(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout)
uint16 ec_statecheck(uint16 slave, uint16 reqstate, int timeout)
static uint8 ec_esibuf[EC_MAXEEPBUF]
int ec_receive_processdata(int timeout)
int ecx_adddatagram(ecx_portt *port, void *frame, uint8 com, uint8 idx, boolean more, uint16 ADP, uint16 ADO, uint16 length, void *data)
int ecx_send_processdata_group(ecx_contextt *context, uint8 group)
uint16 Index[EC_MAXEEPDO]
int ecx_FPWR(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
static ec_eepromSMt ec_SM
PACKED_END PACKED_BEGIN struct PACKED ec_PDOassign ec_PDOassignt
int ecx_eeprom2master(ecx_contextt *context, uint16 slave)
void ecx_packeterror(ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, uint16 ErrorCode)
int ecx_FPRD_multi(ecx_contextt *context, int n, uint16 *configlst, ec_alstatust *slstatlst, int timeout)
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Wed Mar 2 2022 01:01:48