device.h File Reference
EtherCAT device structure.
More...
Go to the source code of this file.
Detailed Description
EtherCAT device structure.
Definition in file device.h.
Define Documentation
| #define EC_TX_RING_SIZE 2 |
Size of the transmit ring.
This memory ring is used to transmit frames. It is necessary to use different memory regions, because otherwise the network device DMA could send the same data twice, if it is called twice.
Definition at line 51 of file device.h.
Function Documentation
Constructor.
- Returns:
- 0 in case of success, else < 0
- Parameters:
-
| device |
EtherCAT device |
| master |
master owning the device |
Definition at line 63 of file device.c.
Opens the EtherCAT device.
- Returns:
- 0 in case of success, else < 0
- Parameters:
-
Definition at line 242 of file device.c.
Stops the EtherCAT device.
- Returns:
- 0 in case of success, else < 0
- Parameters:
-
Definition at line 279 of file device.c.
Calls the poll function of the assigned net_device.
The master itself works without using interrupts. Therefore the processing of received data and status changes of the network device has to be done by the master calling the ISR "manually".
- Parameters:
-
Definition at line 478 of file device.c.
Returns a pointer to the device's transmit memory.
- Returns:
- pointer to the TX socket buffer
- Parameters:
-
Definition at line 312 of file device.c.
| void ec_device_send |
( |
ec_device_t * |
device, |
|
|
size_t |
size | |
|
) |
| | |
Sends the content of the transmit socket buffer.
Cuts the socket buffer content to the (now known) size, and calls the start_xmit() function of the assigned net_device.
- Parameters:
-
| device |
EtherCAT device |
| size |
number of bytes to send |
Definition at line 331 of file device.c.