18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * display7seg - Driver interface for the 7-segment display 58c2ecf20Sopenharmony_ci * present on Sun Microsystems CP1400 and CP1500 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Copyright (c) 2000 Eric Brower <ebrower@usa.net> 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifndef __display7seg_h__ 128c2ecf20Sopenharmony_ci#define __display7seg_h__ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define D7S_IOC 'p' 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#define D7SIOCRD _IOR(D7S_IOC, 0x45, int) /* Read device state */ 178c2ecf20Sopenharmony_ci#define D7SIOCWR _IOW(D7S_IOC, 0x46, int) /* Write device state */ 188c2ecf20Sopenharmony_ci#define D7SIOCTM _IO (D7S_IOC, 0x47) /* Translate mode (FLIP)*/ 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* 218c2ecf20Sopenharmony_ci * ioctl flag definitions 228c2ecf20Sopenharmony_ci * 238c2ecf20Sopenharmony_ci * POINT - Toggle decimal point (0=absent 1=present) 248c2ecf20Sopenharmony_ci * ALARM - Toggle alarm LED (0=green 1=red) 258c2ecf20Sopenharmony_ci * FLIP - Toggle inverted mode (0=normal 1=flipped) 268c2ecf20Sopenharmony_ci * bits 0-4 - Character displayed (see definitions below) 278c2ecf20Sopenharmony_ci * 288c2ecf20Sopenharmony_ci * Display segments are defined as follows, 298c2ecf20Sopenharmony_ci * subject to D7S_FLIP register state: 308c2ecf20Sopenharmony_ci * 318c2ecf20Sopenharmony_ci * a 328c2ecf20Sopenharmony_ci * --- 338c2ecf20Sopenharmony_ci * f| |b 348c2ecf20Sopenharmony_ci * -g- 358c2ecf20Sopenharmony_ci * e| |c 368c2ecf20Sopenharmony_ci * --- 378c2ecf20Sopenharmony_ci * d 388c2ecf20Sopenharmony_ci */ 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci#define D7S_POINT (1 << 7) /* Decimal point*/ 418c2ecf20Sopenharmony_ci#define D7S_ALARM (1 << 6) /* Alarm LED */ 428c2ecf20Sopenharmony_ci#define D7S_FLIP (1 << 5) /* Flip display */ 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci#define D7S_0 0x00 /* Numerals 0-9 */ 458c2ecf20Sopenharmony_ci#define D7S_1 0x01 468c2ecf20Sopenharmony_ci#define D7S_2 0x02 478c2ecf20Sopenharmony_ci#define D7S_3 0x03 488c2ecf20Sopenharmony_ci#define D7S_4 0x04 498c2ecf20Sopenharmony_ci#define D7S_5 0x05 508c2ecf20Sopenharmony_ci#define D7S_6 0x06 518c2ecf20Sopenharmony_ci#define D7S_7 0x07 528c2ecf20Sopenharmony_ci#define D7S_8 0x08 538c2ecf20Sopenharmony_ci#define D7S_9 0x09 548c2ecf20Sopenharmony_ci#define D7S_A 0x0A /* Letters A-F, H, L, P */ 558c2ecf20Sopenharmony_ci#define D7S_B 0x0B 568c2ecf20Sopenharmony_ci#define D7S_C 0x0C 578c2ecf20Sopenharmony_ci#define D7S_D 0x0D 588c2ecf20Sopenharmony_ci#define D7S_E 0x0E 598c2ecf20Sopenharmony_ci#define D7S_F 0x0F 608c2ecf20Sopenharmony_ci#define D7S_H 0x10 618c2ecf20Sopenharmony_ci#define D7S_E2 0x11 628c2ecf20Sopenharmony_ci#define D7S_L 0x12 638c2ecf20Sopenharmony_ci#define D7S_P 0x13 648c2ecf20Sopenharmony_ci#define D7S_SEGA 0x14 /* Individual segments */ 658c2ecf20Sopenharmony_ci#define D7S_SEGB 0x15 668c2ecf20Sopenharmony_ci#define D7S_SEGC 0x16 678c2ecf20Sopenharmony_ci#define D7S_SEGD 0x17 688c2ecf20Sopenharmony_ci#define D7S_SEGE 0x18 698c2ecf20Sopenharmony_ci#define D7S_SEGF 0x19 708c2ecf20Sopenharmony_ci#define D7S_SEGG 0x1A 718c2ecf20Sopenharmony_ci#define D7S_SEGABFG 0x1B /* Segment groupings */ 728c2ecf20Sopenharmony_ci#define D7S_SEGCDEG 0x1C 738c2ecf20Sopenharmony_ci#define D7S_SEGBCEF 0x1D 748c2ecf20Sopenharmony_ci#define D7S_SEGADG 0x1E 758c2ecf20Sopenharmony_ci#define D7S_BLANK 0x1F /* Clear all segments */ 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci#define D7S_MIN_VAL 0x0 788c2ecf20Sopenharmony_ci#define D7S_MAX_VAL 0x1F 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci#endif /* ifndef __display7seg_h__ */ 81