ethercatbase.c
Go to the documentation of this file.
1 /*
2  * Licensed under the GNU General Public License version 2 with exceptions. See
3  * LICENSE file in the project root for full license information
4  */
5 
17 #include <stdio.h>
18 #include <string.h>
19 #include "oshw.h"
20 #include "osal.h"
21 #include "ethercattype.h"
22 #include "ethercatbase.h"
23 
31 static void ecx_writedatagramdata(void *datagramdata, ec_cmdtype com, uint16 length, const void * data)
32 {
33  if (length > 0)
34  {
35  switch (com)
36  {
37  case EC_CMD_NOP:
38  /* Fall-through */
39  case EC_CMD_APRD:
40  /* Fall-through */
41  case EC_CMD_FPRD:
42  /* Fall-through */
43  case EC_CMD_BRD:
44  /* Fall-through */
45  case EC_CMD_LRD:
46  /* no data to write. initialise data so frame is in a known state */
47  memset(datagramdata, 0, length);
48  break;
49  default:
50  memcpy(datagramdata, data, length);
51  break;
52  }
53  }
54 }
55 
68 int ecx_setupdatagram(ecx_portt *port, void *frame, uint8 com, uint8 idx, uint16 ADP, uint16 ADO, uint16 length, void *data)
69 {
70  ec_comt *datagramP;
71  uint8 *frameP;
72 
73  frameP = frame;
74  /* Ethernet header is preset and fixed in frame buffers
75  EtherCAT header needs to be added after that */
76  datagramP = (ec_comt*)&frameP[ETH_HEADERSIZE];
77  datagramP->elength = htoes(EC_ECATTYPE + EC_HEADERSIZE + length);
78  datagramP->command = com;
79  datagramP->index = idx;
80  datagramP->ADP = htoes(ADP);
81  datagramP->ADO = htoes(ADO);
82  datagramP->dlength = htoes(length);
83  ecx_writedatagramdata(&frameP[ETH_HEADERSIZE + EC_HEADERSIZE], com, length, data);
84  /* set WKC to zero */
85  frameP[ETH_HEADERSIZE + EC_HEADERSIZE + length] = 0x00;
86  frameP[ETH_HEADERSIZE + EC_HEADERSIZE + length + 1] = 0x00;
87  /* set size of frame in buffer array */
88  port->txbuflength[idx] = ETH_HEADERSIZE + EC_HEADERSIZE + EC_WKCSIZE + length;
89 
90  return 0;
91 }
92 
106 int ecx_adddatagram(ecx_portt *port, void *frame, uint8 com, uint8 idx, boolean more, uint16 ADP, uint16 ADO, uint16 length, void *data)
107 {
108  ec_comt *datagramP;
109  uint8 *frameP;
110  uint16 prevlength;
111 
112  frameP = frame;
113  /* copy previous frame size */
114  prevlength = port->txbuflength[idx];
115  datagramP = (ec_comt*)&frameP[ETH_HEADERSIZE];
116  /* add new datagram to ethernet frame size */
117  datagramP->elength = htoes( etohs(datagramP->elength) + EC_HEADERSIZE + length );
118  /* add "datagram follows" flag to previous subframe dlength */
119  datagramP->dlength = htoes( etohs(datagramP->dlength) | EC_DATAGRAMFOLLOWS );
120  /* set new EtherCAT header position */
121  datagramP = (ec_comt*)&frameP[prevlength - EC_ELENGTHSIZE];
122  datagramP->command = com;
123  datagramP->index = idx;
124  datagramP->ADP = htoes(ADP);
125  datagramP->ADO = htoes(ADO);
126  if (more)
127  {
128  /* this is not the last datagram to add */
129  datagramP->dlength = htoes(length | EC_DATAGRAMFOLLOWS);
130  }
131  else
132  {
133  /* this is the last datagram in the frame */
134  datagramP->dlength = htoes(length);
135  }
136  ecx_writedatagramdata(&frameP[prevlength + EC_HEADERSIZE - EC_ELENGTHSIZE], com, length, data);
137  /* set WKC to zero */
138  frameP[prevlength + EC_HEADERSIZE - EC_ELENGTHSIZE + length] = 0x00;
139  frameP[prevlength + EC_HEADERSIZE - EC_ELENGTHSIZE + length + 1] = 0x00;
140  /* set size of frame in buffer array */
141  port->txbuflength[idx] = prevlength + EC_HEADERSIZE - EC_ELENGTHSIZE + EC_WKCSIZE + length;
142 
143  /* return offset to data in rx frame
144  14 bytes smaller than tx frame due to stripping of ethernet header */
145  return prevlength + EC_HEADERSIZE - EC_ELENGTHSIZE - ETH_HEADERSIZE;
146 }
147 
158 int ecx_BWR (ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
159 {
160  uint8 idx;
161  int wkc;
162 
163  /* get fresh index */
164  idx = ecx_getindex (port);
165  /* setup datagram */
166  ecx_setupdatagram (port, &(port->txbuf[idx]), EC_CMD_BWR, idx, ADP, ADO, length, data);
167  /* send data and wait for answer */
168  wkc = ecx_srconfirm (port, idx, timeout);
169  /* clear buffer status */
170  ecx_setbufstat (port, idx, EC_BUF_EMPTY);
171 
172  return wkc;
173 }
174 
185 int ecx_BRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
186 {
187  uint8 idx;
188  int wkc;
189 
190  /* get fresh index */
191  idx = ecx_getindex(port);
192  /* setup datagram */
193  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_BRD, idx, ADP, ADO, length, data);
194  /* send data and wait for answer */
195  wkc = ecx_srconfirm (port, idx, timeout);
196  if (wkc > 0)
197  {
198  /* copy datagram to data buffer */
199  memcpy(data, &(port->rxbuf[idx][EC_HEADERSIZE]), length);
200  }
201  /* clear buffer status */
202  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
203 
204  return wkc;
205 }
206 
217 int ecx_APRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
218 {
219  int wkc;
220  uint8 idx;
221 
222  idx = ecx_getindex(port);
223  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_APRD, idx, ADP, ADO, length, data);
224  wkc = ecx_srconfirm(port, idx, timeout);
225  if (wkc > 0)
226  {
227  memcpy(data, &(port->rxbuf[idx][EC_HEADERSIZE]), length);
228  }
229  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
230 
231  return wkc;
232 }
233 
245 int ecx_ARMW(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
246 {
247  int wkc;
248  uint8 idx;
249 
250  idx = ecx_getindex(port);
251  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_ARMW, idx, ADP, ADO, length, data);
252  wkc = ecx_srconfirm(port, idx, timeout);
253  if (wkc > 0)
254  {
255  memcpy(data, &(port->rxbuf[idx][EC_HEADERSIZE]), length);
256  }
257  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
258 
259  return wkc;
260 }
261 
273 int ecx_FRMW(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
274 {
275  int wkc;
276  uint8 idx;
277 
278  idx = ecx_getindex(port);
279  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_FRMW, idx, ADP, ADO, length, data);
280  wkc = ecx_srconfirm(port, idx, timeout);
281  if (wkc > 0)
282  {
283  memcpy(data, &(port->rxbuf[idx][EC_HEADERSIZE]), length);
284  }
285  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
286 
287  return wkc;
288 }
289 
298 uint16 ecx_APRDw(ecx_portt *port, uint16 ADP, uint16 ADO, int timeout)
299 {
300  uint16 w;
301 
302  w = 0;
303  ecx_APRD(port, ADP, ADO, sizeof(w), &w, timeout);
304 
305  return w;
306 }
307 
318 int ecx_FPRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
319 {
320  int wkc;
321  uint8 idx;
322 
323  idx = ecx_getindex(port);
324  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_FPRD, idx, ADP, ADO, length, data);
325  wkc = ecx_srconfirm(port, idx, timeout);
326  if (wkc > 0)
327  {
328  memcpy(data, &(port->rxbuf[idx][EC_HEADERSIZE]), length);
329  }
330  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
331 
332  return wkc;
333 }
334 
343 uint16 ecx_FPRDw(ecx_portt *port, uint16 ADP, uint16 ADO, int timeout)
344 {
345  uint16 w;
346 
347  w = 0;
348  ecx_FPRD(port, ADP, ADO, sizeof(w), &w, timeout);
349  return w;
350 }
351 
362 int ecx_APWR(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
363 {
364  uint8 idx;
365  int wkc;
366 
367  idx = ecx_getindex(port);
368  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_APWR, idx, ADP, ADO, length, data);
369  wkc = ecx_srconfirm(port, idx, timeout);
370  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
371 
372  return wkc;
373 }
374 
384 int ecx_APWRw(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout)
385 {
386  return ecx_APWR(port, ADP, ADO, sizeof(data), &data, timeout);
387 }
388 
399 int ecx_FPWR(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
400 {
401  int wkc;
402  uint8 idx;
403 
404  idx = ecx_getindex(port);
405  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_FPWR, idx, ADP, ADO, length, data);
406  wkc = ecx_srconfirm(port, idx, timeout);
407  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
408 
409  return wkc;
410 }
411 
421 int ecx_FPWRw(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout)
422 {
423  return ecx_FPWR(port, ADP, ADO, sizeof(data), &data, timeout);
424 }
425 
435 int ecx_LRW(ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout)
436 {
437  uint8 idx;
438  int wkc;
439 
440  idx = ecx_getindex(port);
441  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_LRW, idx, LO_WORD(LogAdr), HI_WORD(LogAdr), length, data);
442  wkc = ecx_srconfirm(port, idx, timeout);
443  if ((wkc > 0) && (port->rxbuf[idx][EC_CMDOFFSET] == EC_CMD_LRW))
444  {
445  memcpy(data, &(port->rxbuf[idx][EC_HEADERSIZE]), length);
446  }
447  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
448 
449  return wkc;
450 }
451 
461 int ecx_LRD(ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout)
462 {
463  uint8 idx;
464  int wkc;
465 
466  idx = ecx_getindex(port);
467  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_LRD, idx, LO_WORD(LogAdr), HI_WORD(LogAdr), length, data);
468  wkc = ecx_srconfirm(port, idx, timeout);
469  if ((wkc > 0) && (port->rxbuf[idx][EC_CMDOFFSET]==EC_CMD_LRD))
470  {
471  memcpy(data, &(port->rxbuf[idx][EC_HEADERSIZE]), length);
472  }
473  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
474 
475  return wkc;
476 }
477 
487 int ecx_LWR(ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout)
488 {
489  uint8 idx;
490  int wkc;
491 
492  idx = ecx_getindex(port);
493  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_LWR, idx, LO_WORD(LogAdr), HI_WORD(LogAdr), length, data);
494  wkc = ecx_srconfirm(port, idx, timeout);
495  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
496 
497  return wkc;
498 }
499 
512 int ecx_LRWDC(ecx_portt *port, uint32 LogAdr, uint16 length, void *data, uint16 DCrs, int64 *DCtime, int timeout)
513 {
514  uint16 DCtO;
515  uint8 idx;
516  int wkc;
517  uint64 DCtE;
518 
519  idx = ecx_getindex(port);
520  /* LRW in first datagram */
521  ecx_setupdatagram(port, &(port->txbuf[idx]), EC_CMD_LRW, idx, LO_WORD(LogAdr), HI_WORD(LogAdr), length, data);
522  /* FPRMW in second datagram */
523  DCtE = htoell(*DCtime);
524  DCtO = ecx_adddatagram(port, &(port->txbuf[idx]), EC_CMD_FRMW, idx, FALSE, DCrs, ECT_REG_DCSYSTIME, sizeof(DCtime), &DCtE);
525  wkc = ecx_srconfirm(port, idx, timeout);
526  if ((wkc > 0) && (port->rxbuf[idx][EC_CMDOFFSET] == EC_CMD_LRW))
527  {
528  memcpy(data, &(port->rxbuf[idx][EC_HEADERSIZE]), length);
529  memcpy(&wkc, &(port->rxbuf[idx][EC_HEADERSIZE + length]), EC_WKCSIZE);
530  memcpy(&DCtE, &(port->rxbuf[idx][DCtO]), sizeof(*DCtime));
531  *DCtime = etohll(DCtE);
532  }
533  ecx_setbufstat(port, idx, EC_BUF_EMPTY);
534 
535  return wkc;
536 }
537 
538 #ifdef EC_VER1
539 int ec_setupdatagram(void *frame, uint8 com, uint8 idx, uint16 ADP, uint16 ADO, uint16 length, void *data)
540 {
541  return ecx_setupdatagram (&ecx_port, frame, com, idx, ADP, ADO, length, data);
542 }
543 
544 int ec_adddatagram (void *frame, uint8 com, uint8 idx, boolean more, uint16 ADP, uint16 ADO, uint16 length, void *data)
545 {
546  return ecx_adddatagram (&ecx_port, frame, com, idx, more, ADP, ADO, length, data);
547 }
548 
549 int ec_BWR(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
550 {
551  return ecx_BWR (&ecx_port, ADP, ADO, length, data, timeout);
552 }
553 
554 int ec_BRD(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
555 {
556  return ecx_BRD(&ecx_port, ADP, ADO, length, data, timeout);
557 }
558 
559 int ec_APRD(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
560 {
561  return ecx_APRD(&ecx_port, ADP, ADO, length, data, timeout);
562 }
563 
564 int ec_ARMW(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
565 {
566  return ecx_ARMW(&ecx_port, ADP, ADO, length, data, timeout);
567 }
568 
569 int ec_FRMW(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
570 {
571  return ecx_FRMW(&ecx_port, ADP, ADO, length, data, timeout);
572 }
573 
574 uint16 ec_APRDw(uint16 ADP, uint16 ADO, int timeout)
575 {
576  uint16 w;
577 
578  w = 0;
579  ec_APRD(ADP, ADO, sizeof(w), &w, timeout);
580 
581  return w;
582 }
583 
584 int ec_FPRD(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
585 {
586  return ecx_FPRD(&ecx_port, ADP, ADO, length, data, timeout);
587 }
588 
589 uint16 ec_FPRDw(uint16 ADP, uint16 ADO, int timeout)
590 {
591  uint16 w;
592 
593  w = 0;
594  ec_FPRD(ADP, ADO, sizeof(w), &w, timeout);
595  return w;
596 }
597 
598 int ec_APWR(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
599 {
600  return ecx_APWR(&ecx_port, ADP, ADO, length, data, timeout);
601 }
602 
603 int ec_APWRw(uint16 ADP, uint16 ADO, uint16 data, int timeout)
604 {
605  return ec_APWR(ADP, ADO, sizeof(data), &data, timeout);
606 }
607 
608 int ec_FPWR(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
609 {
610  return ecx_FPWR(&ecx_port, ADP, ADO, length, data, timeout);
611 }
612 
613 int ec_FPWRw(uint16 ADP, uint16 ADO, uint16 data, int timeout)
614 {
615  return ec_FPWR(ADP, ADO, sizeof(data), &data, timeout);
616 }
617 
618 int ec_LRW(uint32 LogAdr, uint16 length, void *data, int timeout)
619 {
620  return ecx_LRW(&ecx_port, LogAdr, length, data, timeout);
621 }
622 
623 int ec_LRD(uint32 LogAdr, uint16 length, void *data, int timeout)
624 {
625  return ecx_LRD(&ecx_port, LogAdr, length, data, timeout);
626 }
627 
628 int ec_LWR(uint32 LogAdr, uint16 length, void *data, int timeout)
629 {
630  return ecx_LWR(&ecx_port, LogAdr, length, data, timeout);
631 }
632 
633 int ec_LRWDC(uint32 LogAdr, uint16 length, void *data, uint16 DCrs, int64 *DCtime, int timeout)
634 {
635  return ecx_LRWDC(&ecx_port, LogAdr, length, data, DCrs, DCtime, timeout);
636 }
637 #endif
wkc
int wkc
Definition: aliastool.c:47
ecx_setupdatagram
int ecx_setupdatagram(ecx_portt *port, void *frame, uint8 com, uint8 idx, uint16 ADP, uint16 ADO, uint16 length, void *data)
Definition: ethercatbase.c:68
ecx_LRWDC
int ecx_LRWDC(ecx_portt *port, uint32 LogAdr, uint16 length, void *data, uint16 DCrs, int64 *DCtime, int timeout)
Definition: ethercatbase.c:512
ec_ARMW
int ec_ARMW(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:564
ec_FPWR
int ec_FPWR(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:608
ec_adddatagram
int ec_adddatagram(void *frame, uint8 com, uint8 idx, boolean more, uint16 ADP, uint16 ADO, uint16 length, void *data)
Definition: ethercatbase.c:544
EC_ECATTYPE
#define EC_ECATTYPE
Definition: ethercattype.h:60
ecx_LRD
int ecx_LRD(ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:461
etohs
#define etohs(A)
Definition: ethercattype.h:536
ecx_BRD
int ecx_BRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:185
ec_cmdtype
ec_cmdtype
Definition: ethercattype.h:222
ecx_portt::txbuf
ec_bufT txbuf[EC_MAXBUF]
Definition: erika/nicdrv.h:68
ec_APWRw
int ec_APWRw(uint16 ADP, uint16 ADO, uint16 data, int timeout)
Definition: ethercatbase.c:603
EC_CMD_FPWR
@ EC_CMD_FPWR
Definition: ethercattype.h:235
EC_CMD_NOP
@ EC_CMD_NOP
Definition: ethercattype.h:225
ec_FRMW
int ec_FRMW(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:569
ecx_port
Definition: vxworks/nicdrv.h:67
EC_CMD_APRD
@ EC_CMD_APRD
Definition: ethercattype.h:227
ecx_LWR
int ecx_LWR(ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:487
ecx_portt::txbuflength
int txbuflength[EC_MAXBUF]
Definition: erika/nicdrv.h:70
EC_CMD_LRD
@ EC_CMD_LRD
Definition: ethercattype.h:245
data
uint32 data
Definition: linux/firm_update/firm_update.c:27
ECT_REG_DCSYSTIME
@ ECT_REG_DCSYSTIME
Definition: ethercattype.h:435
ec_APWR
int ec_APWR(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:598
ec_APRDw
uint16 ec_APRDw(uint16 ADP, uint16 ADO, int timeout)
Definition: ethercatbase.c:574
uint32
uint32_t uint32
Definition: osal.h:30
ecx_getindex
int ecx_getindex(ecx_portt *port)
Definition: erika/nicdrv.c:168
EC_WKCSIZE
#define EC_WKCSIZE
Definition: ethercattype.h:133
htoell
#define htoell(A)
Definition: ethercattype.h:535
int64
int64_t int64
Definition: osal.h:31
EC_DATAGRAMFOLLOWS
#define EC_DATAGRAMFOLLOWS
Definition: ethercattype.h:135
uint8
uint8_t uint8
Definition: osal.h:28
ec_APRD
int ec_APRD(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:559
uint64
uint64_t uint64
Definition: osal.h:32
ethercatbase.h
Headerfile for ethercatbase.c.
ecx_ARMW
int ecx_ARMW(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:245
EC_CMD_BRD
@ EC_CMD_BRD
Definition: ethercattype.h:239
ec_comt
PACKED_BEGIN struct PACKED ec_comt
ecx_portt::rxbuf
ec_bufT rxbuf[EC_MAXBUF]
Definition: erika/nicdrv.h:58
EC_CMD_BWR
@ EC_CMD_BWR
Definition: ethercattype.h:241
EC_CMD_LRW
@ EC_CMD_LRW
Definition: ethercattype.h:249
osal.h
ec_FPRD
int ec_FPRD(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:584
ecx_BWR
int ecx_BWR(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:158
htoes
#define htoes(A)
Definition: ethercattype.h:533
ec_BRD
int ec_BRD(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:554
etohll
#define etohll(A)
Definition: ethercattype.h:538
EC_HEADERSIZE
#define EC_HEADERSIZE
Definition: ethercattype.h:127
ec_LRD
int ec_LRD(uint32 LogAdr, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:623
uint16
uint16_t uint16
Definition: osal.h:29
ecx_FRMW
int ecx_FRMW(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:273
ecx_APWRw
int ecx_APWRw(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout)
Definition: ethercatbase.c:384
ec_LRWDC
int ec_LRWDC(uint32 LogAdr, uint16 length, void *data, uint16 DCrs, int64 *DCtime, int timeout)
Definition: ethercatbase.c:633
ecx_APWR
int ecx_APWR(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:362
EC_CMD_FPRD
@ EC_CMD_FPRD
Definition: ethercattype.h:233
ec_BWR
int ec_BWR(uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:549
EC_ELENGTHSIZE
#define EC_ELENGTHSIZE
Definition: ethercattype.h:129
HI_WORD
#define HI_WORD(l)
Definition: ethercattype.h:520
ecx_portt
Definition: erika/nicdrv.h:53
FALSE
#define FALSE
Definition: osal.h:22
ecx_FPRD
int ecx_FPRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:318
EC_CMD_LWR
@ EC_CMD_LWR
Definition: ethercattype.h:247
ec_LRW
int ec_LRW(uint32 LogAdr, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:618
ecx_APRD
int ecx_APRD(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:217
ec_FPRDw
uint16 ec_FPRDw(uint16 ADP, uint16 ADO, int timeout)
Definition: ethercatbase.c:589
ecx_LRW
int ecx_LRW(ecx_portt *port, uint32 LogAdr, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:435
ecx_setbufstat
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
Definition: erika/nicdrv.c:202
LO_WORD
#define LO_WORD(l)
Definition: ethercattype.h:518
EC_CMD_ARMW
@ EC_CMD_ARMW
Definition: ethercattype.h:251
ecx_FPRDw
uint16 ecx_FPRDw(ecx_portt *port, uint16 ADP, uint16 ADO, int timeout)
Definition: ethercatbase.c:343
EC_CMD_APWR
@ EC_CMD_APWR
Definition: ethercattype.h:229
ec_setupdatagram
int ec_setupdatagram(void *frame, uint8 com, uint8 idx, uint16 ADP, uint16 ADO, uint16 length, void *data)
Definition: ethercatbase.c:539
EC_CMDOFFSET
#define EC_CMDOFFSET
Definition: ethercattype.h:131
ethercattype.h
General typedefs and defines for EtherCAT.
ecx_FPWRw
int ecx_FPWRw(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 data, int timeout)
Definition: ethercatbase.c:421
ecx_adddatagram
int ecx_adddatagram(ecx_portt *port, void *frame, uint8 com, uint8 idx, boolean more, uint16 ADP, uint16 ADO, uint16 length, void *data)
Definition: ethercatbase.c:106
ecx_FPWR
int ecx_FPWR(ecx_portt *port, uint16 ADP, uint16 ADO, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:399
ec_FPWRw
int ec_FPWRw(uint16 ADP, uint16 ADO, uint16 data, int timeout)
Definition: ethercatbase.c:613
EC_CMD_FRMW
@ EC_CMD_FRMW
Definition: ethercattype.h:253
ecx_APRDw
uint16 ecx_APRDw(ecx_portt *port, uint16 ADP, uint16 ADO, int timeout)
Definition: ethercatbase.c:298
EC_BUF_EMPTY
@ EC_BUF_EMPTY
Definition: ethercattype.h:178
ecx_writedatagramdata
static void ecx_writedatagramdata(void *datagramdata, ec_cmdtype com, uint16 length, const void *data)
Definition: ethercatbase.c:31
ETH_HEADERSIZE
#define ETH_HEADERSIZE
Definition: ethercattype.h:103
ecx_srconfirm
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:490
ec_LWR
int ec_LWR(uint32 LogAdr, uint16 length, void *data, int timeout)
Definition: ethercatbase.c:628


soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Wed Mar 2 2022 01:01:48