summaryrefslogtreecommitdiff
path: root/nuttx/include/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-28 15:39:57 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-28 15:39:57 -0600
commit8f19ca38293a6615be3fd6b2ec43f59bc1892010 (patch)
tree975ed38ef3369ac9054734e184435a5f049f34bb /nuttx/include/nuttx
parent98bb52c4a4b7a48ac508adfb6206368166cc356b (diff)
downloadnuttx-8f19ca38293a6615be3fd6b2ec43f59bc1892010.tar.gz
nuttx-8f19ca38293a6615be3fd6b2ec43f59bc1892010.tar.bz2
nuttx-8f19ca38293a6615be3fd6b2ec43f59bc1892010.zip
DJoystick: Add a new ioctl to get the support joystick discrete signals
Diffstat (limited to 'nuttx/include/nuttx')
-rw-r--r--nuttx/include/nuttx/input/djoystick.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/nuttx/include/nuttx/input/djoystick.h b/nuttx/include/nuttx/input/djoystick.h
index 32f30eaeb..14ef508ce 100644
--- a/nuttx/include/nuttx/input/djoystick.h
+++ b/nuttx/include/nuttx/input/djoystick.h
@@ -80,6 +80,7 @@
#define DJOY_BUTTON_2 (5) /* Bit 5: Button 2 */
#define DJOY_BUTTON_3 (6) /* Bit 6: Button 3 */
#define DJOY_BUTTON_4 (7) /* Bit 7: Button 4 */
+#define DJOY_NDISCRETES (8) /* Total number of discrete signals */
#define DJOY_UP_BIT (1 << DJOY_UP) /* 1:Joystick UP selected */
#define DJOY_DOWN_BIT (1 << DJOY_DOWN) /* 1:Joystick DOWN selected */
@@ -112,12 +113,27 @@
*
* 1) The read() method will always return a single value of size
* djoy_buttonset_t represent the current state of the joystick buttons.
+ * read() never blocks.
* 2) The poll() method can be used to notify a client if there is a change
* in any of the joystick discrete inputs. This feature, of course,
- * depends upon interrupt GPIO support from the platform.
+ * depends upon interrupt GPIO support from the platform. NOTE: that
+ * semantics of poll() for POLLIN are atypical: The successful poll
+ * means that the data has changed and has nothing to with the
+ * availability of data to be read; data is always available to be
+ * read.
* 3) The ioctl() method supports the commands documented below:
*/
+/* Command: DJOYIOC_SUPPORTED
+ * Description: Report the set of button events supported by the hardware;
+ * Argument: A pointer to writeable integer value in which to return the
+ * set of supported buttons.
+ * Return: Zero (OK) on success. Minus one will be returned on failure
+ * with the errno value set appropriately.
+ */
+
+#define DJOYIOC_SUPPORTED _DJOYIOC(0x0001)
+
/* Command: DJOYIOC_POLLEVENTS
* Description: Specify the set of button events that can cause a poll()
* to awaken. The default is all button depressions and all
@@ -127,7 +143,7 @@
* with the errno value set appropriately.
*/
-#define DJOYIOC_POLLEVENTS _DJOYIOC(0x0001)
+#define DJOYIOC_POLLEVENTS _DJOYIOC(0x0002)
/* Command: DJOYIOC_REGISTER
* Description: Register to receive a signal whenever there is a change in
@@ -139,7 +155,7 @@
* with the errno value set appropriately.
*/
-#define DJOYIOC_REGISTER _DJOYIOC(0x0002)
+#define DJOYIOC_REGISTER _DJOYIOC(0x0003)
/****************************************************************************
* Public Types