From 19d31412f7bc9bf9572ff2f3043bbe92b67b898f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 29 Nov 2014 07:08:30 -0600 Subject: [PATCH] Update/correct some comments --- drivers/input/Kconfig | 5 +++-- drivers/input/ajoystick.c | 11 +++++++++++ drivers/input/djoystick.c | 11 +++++++++++ include/nuttx/input/ajoystick.h | 9 ++++++--- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index 12717e2f65..2a58768f47 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -347,8 +347,9 @@ config AJOYSTICK ---help--- Enable standard analog joystick upper half driver. An analog joystick refers to a joystick that provides position data as an - integer value that might have been obtained through DACs. - Discrete button inputs are also supported. + integer value that might have been obtained through Analog- + to-Digital Conversion (ADC). The analog positional data may also + be accompanied by discrete button data. if AJOYSTICK diff --git a/drivers/input/ajoystick.c b/drivers/input/ajoystick.c index 4ab7e6dd63..1054b8ca37 100644 --- a/drivers/input/ajoystick.c +++ b/drivers/input/ajoystick.c @@ -33,6 +33,17 @@ * ****************************************************************************/ +/* This file provides a driver for a standard analog joystick device. An + * analog joystick refers to a joystick that provides X/Y positional data as + * integer values such as might be provides by Analog-to-Digital Conversion + * (ADC). The analog positional data may also be accompanied by discrete + * button data. + * + * The analog joystick driver exports a standard character driver + * interface. By convention, the analog joystick is registered as an input + * device at /dev/ajoyN where N uniquely identifies the driver instance. + */ + /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/drivers/input/djoystick.c b/drivers/input/djoystick.c index 80e704851f..0e746634f2 100644 --- a/drivers/input/djoystick.c +++ b/drivers/input/djoystick.c @@ -33,6 +33,17 @@ * ****************************************************************************/ +/* This file provides a driver for a standard discrete joystick device. A + * discrete joystick refers to a joystick that could be implemented entirely + * with GPIO input pins. So up, down, left, and right are all discrete + * values like buttons (as opposed to integer values like you might obtain + * from an analog joystick). + * + * The discrete joystick driver exports a standard character driver + * interface. By convention, the discrete joystick is registered as an input + * device at /dev/djoyN where N uniquely identifies the driver instance. + */ + /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/include/nuttx/input/ajoystick.h b/include/nuttx/input/ajoystick.h index 3537f15f1a..12f8ae4067 100644 --- a/include/nuttx/input/ajoystick.h +++ b/include/nuttx/input/ajoystick.h @@ -35,8 +35,9 @@ /* This header file provides definition for a standard analog joystick * interface. An analog joystick refers to a joystick that provides X/Y - * positional data as integer values such as might be provides by DACs. - * The analog positional data may be accompanied by discrete button data. + * positional data as integer values such as might be provides by Analog- + * to-Digital Conversion (ADC). The analog positional data may also be + * accompanied by discrete button data. * * The analog joystick driver exports a standard character driver * interface. By convention, the analog joystick is registered as an input @@ -109,7 +110,9 @@ * * 1) The read() method will always return a single value of size * struct ajoy_sample_s represent the current joystick positional and the - * state of all joystick buttons. read() never blocks. + * state of all joystick buttons. read() never blocks. X an Y position + * data is raw converted data. Zeroing and scaling must be performed by + * the application. * 2) The poll() method can be used to notify a client if there is a change * in any of the joystick button inputs. This feature, of course, * depends upon interrupt GPIO support from the platform. NOTE: that