Debian Codegraph @

Drivers/Braille/BrailleMemo/brldefs-mm.h

raw symbols SCIP
1 /*
2 * BRLTTY - A background process providing access to the console screen (when in
3 * text mode) for a blind person using a refreshable braille display.
4 *
5 * Copyright (C) 1995-2026 by The BRLTTY Developers.
6 *
7 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
8 *
9 * This is free software, placed under the terms of the
10 * GNU Lesser General Public License, as published by the Free Software
11 * Foundation; either version 2.1 of the License, or (at your option) any
12 * later version. Please see the file LICENSE-LGPL for details.
13 *
14 * Web Page: http://brltty.app/
15 *
16 * This software is maintained by Dave Mielke <[email protected]>.
17 */
18
19 #ifndef BRLTTY_INCLUDED_MM_BRLDEFS
20 #define BRLTTY_INCLUDED_MM_BRLDEFS
21
22 typedef enum {
23 MM_DEV_Pocket = 0X02,
24 MM_DEV_Smart16 = 0X11,
25 MM_DEV_Smart40 = 0X12,
26 MM_DEV_Air16 = 0X13,
27 MM_DEV_Air32 = 0X14,
28 MM_DEV_NextTouch40 = 0X21,
29 } MM_DeviceIdentifier;
30
31 typedef struct {
32 unsigned char packetType;
33 unsigned char deviceIdentifier;
34 unsigned char majorVersion;
35 unsigned char minorVersion;
36 unsigned char lineCount;
37 unsigned char lineLength;
38 unsigned char reserved;
39 unsigned char portIdentifier;
40 char hardwareName[24];
41 } MM_IdentityPacket;
42
43 #define MM_MAXIMUM_LINE_LENGTH 80
44 #define MM_MAXIMUM_LINE_COUNT 1
45
46 #define MM_HEADER_ID1 0XFF
47 #define MM_HEADER_ID2 0XFF
48
49 #define MM_HEADER_NAK 0X00
50 #define MM_HEADER_ACK 0X01
51
52 typedef enum {
53 MM_CMD_QueryIdentity = 0X10,
54 MM_CMD_QueryLineSize = 0X11,
55 MM_CMD_StartDisplayMode = 0X20,
56 MM_CMD_EndDisplayMode = 0X28,
57 MM_CMD_SendBrailleData = 0X31,
58 MM_CMD_SendDisplayData = 0X32,
59 MM_CMD_KeyCombination = 0Xf0,
60 MM_CMD_ShiftPress = 0Xf2,
61 MM_CMD_ShiftRelease = 0Xf3
62 } MM_CommandCode;
63
64 typedef enum {
65 MM_BLINK_NO = 0,
66 MM_BLINK_SLOW = 1,
67 MM_BLINK_FAST = 2
68 } MM_BlinkMode;
69
70 typedef struct {
71 unsigned char id1;
72 unsigned char id2;
73 unsigned char code;
74 unsigned char subcode;
75 unsigned char lengthLow;
76 unsigned char lengthHigh;
77 } MM_CommandHeader;
78
79 typedef union {
80 unsigned char bytes[1];
81
82 struct {
83 MM_CommandHeader header;
84
85 union {
86 struct {
87 unsigned char blink;
88 unsigned char reserved;
89 } start;
90
91 struct {
92 unsigned char cells[MM_MAXIMUM_LINE_LENGTH * 2];
93 } send;
94
95 struct {
96 unsigned char group;
97 unsigned char value;
98 unsigned char shift;
99 } keys;
100 } data;
101 } fields;
102 } MM_CommandPacket;
103
104 typedef enum {
105 MM_SHIFT_F1 = 0,
106 MM_SHIFT_F4 = 1,
107 MM_SHIFT_CONTROL = 2,
108 MM_SHIFT_ALT = 3,
109 MM_SHIFT_SELECT = 4,
110 MM_SHIFT_READ = 5,
111 MM_SHIFT_F2 = 6,
112 MM_SHIFT_F3 = 7
113 } MM_ShiftKey;
114
115 typedef enum {
116 MM_DOT_8 = 0,
117 MM_DOT_6 = 1,
118 MM_DOT_5 = 2,
119 MM_DOT_4 = 3,
120 MM_DOT_7 = 4,
121 MM_DOT_3 = 5,
122 MM_DOT_2 = 6,
123 MM_DOT_1 = 7
124 } MM_DotKey;
125
126 typedef enum {
127 MM_EDIT_ESC = 0,
128 MM_EDIT_INF = 1,
129 MM_EDIT_BS = 2,
130 MM_EDIT_DEL = 3,
131 MM_EDIT_INS = 4,
132 MM_EDIT_CHANGE = 5,
133 MM_EDIT_OK = 6,
134 MM_EDIT_SET = 7
135 } MM_EditKey;
136
137 typedef enum {
138 MM_ARROW_UP = 0,
139 MM_ARROW_DOWN = 1,
140 MM_ARROW_LEFT = 2,
141 MM_ARROW_RIGHT = 3
142 } MM_ArrowKey;
143
144 typedef enum {
145 MM_DISPLAY_BACKWARD = 0,
146 MM_DISPLAY_FORWARD = 1,
147 MM_DISPLAY_LSCROLL = 2,
148 MM_DISPLAY_RSCROLL = 3
149 } MM_DisplayKey;
150
151 typedef enum {
152 MM_GRP_SHIFT = 0,
153 MM_GRP_DOT = 1,
154 MM_GRP_EDIT = 2,
155 MM_GRP_ARROW = 3,
156 MM_GRP_ROUTE = 4,
157 MM_GRP_ERROR = 5,
158 MM_GRP_DISPLAY = 6
159 } MM_KeyGroup;
160
161 #endif /* BRLTTY_INCLUDED_MM_BRLDEFS */