Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  *
0004  * display7seg - Driver interface for the 7-segment display
0005  * present on Sun Microsystems CP1400 and CP1500
0006  *
0007  * Copyright (c) 2000 Eric Brower <ebrower@usa.net>
0008  *
0009  */
0010 
0011 #ifndef __display7seg_h__
0012 #define __display7seg_h__
0013 
0014 #define D7S_IOC 'p'
0015 
0016 #define D7SIOCRD _IOR(D7S_IOC, 0x45, int)   /* Read device state    */
0017 #define D7SIOCWR _IOW(D7S_IOC, 0x46, int)   /* Write device state   */
0018 #define D7SIOCTM _IO (D7S_IOC, 0x47)        /* Translate mode (FLIP)*/
0019 
0020 /*
0021  * ioctl flag definitions
0022  *
0023  * POINT    - Toggle decimal point  (0=absent 1=present)
0024  * ALARM    - Toggle alarm LED      (0=green  1=red)
0025  * FLIP     - Toggle inverted mode  (0=normal 1=flipped)
0026  * bits 0-4 - Character displayed   (see definitions below)
0027  *
0028  * Display segments are defined as follows,
0029  * subject to D7S_FLIP register state:
0030  *
0031  *    a
0032  *   ---
0033  * f|   |b
0034  *   -g-
0035  * e|   |c
0036  *   ---
0037  *    d
0038  */
0039 
0040 #define D7S_POINT   (1 << 7)    /* Decimal point*/
0041 #define D7S_ALARM   (1 << 6)    /* Alarm LED    */
0042 #define D7S_FLIP    (1 << 5)    /* Flip display */
0043 
0044 #define D7S_0       0x00        /* Numerals 0-9 */
0045 #define D7S_1       0x01
0046 #define D7S_2       0x02
0047 #define D7S_3       0x03
0048 #define D7S_4       0x04
0049 #define D7S_5       0x05
0050 #define D7S_6       0x06
0051 #define D7S_7       0x07
0052 #define D7S_8       0x08
0053 #define D7S_9       0x09
0054 #define D7S_A       0x0A        /* Letters A-F, H, L, P */
0055 #define D7S_B       0x0B
0056 #define D7S_C       0x0C
0057 #define D7S_D       0x0D
0058 #define D7S_E       0x0E
0059 #define D7S_F       0x0F
0060 #define D7S_H       0x10
0061 #define D7S_E2      0x11
0062 #define D7S_L       0x12
0063 #define D7S_P       0x13
0064 #define D7S_SEGA    0x14        /* Individual segments */
0065 #define D7S_SEGB    0x15
0066 #define D7S_SEGC    0x16
0067 #define D7S_SEGD    0x17
0068 #define D7S_SEGE    0x18
0069 #define D7S_SEGF    0x19
0070 #define D7S_SEGG    0x1A
0071 #define D7S_SEGABFG 0x1B        /* Segment groupings */
0072 #define D7S_SEGCDEG 0x1C
0073 #define D7S_SEGBCEF 0x1D
0074 #define D7S_SEGADG  0x1E
0075 #define D7S_BLANK   0x1F        /* Clear all segments */
0076 
0077 #define D7S_MIN_VAL 0x0
0078 #define D7S_MAX_VAL 0x1F
0079 
0080 #endif /* ifndef __display7seg_h__ */