IgH EtherCAT Master  1.6.2
soe_request.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
4  *
5  * This file is part of the IgH EtherCAT Master.
6  *
7  * The IgH EtherCAT Master is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License version 2, as
9  * published by the Free Software Foundation.
10  *
11  * The IgH EtherCAT Master is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14  * Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with the IgH EtherCAT Master; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  ****************************************************************************/
21 
27 /****************************************************************************/
28 
29 #ifndef __EC_SOE_REQUEST_H__
30 #define __EC_SOE_REQUEST_H__
31 
32 #include <linux/list.h>
33 
34 #include "globals.h"
35 
36 /****************************************************************************/
37 
41  struct list_head list;
42  uint8_t drive_no;
43  uint16_t idn;
45  uint8_t *data;
46  size_t mem_size;
47  size_t data_size;
48  uint32_t issue_timeout;
53  unsigned long jiffies_start;
54  unsigned long jiffies_sent;
56  uint16_t error_code;
57 };
58 
59 /****************************************************************************/
60 
63 
68 int ec_soe_request_copy_data(ec_soe_request_t *, const uint8_t *, size_t);
69 int ec_soe_request_append_data(ec_soe_request_t *, const uint8_t *, size_t);
73 
74 /****************************************************************************/
75 
76 #endif
uint16_t error_code
SoE error code.
Definition: soe_request.h:56
int ec_soe_request_write(ec_soe_request_t *)
Request a write operation.
Definition: soe_request.c:241
ec_al_state_t
Application-layer state.
Definition: ecrt.h:615
int ec_soe_request_timed_out(const ec_soe_request_t *)
Checks, if the timeout was exceeded.
Definition: soe_request.c:258
ec_direction_t dir
Direction.
Definition: soe_request.h:50
void ec_soe_request_clear(ec_soe_request_t *)
SoE request destructor.
Definition: soe_request.c:71
size_t data_size
Size of SDO data.
Definition: soe_request.h:47
Global definitions and macros.
ec_al_state_t al_state
AL state (only valid for IDN config).
Definition: soe_request.h:44
void ec_soe_request_set_drive_no(ec_soe_request_t *, uint8_t)
Set drive number.
Definition: soe_request.c:99
unsigned long jiffies_start
Jiffies, when the request was issued.
Definition: soe_request.h:53
ec_internal_request_state_t
Generic request state.
Definition: globals.h:287
uint32_t issue_timeout
Maximum time in ms, the processing of the request may take.
Definition: soe_request.h:48
int ec_soe_request_append_data(ec_soe_request_t *, const uint8_t *, size_t)
Copies SoE data from an external source.
Definition: soe_request.c:197
void ec_soe_request_init(ec_soe_request_t *)
SoE request constructor.
Definition: soe_request.c:48
struct list_head list
List item.
Definition: soe_request.h:41
ec_direction_t
Direction type for PDO assignment functions.
Definition: ecrt.h:504
int ec_soe_request_alloc(ec_soe_request_t *, size_t)
Pre-allocates the data memory.
Definition: soe_request.c:144
int ec_soe_request_read(ec_soe_request_t *)
Request a read operation.
Definition: soe_request.c:226
void ec_soe_request_set_idn(ec_soe_request_t *, uint16_t)
Set IDN.
Definition: soe_request.c:111
uint8_t drive_no
Drive number.
Definition: soe_request.h:42
int ec_soe_request_copy_data(ec_soe_request_t *, const uint8_t *, size_t)
Copies SoE data from an external source.
Definition: soe_request.c:173
unsigned long jiffies_sent
Jiffies, when the upload/download request was sent.
Definition: soe_request.h:54
size_t mem_size
Size of SDO data memory.
Definition: soe_request.h:46
uint16_t idn
Sercos ID-Number.
Definition: soe_request.h:43
int ec_soe_request_copy(ec_soe_request_t *, const ec_soe_request_t *)
Copy another SoE request.
Definition: soe_request.c:84
ec_internal_request_state_t state
Request state.
Definition: soe_request.h:52
Sercos-over-EtherCAT request.
Definition: soe_request.h:40
uint8_t * data
Pointer to SDO data.
Definition: soe_request.h:45