Add SLCD ioctl commands

This commit is contained in:
Gregory Nutt
2013-05-23 18:25:02 -06:00
parent dc96808087
commit 4da4094c0d
5 changed files with 209 additions and 23 deletions
+9 -2
View File
@@ -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
****************************************************************************/
+48 -4
View File
@@ -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.
*/