IgH EtherCAT Master  1.6.1
domain.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_DOMAIN_H__
30 #define __EC_DOMAIN_H__
31 
32 #include <linux/list.h>
33 
34 #include "globals.h"
35 #include "datagram.h"
36 #include "master.h"
37 #include "fmmu_config.h"
38 
39 /****************************************************************************/
40 
46 struct ec_domain
47 {
48  struct list_head list;
50  unsigned int index;
52  struct list_head fmmu_configs;
53  size_t data_size;
54  uint8_t *data;
58  struct list_head datagram_pairs;
60  uint16_t working_counter[EC_MAX_NUM_DEVICES];
63  unsigned int working_counter_changes;
65  unsigned int redundancy_active;
66  unsigned long notify_jiffies;
67 };
68 
69 /****************************************************************************/
70 
71 void ec_domain_init(ec_domain_t *, ec_master_t *, unsigned int);
73 
75 int ec_domain_finish(ec_domain_t *, uint32_t);
76 
77 unsigned int ec_domain_fmmu_count(const ec_domain_t *);
78 const ec_fmmu_config_t *ec_domain_find_fmmu(const ec_domain_t *, unsigned int);
79 
80 /****************************************************************************/
81 
82 #endif
FMMU configuration.
Definition: fmmu_config.h:38
size_t data_size
Size of the process data.
Definition: domain.h:53
struct list_head list
List item.
Definition: domain.h:48
Global definitions and macros.
EtherCAT master structure.
unsigned int ec_domain_fmmu_count(const ec_domain_t *)
Get the number of FMMU configurations of the domain.
Definition: domain.c:331
uint8_t * data
Memory for the process data.
Definition: domain.h:54
int ec_domain_finish(ec_domain_t *, uint32_t)
Finishes a domain.
Definition: domain.c:225
unsigned int working_counter_changes
Working counter changes since last notification.
Definition: domain.h:63
void ec_domain_init(ec_domain_t *, ec_master_t *, unsigned int)
Domain constructor.
Definition: domain.c:57
unsigned int index
Index (just a number).
Definition: domain.h:50
struct list_head fmmu_configs
FMMU configurations contained.
Definition: domain.h:52
EtherCAT FMMU configuration structure.
EtherCAT datagram structure.
const ec_fmmu_config_t * ec_domain_find_fmmu(const ec_domain_t *, unsigned int)
Get a certain FMMU configuration via its position in the list.
Definition: domain.c:349
ec_origin_t data_origin
Origin of the data memory.
Definition: domain.h:55
uint16_t working_counter[EC_MAX_NUM_DEVICES]
Last working counter values.
Definition: domain.h:60
uint32_t logical_base_address
Logical offset address of the process data.
Definition: domain.h:56
void ec_domain_clear(ec_domain_t *)
Domain destructor.
Definition: domain.c:87
uint16_t expected_working_counter
Expected working counter.
Definition: domain.h:62
unsigned int redundancy_active
Non-zero, if redundancy is in use.
Definition: domain.h:65
ec_origin_t
Origin type.
Definition: globals.h:303
void ec_domain_add_fmmu_config(ec_domain_t *, ec_fmmu_config_t *)
Adds an FMMU configuration to the domain.
Definition: domain.c:121
struct list_head datagram_pairs
Datagrams pairs (main/backup) for process data exchange.
Definition: domain.h:58
EtherCAT master.
Definition: master.h:187
unsigned long notify_jiffies
Time of last notification.
Definition: domain.h:66
EtherCAT domain.
Definition: domain.h:46
ec_master_t * master
EtherCAT master owning the domain.
Definition: domain.h:49