Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
return ec_slave_conf_sdo(slave, sdo_index, sdo_subindex, data, 2);
}
/*****************************************************************************/
/**
\return 0 in case of success, else < 0
\ingroup RealtimeInterface
*/
int ecrt_slave_conf_sdo32(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
uint8_t sdo_subindex, /**< SDO subindex */
uint32_t value /**< new SDO value */
)
{
uint8_t data[4];
EC_WRITE_U32(data, value);
return ec_slave_conf_sdo(slave, sdo_index, sdo_subindex, data, 4);
}
/*****************************************************************************/
/**
\return 0 in case of success, else < 0
\ingroup RealtimeInterface
*/
int ecrt_slave_pdo_size(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t pdo_index, /**< PDO index */
uint8_t pdo_subindex, /**< PDO subindex */
size_t size /**< new PDO size */
)
EC_WARN("ecrt_slave_pdo_size() currently not available.\n");
return -1;
#if 0
const ec_sii_sync_t *sync;
const ec_pdo_t *pdo;
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
ec_varsize_t *var;
if (!slave->type) {
EC_ERR("Slave %i has no type information!\n", slave->ring_position);
return -1;
}
field_counter = 0;
for (i = 0; (sync = slave->type->sync_managers[i]); i++) {
for (j = 0; (field = sync->fields[j]); j++) {
if (!strcmp(field->name, field_name)) {
if (field_counter++ == field_index) {
// is the size of this field variable?
if (field->size) {
EC_ERR("Field \"%s\"[%i] of slave %i has no variable"
" size!\n", field->name, field_index,
slave->ring_position);
return -1;
}
// does a size specification already exist?
list_for_each_entry(var, &slave->varsize_fields, list) {
if (var->field == field) {
EC_WARN("Resizing field \"%s\"[%i] of slave %i.\n",
field->name, field_index,
slave->ring_position);
var->size = size;
return 0;
}
}
// create a new size specification...
if (!(var = kmalloc(sizeof(ec_varsize_t), GFP_KERNEL))) {
EC_ERR("Failed to allocate memory for varsize_t!\n");
return -1;
}
var->field = field;
var->size = size;
list_add_tail(&var->list, &slave->varsize_fields);
return 0;
}
}
}
}
EC_ERR("Slave %i (\"%s %s\") has no field \"%s\"[%i]!\n",
slave->ring_position, slave->type->vendor_name,
slave->type->product_name, field_name, field_index);
return -1;
}
/*****************************************************************************/
/**< \cond */
EXPORT_SYMBOL(ecrt_slave_conf_sdo8);
EXPORT_SYMBOL(ecrt_slave_conf_sdo16);
EXPORT_SYMBOL(ecrt_slave_conf_sdo32);
EXPORT_SYMBOL(ecrt_slave_pdo_size);
/**< \endcond */
/*****************************************************************************/