// SPDX-License-Identifier: GPL-2.0-or-later /* * Force feedback support for Logitech Flight System G940 * * Copyright (c) 2009 Gary Stein <LordCnidarian@gmail.com>
*/
/*
*/
#include <linux/input.h> #include <linux/hid.h>
#include"hid-lg.h"
/* * G940 Theory of Operation (from experimentation) * * There are 63 fields (only 3 of them currently used) * 0 - seems to be command field * 1 - 30 deal with the x axis * 31 -60 deal with the y axis * * Field 1 is x axis constant force * Field 31 is y axis constant force * * other interesting fields 1,2,3,4 on x axis * (same for 31,32,33,34 on y axis) * * 0 0 127 127 makes the joystick autocenter hard * * 127 0 127 127 makes the joystick loose on the right, * but stops all movemnt left * * -127 0 -127 -127 makes the joystick loose on the left, * but stops all movement right * * 0 0 -127 -127 makes the joystick rattle very hard * * I'm sure these are effects that I don't know enough about them
*/
/* * Available values in the field should always be 63, but we only use up to * 35. Instead, clear the entire area, however big it is.
*/
memset(report->field[0]->value, 0, sizeof(__s32) * report->field[0]->report_count);
switch (effect->type) { case FF_CONSTANT: /* * Already clamped in ff_memless * 0 is center (different then other logitech)
*/
x = effect->u.ramp.start_level;
y = effect->u.ramp.end_level;
/* * Sign backwards from other Force3d pro * which get recast here in two's complement 8 bits
*/
report->field[0]->value[1] = (unsignedchar)(-x);
report->field[0]->value[31] = (unsignedchar)(-y);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.