80 {} |
80 {} |
81 }; |
81 }; |
82 |
82 |
83 /*****************************************************************************/ |
83 /*****************************************************************************/ |
84 |
84 |
85 #ifdef CONFIGURE_MAPPING |
85 #ifdef CONFIGURE_PDOS |
86 static ec_pdo_entry_info_t el3162_channel1[] = { |
86 static ec_pdo_entry_info_t el3162_channel1[] = { |
87 {0x3101, 1, 8}, // status |
87 {0x3101, 1, 8}, // status |
88 {0x3101, 2, 16} // value |
88 {0x3101, 2, 16} // value |
89 }; |
89 }; |
90 |
90 |
91 static ec_pdo_entry_info_t el3162_channel2[] = { |
91 static ec_pdo_entry_info_t el3162_channel2[] = { |
92 {0x3102, 1, 8}, // status |
92 {0x3102, 1, 8}, // status |
93 {0x3102, 2, 16} // value |
93 {0x3102, 2, 16} // value |
94 }; |
94 }; |
95 |
95 |
96 static ec_pdo_info_t el3162_mapping[] = { |
96 static ec_pdo_info_t el3162_pdos[] = { |
97 {EC_DIR_INPUT, 0x1A00, 2, el3162_channel1}, |
97 {EC_DIR_INPUT, 0x1A00, 2, el3162_channel1}, |
98 {EC_DIR_INPUT, 0x1A01, 2, el3162_channel2}, |
98 {EC_DIR_INPUT, 0x1A01, 2, el3162_channel2}, |
99 {EC_MAP_END} |
99 {EC_END} |
100 }; |
100 }; |
101 |
101 |
102 static ec_pdo_entry_info_t el2004_channels[] = { |
102 static ec_pdo_entry_info_t el2004_channels[] = { |
103 {0x3001, 1, 1}, // Value 1 |
103 {0x3001, 1, 1}, // Value 1 |
104 {0x3001, 2, 1}, // Value 2 |
104 {0x3001, 2, 1}, // Value 2 |
105 {0x3001, 3, 1}, // Value 3 |
105 {0x3001, 3, 1}, // Value 3 |
106 {0x3001, 4, 1} // Value 4 |
106 {0x3001, 4, 1} // Value 4 |
107 }; |
107 }; |
108 |
108 |
109 static ec_pdo_info_t el2004_mapping[] = { |
109 static ec_pdo_info_t el2004_pdos[] = { |
110 {EC_DIR_OUTPUT, 0x1600, 1, &el2004_channels[0]}, |
110 {EC_DIR_OUTPUT, 0x1600, 1, &el2004_channels[0]}, |
111 {EC_DIR_OUTPUT, 0x1601, 1, &el2004_channels[1]}, |
111 {EC_DIR_OUTPUT, 0x1601, 1, &el2004_channels[1]}, |
112 {EC_DIR_OUTPUT, 0x1602, 1, &el2004_channels[2]}, |
112 {EC_DIR_OUTPUT, 0x1602, 1, &el2004_channels[2]}, |
113 {EC_DIR_OUTPUT, 0x1603, 1, &el2004_channels[3]}, |
113 {EC_DIR_OUTPUT, 0x1603, 1, &el2004_channels[3]}, |
114 }; |
114 }; |
271 if (!(domain1 = ecrt_master_create_domain(master))) { |
271 if (!(domain1 = ecrt_master_create_domain(master))) { |
272 printk(KERN_ERR PFX "Domain creation failed!\n"); |
272 printk(KERN_ERR PFX "Domain creation failed!\n"); |
273 goto out_release_master; |
273 goto out_release_master; |
274 } |
274 } |
275 |
275 |
276 #ifdef CONFIGURE_MAPPING |
276 #ifdef CONFIGURE_PDOS |
277 printk(KERN_INFO PFX "Configuring Pdo mapping...\n"); |
277 printk(KERN_INFO PFX "Configuring Pdos...\n"); |
278 if (!(sc = ecrt_master_slave_config(master, 0, 1, Beckhoff_EL3162))) { |
278 if (!(sc = ecrt_master_slave_config(master, 0, 1, Beckhoff_EL3162))) { |
279 printk(KERN_ERR PFX "Failed to get slave configuration.\n"); |
279 printk(KERN_ERR PFX "Failed to get slave configuration.\n"); |
280 goto out_release_master; |
280 goto out_release_master; |
281 } |
281 } |
282 |
282 |
283 if (ecrt_slave_config_mapping(sc, EC_MAP_END, el3162_mapping)) { |
283 if (ecrt_slave_config_pdos(sc, EC_END, el3162_pdos)) { |
284 printk(KERN_ERR PFX "Failed to configure Pdo mapping.\n"); |
284 printk(KERN_ERR PFX "Failed to configure Pdos.\n"); |
285 goto out_release_master; |
285 goto out_release_master; |
286 } |
286 } |
287 |
287 |
288 if (!(sc = ecrt_master_slave_config(master, 0, 3, Beckhoff_EL2004))) { |
288 if (!(sc = ecrt_master_slave_config(master, 0, 3, Beckhoff_EL2004))) { |
289 printk(KERN_ERR PFX "Failed to get slave configuration.\n"); |
289 printk(KERN_ERR PFX "Failed to get slave configuration.\n"); |
290 goto out_release_master; |
290 goto out_release_master; |
291 } |
291 } |
292 |
292 |
293 if (ecrt_slave_config_mapping(sc, 4, el2004_mapping)) { |
293 if (ecrt_slave_config_pdos(sc, 4, el2004_pdos)) { |
294 printk(KERN_ERR PFX "Failed to configure Pdo mapping.\n"); |
294 printk(KERN_ERR PFX "Failed to configure Pdos.\n"); |
295 goto out_release_master; |
295 goto out_release_master; |
296 } |
296 } |
297 #endif |
297 #endif |
298 |
298 |
299 #ifdef SDO_ACCESS |
299 #ifdef SDO_ACCESS |