From owner-freebsd-drivers@FreeBSD.ORG Tue Dec 9 21:46:10 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233A81065690 for ; Tue, 9 Dec 2008 21:46:10 +0000 (UTC) (envelope-from elbarto@arcadebsd.org) Received: from mail.arcadebsd.org (sd-16356.dedibox.fr [88.191.88.233]) by mx1.freebsd.org (Postfix) with ESMTP id E1D7A8FC19 for ; Tue, 9 Dec 2008 21:46:09 +0000 (UTC) (envelope-from elbarto@arcadebsd.org) Received: from [192.168.0.1] (home.elbarto.org [82.229.222.193]) (Authenticated sender: elbarto) by mail.arcadebsd.org (Postfix) with ESMTPA id D90A63417F for ; Tue, 9 Dec 2008 22:29:47 +0100 (CET) Message-ID: <493EE331.8070708@arcadebsd.org> Date: Tue, 09 Dec 2008 22:29:21 +0100 From: ElBarto User-Agent: Thunderbird 2.0.0.18 (X11/20081129) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: USB Joystick/gamepad driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 21:46:10 -0000 Hello all, I've started a driver for usb joystick and gamepad. The goal of this driver is to have a complete support for HID and non-HID device. For now it support HID device and (partially) the Xbox360 gamepad. The driver create a ujoy%d device in /dev . For now the data are like this : AXIS_X AXIS_Y AXIS_Z AXIS_RX AXIS_RY AXIS_RZ SLIDER HAT_SWITCH BUTTONS All coded in one int each. I'll next add some ioctl to, for example, find which axis is present for the joystick etc .... There is of course no userland application which support this driver, I'm planning to re-do the sdl support for this driver, but before I want to standardize the driver. You can download the driver and a small crappy userland application here : http://www.arcadebsd.org/~elbarto/ujoy.tgz This has been tested on FreeBSD 7.0 with two different Thrustmaster gamepad and a Xbox360 one. Comments ? Suggestions ? -- Emmanuel Vadot elbarto@arcadebsd.org