00001 /****************************************************************************** 00002 * 00003 * $Id: canopen.h 682 2006-11-07 12:13:30Z fp $ 00004 * 00005 * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH 00006 * 00007 * This file is part of the IgH EtherCAT Master. 00008 * 00009 * The IgH EtherCAT Master is free software; you can redistribute it 00010 * and/or modify it under the terms of the GNU General Public License 00011 * as published by the Free Software Foundation; either version 2 of the 00012 * License, or (at your option) any later version. 00013 * 00014 * The IgH EtherCAT Master is distributed in the hope that it will be 00015 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with the IgH EtherCAT Master; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00022 * 00023 * The right to use EtherCAT Technology is granted and comes free of 00024 * charge under condition of compatibility of product made by 00025 * Licensee. People intending to distribute/sell products based on the 00026 * code, have to sign an agreement to guarantee that products using 00027 * software based on IgH EtherCAT master stay compatible with the actual 00028 * EtherCAT specification (which are released themselves as an open 00029 * standard) as the (only) precondition to have the right to use EtherCAT 00030 * Technology, IP and trade marks. 00031 * 00032 *****************************************************************************/ 00033 00039 /*****************************************************************************/ 00040 00041 #ifndef _EC_CANOPEN_H_ 00042 #define _EC_CANOPEN_H_ 00043 00044 #include <linux/list.h> 00045 #include <linux/kobject.h> 00046 00047 #include "globals.h" 00048 #include "slave.h" 00049 00050 /*****************************************************************************/ 00051 00056 typedef struct 00057 { 00058 struct kobject kobj; 00059 struct list_head list; 00060 ec_slave_t *slave; 00061 uint16_t index; 00062 uint8_t object_code; 00063 char *name; 00064 uint8_t subindices; 00065 struct list_head entries; 00066 } 00067 ec_sdo_t; 00068 00069 /*****************************************************************************/ 00070 00075 typedef struct 00076 { 00077 struct kobject kobj; 00078 struct list_head list; 00079 ec_sdo_t *sdo; 00080 uint8_t subindex; 00081 uint16_t data_type; 00082 uint16_t bit_length; 00083 char *description; 00084 } 00085 ec_sdo_entry_t; 00086 00087 /*****************************************************************************/ 00088 00093 typedef struct 00094 { 00095 struct list_head list; 00096 uint16_t index; 00097 uint8_t subindex; 00098 uint8_t *data; 00099 size_t size; 00100 } 00101 ec_sdo_data_t; 00102 00103 /*****************************************************************************/ 00104 00109 typedef struct 00110 { 00111 struct list_head queue; 00112 ec_sdo_t *sdo; 00113 ec_sdo_entry_t *entry; 00114 uint8_t *data; 00115 size_t size; 00116 int return_code; 00117 } 00118 ec_sdo_request_t; 00119 00120 /*****************************************************************************/ 00121 00122 int ec_sdo_init(ec_sdo_t *, uint16_t, ec_slave_t *); 00123 void ec_sdo_destroy(ec_sdo_t *); 00124 00125 int ec_sdo_entry_init(ec_sdo_entry_t *, uint8_t, ec_sdo_t *); 00126 void ec_sdo_entry_destroy(ec_sdo_entry_t *); 00127 00128 /*****************************************************************************/ 00129 00130 #endif
1.4.4