Skip to content

Commit 44ef991

Browse files
Merge 6928fef into 8bc6f52
2 parents 8bc6f52 + 6928fef commit 44ef991

8 files changed

Lines changed: 614 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# This file is covered by the GNU General Public License.
3+
# See the file COPYING for more details.
4+
# Copyright (C) 2024 NV Access Limited
5+
6+
"""Braille display driver for the Dot Pad Tactile Graphic braille display from Dot Inc."""
7+
8+
# Imported here so that braille._getDisplayDriver can import
9+
from .driver import BrailleDisplayDriver # noqa: F401
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2024 NV Access Limited
3+
# This file is covered by the GNU General Public License.
4+
# See the file COPYING for more details.
5+
6+
7+
import enum
8+
import ctypes
9+
10+
11+
class DP_Command(enum.IntEnum):
12+
REQ_FIRMWARE_VERSION = 0x0000
13+
RSP_FIRMWARE_VERSION = 0x0001
14+
REQ_DEVICE_NAME = 0x0100
15+
RSP_DEVICE_NAME = 0x0101
16+
REQ_BOARD_INFORMATION = 0x0110
17+
RSP_BOARD_INFORMATION = 0x0111
18+
REQ_DISPLAY_LINE = 0x0200
19+
RSP_DISPLAY_LINE = 0x0201
20+
NTF_DISPLAY_LINE = 0x0202
21+
REQ_DISPLAY_CURSOR = 0x0210
22+
RSP_DISPLAY_CURSOR = 0x0211
23+
NTF_DISPLAY_CURSOR = 0x0212
24+
NTF_KEYS_SCROLL = 0x0302
25+
NTF_KEYS_PERKINS = 0x0312
26+
NTF_KEYS_ROUTING = 0x0322
27+
NTF_KEYS_FUNCTION = 0x0332
28+
NTF_ERROR = 0x9902
29+
30+
31+
class DP_ErrorCode(enum.IntEnum):
32+
LENGTH = 1
33+
COMMAND = 2
34+
CHECKSUM = 3
35+
PARAMETER = 4
36+
TIMEOUT = 5
37+
38+
39+
class DP_DisplayResponse(enum.IntEnum):
40+
ACK = 0
41+
NACK = 1
42+
WAIT = 2
43+
CHECKSUM = 3
44+
45+
46+
class DP_Features(enum.IntFlag):
47+
HAS_GRAPHIC_DISPLAY = 0x80
48+
HAS_TEXT_DISPLAY = 0x40
49+
HAS_PERKINS_KEYS = 0x20
50+
HAS_ROUTING_KEYS = 0x10
51+
HAS_NAVIGATION_KEYS = 0x08
52+
HAS_PANNING_KEYS = 0x04
53+
HAS_FUNCTION_KEYS = 0x02
54+
55+
56+
class DP_DisplayDescriptor(ctypes.Structure):
57+
_fields_ = [
58+
("rowCount", ctypes.c_ubyte),
59+
("columnCount", ctypes.c_ubyte),
60+
("dividedLine", ctypes.c_ubyte),
61+
("refreshTime", ctypes.c_ubyte),
62+
]
63+
64+
65+
class DP_BoardInformation(ctypes.Structure):
66+
_fields_ = [
67+
("features", ctypes.c_ubyte),
68+
("dotsPerCell", ctypes.c_ubyte),
69+
("distanceBetweenPins", ctypes.c_ubyte),
70+
("functionKeyCount", ctypes.c_ubyte),
71+
("text", DP_DisplayDescriptor),
72+
("graphic", DP_DisplayDescriptor),
73+
]
74+
75+
76+
class DP_PacketSeqFlag(enum.IntEnum):
77+
SEQ_TEXT = 0x80
78+
79+
80+
class DP_PacketSyncByte(enum.IntEnum):
81+
SYNC1 = 0xAA
82+
SYNC2 = 0x55
83+
84+
85+
class DP_PerkinsKey(enum.IntEnum):
86+
DOT7 = 0
87+
DOT3 = 1
88+
DOT2 = 2
89+
DOT1 = 3
90+
DOT4 = 4
91+
DOT5 = 5
92+
DOT6 = 6
93+
DOT8 = 7
94+
SPACE = 8
95+
SHIFT_LEFT = 9
96+
CONTROL_LEFT = 10
97+
SHIFT_RIGHT = 11
98+
CONTROL_RIGHT = 12
99+
PAN_LEFT = 13
100+
PAN_RIGHT = 14
101+
NAV_CENTER = 16
102+
NAV_UP = 17
103+
NAV_RIGHT = 18
104+
NAV_DOWN = 19
105+
NAV_LEFT = 20
106+
107+
108+
DP_CHECKSUM_BASE = 0xA5

0 commit comments

Comments
 (0)