summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-05-23 18:25:02 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-05-23 18:25:02 -0600
commit4ed66f6618f4d13276d3135e9e2bfc6f8b5a2c3e (patch)
treec8bcf09c9e12324b377d62dd8fe9401b2cd3b38e /nuttx/include
parent8bff850a667d4a7e4be5fd09d83fbb9e5e8f1f68 (diff)
downloadpx4-nuttx-4ed66f6618f4d13276d3135e9e2bfc6f8b5a2c3e.tar.gz
px4-nuttx-4ed66f6618f4d13276d3135e9e2bfc6f8b5a2c3e.tar.bz2
px4-nuttx-4ed66f6618f4d13276d3135e9e2bfc6f8b5a2c3e.zip
Add SLCD ioctl commands
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/fs/ioctl.h11
-rw-r--r--nuttx/include/nuttx/lcd/slcd_codec.h52
2 files changed, 57 insertions, 6 deletions
diff --git a/nuttx/include/nuttx/fs/ioctl.h b/nuttx/include/nuttx/fs/ioctl.h
index 1e44729af..c22ead682 100644
--- a/nuttx/include/nuttx/fs/ioctl.h
+++ b/nuttx/include/nuttx/fs/ioctl.h
@@ -67,6 +67,7 @@
#define _BATIOCBASE (0x0e00) /* Battery driver ioctl commands */
#define _QEIOCBASE (0x0f00) /* Quadrature encoder ioctl commands */
#define _AUDIOIOCBASE (0x1000) /* Audio ioctl commands */
+#define _SLCDIOCBASE (0x1100) /* Segment LCD ioctl commands */
/* Macros used to manage ioctl commands */
@@ -227,18 +228,24 @@
#define _BATIOCVALID(c) (_IOC_TYPE(c)==_BATIOCBASE)
#define _BATIOC(nr) _IOC(_BATIOCBASE,nr)
-/* NuttX Quadrature Encoder driver ioctol definitions ***********************/
+/* NuttX Quadrature Encoder driver ioctl definitions ************************/
/* (see nuttx/power/battery.h) */
#define _QEIOCVALID(c) (_IOC_TYPE(c)==_QEIOCBASE)
#define _QEIOC(nr) _IOC(_QEIOCBASE,nr)
-/* NuttX Audio driver ioctol definitions ***********************/
+/* NuttX Audio driver ioctl definitions ************************************/
/* (see nuttx/audio/audio.h) */
#define _AUDIOIOCVALID(c) (_IOC_TYPE(c)==_AUDIOIOCBASE)
#define _AUDIOIOC(nr) _IOC(_AUDIOIOCBASE,nr)
+/* Segment LCD driver ioctl definitions ************************************/
+/* (see nuttx/include/lcd/slcd_codec.h */
+
+#define _SLCDIOCVALID(c) (_IOC_TYPE(c)==_SLCDIOCBASE)
+#define _SLCDIOC(nr) _IOC(_SLCDIOCBASE,nr)
+
/****************************************************************************
* Public Type Definitions
****************************************************************************/
diff --git a/nuttx/include/nuttx/lcd/slcd_codec.h b/nuttx/include/nuttx/lcd/slcd_codec.h
index 4a9ff312d..a6c2ee353 100644
--- a/nuttx/include/nuttx/lcd/slcd_codec.h
+++ b/nuttx/include/nuttx/lcd/slcd_codec.h
@@ -43,12 +43,52 @@
#include <nuttx/config.h>
#include <nuttx/streams.h>
+#include <nuttx/fs/ioctl.h>
#ifdef CONFIG_LIB_SLCDCODEC
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+/* IOCTL commands that may be supported by some SLCD drivers */
+
+/* SLCDIOC_GEOMETRY: Get the SLCD geometry (rows x characters)
+ *
+ * argument: Pointer to struct slcd_geometry_s in which values will be
+ * returned
+ */
+
+#define SLCDIOC_GEOMETRY _SLCDIOC(0x0001)
+
+/* SLCDIOC_SETBAR: Set bars on a bar display
+ *
+ * argument: 32-bit bitset, with each bit corresponding to one bar.
+ */
+
+#define SLCDIOC_SETBAR _SLCDIOC(0x0002)
+
+/* SLCDIOC_GETCONTRAST: Get the current contrast setting
+ *
+ * argument: Pointer type int that will receive the current contrast
+ * setting
+ */
+
+#define SLCDIOC_GETCONTRAST _SLCDIOC(0x0003)
+
+/* SLCDIOC_MAXCONTRAST: Get the maximum contrast setting
+ *
+ * argument: Pointer type int that will receive the maximum contrast
+ * setting
+ */
+
+#define SLCDIOC_MAXCONTRAST _SLCDIOC(0x0004)
+
+/* SLCDIOC_SETCONTRAST: Set the contrast to a new value
+ *
+ * argument: The new contrast value
+ */
+
+#define SLCDIOC_SETCONTRAST _SLCDIOC(0x0005)
/****************************************************************************
* Public Types
@@ -102,10 +142,14 @@ enum slcdret_e
SLCDRET_EOF /* An EOF (or possibly an error) occurred */
};
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
+/* Used with the SLCDIOC_GEOMETRY ioctl call */
+
+struct slcd_geometry_s
+{
+ uint16_t nrows; /* Number of the rows on the SLCD */
+ uint16_t ncolumns; /* Number of characters in one row on the SLCD */
+};
+
/* Working data needed by slcd_encode that must be provided and initialized
* by the caller.
*/