forked from microbit-more/pxt-mbit-more-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums.d.ts
232 lines (181 loc) · 3.39 KB
/
enums.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Auto-generated. Do not edit.
/**
* Data type of content.
*/
declare const enum MbitMoreDataContentType
{
//% block="number"
MM_DATA_NUMBER = 1,
//% block="text"
MM_DATA_TEXT = 2,
}
declare const enum MbitMoreCommand
{
CMD_CONFIG = 0x00,
CMD_PIN = 0x01,
CMD_DISPLAY = 0x02,
CMD_AUDIO = 0x03,
CMD_DATA = 0x04,
}
declare const enum MbitMorePinCommand
{
SET_OUTPUT = 0x01,
SET_PWM = 0x02,
SET_SERVO = 0x03,
SET_PULL = 0x04,
SET_EVENT = 0x05,
}
declare const enum MbitMoreDisplayCommand
{
CLEAR = 0x00,
TEXT = 0x01,
PIXELS_0 = 0x02,
PIXELS_1 = 0x03,
}
/**
* @brief Enum for write mode of display pixels.
*/
declare const enum MbitMoreDisplayWriteMode
{
LAYER = 0,
OVER_WRITE = 1,
}
declare const enum MbitMorePullMode
{
None = 0,
Down = 1,
Up = 2,
}
declare const enum MbitMoreDataFormat
{
CONFIG = 0x10,
PIN_EVENT = 0x11,
ACTION_EVENT = 0x12,
DATA_NUMBER = 0x13,
DATA_TEXT = 0x14,
}
declare const enum MbitMoreActionEvent
{
BUTTON = 0x01,
GESTURE = 0x02,
}
declare const enum MbitMoreButtonEvent
{
DOWN = 1,
UP = 2,
CLICK = 3,
LONG_CLICK = 4,
HOLD = 5,
DOUBLE_CLICK = 6,
}
declare const enum MbitMoreGestureEvent
{
TILT_UP = 1,
TILT_DOWN = 2,
TILT_LEFT = 3,
TILT_RIGHT = 4,
FACE_UP = 5,
FACE_DOWN = 6,
FREEFALL = 7,
G3 = 8,
G6 = 9,
G8 = 10,
SHAKE = 11,
}
declare const enum MbitMorePinEventType
{
NONE = 0,
ON_EDGE = 1,
ON_PULSE = 2,
ON_TOUCH = 3,
}
declare const enum MbitMorePinEvent
{
RISE = 2,
FALL = 3,
PULSE_HIGH = 4,
PULSE_LOW = 5,
}
/**
* @brief Enum for sub-command about configurations.
*
*/
declare const enum MbitMoreConfig
{
MIC = 0x01,
TOUCH = 0x02,
}
/**
* @brief Enum for sub-commands about audio.
*
*/
declare const enum MbitMoreAudioCommand
{
STOP_TONE = 0x00,
PLAY_TONE = 0x01,
}
/**
* @brief Button ID in MicrobitMore
* This number is used to memory offset in state data.
*/
declare const enum MbitMoreButtonStateIndex
{
// GPIO array using [0..20]
P0 = 24,
P1 = 25,
P2 = 26,
A = 27,
B = 28,
LOGO = 29,
}
/**
* @brief Version of this micro:bit
*
*/
declare const enum MbitMoreHardwareVersion
{
MICROBIT_V1 = 1,
MICROBIT_V2 = 2,
}
/**
* @brief Version of protocol to use
*
*/
declare const enum MbitMoreProtocol
{
MBIT_MORE_V2 = 2,
}
/**
* @brief Communication route between Scratch and micro:bit
*
*/
declare const enum MbitMoreCommunicationRoute
{
BLE = 0,
SERIAL = 1,
}
/**
* @brief Request type from Scratch
*
*/
declare const enum ChRequest
{
REQ_READ = 0x01,
REQ_WRITE = 0x10,
REQ_WRITE_RESPONSE = 0x11,
REQ_NOTIFY_STOP = 0x20,
REQ_NOTIFY_START = 0x21,
}
/**
* @brief Response type to Scratch
*
*/
declare const enum ChResponse
{
RES_READ = 0x01,
RES_WRITE = 0x11,
RES_NOTIFY = 0x21,
}
declare namespace MbitMore {
}
// Auto-generated. Do not edit. Really.