libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
Loading...
Searching...
No Matches
hw_file.h
Go to the documentation of this file.
1
12/*
13 * This file is part of libethercat.
14 *
15 * libethercat is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 3 of the License, or (at your option) any later version.
19 *
20 * libethercat is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with libethercat (LICENSE.LGPL-V3); if not, write
27 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
28 * Floor, Boston, MA 02110-1301, USA.
29 *
30 * Please note that the use of the EtherCAT technology, the EtherCAT
31 * brand name and the EtherCAT logo is only permitted if the property
32 * rights of Beckhoff Automation GmbH are observed. For further
33 * information please contact Beckhoff Automation GmbH & Co. KG,
34 * Hülshorstweg 20, D-33415 Verl, Germany (www.beckhoff.com) or the
35 * EtherCAT Technology Group, Ostendstraße 196, D-90482 Nuremberg,
36 * Germany (ETG, www.ethercat.org).
37 *
38 */
39
40#ifndef LIBETHERCAT_HW_FILE_H
41#define LIBETHERCAT_HW_FILE_H
42
43#include <libethercat/hw.h>
44
45typedef struct hw_file {
46 struct hw_common common;
47
48 int fd;
49
50 osal_uint8_t send_frame[ETH_FRAME_LEN];
51 osal_uint8_t recv_frame[ETH_FRAME_LEN];
52 osal_bool_t polling_mode;
53
54 // receiver thread settings in non-polling mode
55 osal_task_t rxthread;
57
58 int frames_send;
59
60} hw_file_t;
61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
67
75int hw_device_file_open(struct hw_file *phw, struct ec *pec, const osal_char_t *devname, int prio, int cpu_mask);
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif // LIBETHERCAT_HW_FILE_H
82
hardware access functions
int hw_device_file_open(struct hw_file *phw, struct ec *pec, const osal_char_t *devname, int prio, int cpu_mask)
Opens EtherCAT hw device.
ethercat master structure
Definition ec.h:188
hardware structure
Definition hw.h:123
struct ec * pec
Pointer to EtherCAT master structure.
Definition hw.h:124
Definition hw_file.h:45
int fd
file descriptor
Definition hw_file.h:48
osal_uint8_t send_frame[ETH_FRAME_LEN]
Static send frame.
Definition hw_file.h:50
osal_uint8_t recv_frame[ETH_FRAME_LEN]
Static receive frame.
Definition hw_file.h:51
osal_task_t rxthread
receiver thread handle
Definition hw_file.h:55
osal_bool_t polling_mode
Special interrupt-less polling-mode flag.
Definition hw_file.h:52
int rxthreadrunning
receiver thread running flag
Definition hw_file.h:56