m5stack-stubs 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info/
8
+
9
+ # Virtual envs
10
+ .venv/
11
+
12
+ # Fetched firmware source (re-download with `m5stubgen fetch`)
13
+ /vendor/
14
+
15
+ # Generated stub output (regenerate with `m5stubgen gen`)
16
+ /out/
17
+
18
+ # Stub package payload (generated into stubpkg/) + build artifacts
19
+ /stubpkg/*.pyi
20
+ /stubpkg/unit/
21
+ /stubpkg/hardware/
22
+ /stubpkg/driver/
23
+ /dist/
24
+ /stubpkg/dist/
@@ -0,0 +1,495 @@
1
+ """
2
+ Type stubs for the M5Stack UIFlow2 firmware ``M5`` module.
3
+
4
+ AUTO-GENERATED by m5stubgen. Do not edit by hand.
5
+ * structure & constant values: device introspection snapshot
6
+ * parameter & return signatures: M5Unified C bindings (mpy_m5*.cpp)
7
+ Firmware: uiflow-micropython master @ 67ad24e30b
8
+ """
9
+ from typing import Any
10
+
11
+
12
+ class _ALS:
13
+ def getLightSensorData(self) -> int: ...
14
+ def getProximitySensorData(self) -> int: ...
15
+
16
+ class _Button:
17
+ class CB_TYPE:
18
+ WAS_CLICKED: int
19
+ WAS_DOUBLECLICKED: int
20
+ WAS_HOLD: int
21
+ WAS_PRESSED: int
22
+ WAS_RELEASED: int
23
+ WAS_SINGLE_CLICKED: int
24
+ def getClickCount(self) -> int: ...
25
+ def isHolding(self) -> bool: ...
26
+ def isPressed(self) -> bool: ...
27
+ def isReleased(self) -> bool: ...
28
+ def lastChange(self) -> int: ...
29
+ def pressedFor(self, msec: int) -> bool: ...
30
+ def releasedFor(self, msec: int) -> bool: ...
31
+ def removeCallback(self, type: int) -> None: ...
32
+ def setCallback(self, type: int, cb: Any) -> None: ...
33
+ def setDebounceThresh(self, msec: int) -> None: ...
34
+ def setHoldThresh(self, msec: int) -> None: ...
35
+ def wasChangePressed(self) -> bool: ...
36
+ def wasClicked(self) -> bool: ...
37
+ def wasDeciedClickCount(self) -> bool: ...
38
+ def wasDoubleClicked(self) -> bool: ...
39
+ def wasHold(self) -> bool: ...
40
+ def wasPressed(self) -> bool: ...
41
+ def wasReleased(self) -> bool: ...
42
+ def wasSingleClicked(self) -> bool: ...
43
+
44
+ class _Display:
45
+ class COLOR:
46
+ BLACK: int = 0
47
+ BLUE: int = 255
48
+ CYAN: int = 65535
49
+ DARKCYAN: int = 32896
50
+ DARKGREEN: int = 32768
51
+ DARKGREY: int = 8421504
52
+ GREEN: int = 65280
53
+ GREENYELLOW: int = 11403055
54
+ LIGHTGREY: int = 12632256
55
+ MAGENTA: int = 16711935
56
+ MAROON: int = 8388608
57
+ NAVY: int = 128
58
+ OLIVE: int = 8421376
59
+ ORANGE: int = 16753920
60
+ PINK: int = 16761035
61
+ PURPLE: int = 8388736
62
+ RED: int = 16711680
63
+ WHITE: int = 16777215
64
+ YELLOW: int = 16776960
65
+ class EPDMode:
66
+ EPD_FAST: int = 3
67
+ EPD_FASTEST: int = 4
68
+ EPD_QUALITY: int = 1
69
+ EPD_TEXT: int = 2
70
+ class FONTS:
71
+ ASCII7: Any
72
+ AlibabaPuHuiTiCN24: Any
73
+ AlibabaSansJA24: Any
74
+ AlibabaSansKR24: Any
75
+ DejaVu12: Any
76
+ DejaVu18: Any
77
+ DejaVu24: Any
78
+ DejaVu40: Any
79
+ DejaVu56: Any
80
+ DejaVu72: Any
81
+ DejaVu9: Any
82
+ EFontCN24: Any
83
+ EFontJA24: Any
84
+ EFontKR24: Any
85
+ Montserrat12: Any
86
+ Montserrat14: Any
87
+ Montserrat16: Any
88
+ Montserrat18: Any
89
+ Montserrat20: Any
90
+ Montserrat22: Any
91
+ Montserrat24: Any
92
+ Montserrat30: Any
93
+ Montserrat36: Any
94
+ Montserrat40: Any
95
+ Montserrat44: Any
96
+ Montserrat48: Any
97
+ def clear(self, color: int = ...) -> None: ...
98
+ def close(self, *args: Any, **kwargs: Any) -> Any: ...
99
+ def delete(self) -> None: ...
100
+ def drawArc(self, x: int, y: int, r0: int, r1: int, angle0: int, angle1: int, color: int = ...) -> None: ...
101
+ def drawBmp(self, img: Any, x: int = ..., y: int = ..., maxW: int = ..., maxH: int = ..., offX: int = ..., offY: int = ..., scaleX: Any = ..., scaleY: Any = ...) -> None: ...
102
+ def drawCenterString(self, text: str, x: int, y: int, font: Any = ...) -> None: ...
103
+ def drawCircle(self, x: int, y: int, r: int, color: int = ...) -> None: ...
104
+ def drawEllipse(self, x: int, y: int, rx: int, ry: int, color: int = ...) -> None: ...
105
+ def drawEllipseArc(self, x: int, y: int, r0x: int, r1x: int, r0y: int, r1y: int, angle0: int, angle1: int, color: int = ...) -> None: ...
106
+ def drawImage(self, img: Any, x: int = ..., y: int = ..., maxW: int = ..., maxH: int = ..., offX: int = ..., offY: int = ..., scaleX: Any = ..., scaleY: Any = ...) -> None: ...
107
+ def drawJpg(self, img: Any, x: int = ..., y: int = ..., maxW: int = ..., maxH: int = ..., offX: int = ..., offY: int = ..., scaleX: Any = ..., scaleY: Any = ...) -> None: ...
108
+ def drawLine(self, x0: int, y0: int, x1: int, y1: int, color: int = ...) -> None: ...
109
+ def drawPixel(self, x: int, y: int, color: int = ...) -> None: ...
110
+ def drawPng(self, img: Any, x: int = ..., y: int = ..., maxW: int = ..., maxH: int = ..., offX: int = ..., offY: int = ..., scaleX: Any = ..., scaleY: Any = ...) -> None: ...
111
+ def drawQR(self, text: str, x: int, y: int, w: int, version: int = ...) -> None: ...
112
+ def drawRawBuf(self, buf: Any, x: int, y: int, w: int, h: int, len: int, swap: bool = ...) -> None: ...
113
+ def drawRect(self, x: int, y: int, w: int, h: int, color: int = ...) -> None: ...
114
+ def drawRightString(self, text: str, x: int, y: int, font: Any = ...) -> None: ...
115
+ def drawRoundRect(self, x: int, y: int, w: int, h: int, r: int, color: int = ...) -> None: ...
116
+ def drawString(self, text: str, x: int, y: int, font: Any = ...) -> None: ...
117
+ def drawTriangle(self, x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int = ...) -> None: ...
118
+ def endWrite(self) -> None: ...
119
+ def fillArc(self, x: int, y: int, r0: int, r1: int, angle0: int, angle1: int, color: int = ...) -> None: ...
120
+ def fillCircle(self, x: int, y: int, r: int, color: int = ...) -> None: ...
121
+ def fillEllipse(self, x: int, y: int, rx: int, ry: int, color: int = ...) -> None: ...
122
+ def fillEllipseArc(self, x: int, y: int, r0x: int, r1x: int, r0y: int, r1y: int, angle0: int, angle1: int, color: int = ...) -> None: ...
123
+ def fillRect(self, x: int, y: int, w: int, h: int, color: int = ...) -> None: ...
124
+ def fillRoundRect(self, x: int, y: int, w: int, h: int, r: int, color: int = ...) -> None: ...
125
+ def fillScreen(self, color: int = ...) -> None: ...
126
+ def fillTriangle(self, x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int = ...) -> None: ...
127
+ def fontHeight(self, font: Any = ...) -> int: ...
128
+ def getBrightness(self) -> int: ...
129
+ def getColorDepth(self) -> int: ...
130
+ def getCursor(self) -> int: ...
131
+ def getEpdMode(self) -> int: ...
132
+ def getRotation(self) -> int: ...
133
+ def height(self) -> int: ...
134
+ def isEPD(self) -> bool: ...
135
+ def loadFont(self, font: Any) -> bool: ...
136
+ def lvgl_benchmark(self, *args: Any, **kwargs: Any) -> Any: ...
137
+ def lvgl_deinit(self, *args: Any, **kwargs: Any) -> Any: ...
138
+ def lvgl_init(self, *args: Any, **kwargs: Any) -> Any: ...
139
+ def newCanvas(self, w: int, h: int, bpp: int = ..., psram: bool = ...) -> Any: ...
140
+ def powerSaveOff(self) -> None: ...
141
+ def powerSaveOn(self) -> None: ...
142
+ def print(self, text: str, color: int = ...) -> None: ...
143
+ def printf(self, *args: Any, **kwargs: Any) -> Any: ...
144
+ def push(self, x: int, y: int) -> None: ...
145
+ def read(self, *args: Any, **kwargs: Any) -> Any: ...
146
+ def readData(self, index: int) -> int: ...
147
+ def readData16(self, index: int) -> int: ...
148
+ def readData32(self, index: int) -> int: ...
149
+ def setBrightness(self, brightness: int) -> None: ...
150
+ def setColorDepth(self, bpp: int) -> None: ...
151
+ def setCursor(self, x: int, y: int) -> None: ...
152
+ def setEpdMode(self, epd_mode: int) -> None: ...
153
+ def setFont(self, font: Any) -> None: ...
154
+ def setRotation(self, r: int) -> None: ...
155
+ def setTextColor(self, fgcolor: int, bgcolor: int = ...) -> None: ...
156
+ def setTextScroll(self, scroll: bool) -> None: ...
157
+ def setTextSize(self, size: float) -> None: ...
158
+ def show(self, *args: Any, **kwargs: Any) -> Any: ...
159
+ def startWrite(self) -> None: ...
160
+ def textWidth(self, text: str, font: Any = ...) -> int: ...
161
+ def unloadFont(self) -> None: ...
162
+ def width(self) -> int: ...
163
+ def write(self, *args: Any, **kwargs: Any) -> Any: ...
164
+ def writeCommand(self, cmd: int) -> None: ...
165
+ def writeCommand16(self, cmd: int) -> None: ...
166
+ def writeData(self, data: int) -> None: ...
167
+ def writeData16(self, data: int) -> None: ...
168
+ def writeData32(self, data: int) -> None: ...
169
+
170
+ class _IMU:
171
+ class IMU_TYPE:
172
+ BMI270: int = 6
173
+ MPU6050: int = 3
174
+ MPU6886: int = 4
175
+ MPU9250: int = 5
176
+ NULL: int = 0
177
+ SH200Q: int = 2
178
+ UNKNOWN: int = 1
179
+ def getAccel(self) -> float: ...
180
+ def getGyro(self) -> float: ...
181
+ def getMag(self) -> float: ...
182
+ def getType(self) -> int: ...
183
+ def isEnabled(self) -> bool: ...
184
+
185
+ class _Led:
186
+ def display(self) -> None: ...
187
+ def getCount(self) -> int: ...
188
+ def setAllColor(self, *args: Any, **kwargs: Any) -> Any: ...
189
+ def setBrightness(self, br: int) -> None: ...
190
+ def setColor(self, *args: Any, **kwargs: Any) -> Any: ...
191
+
192
+ class _MIC:
193
+ def begin(self) -> bool: ...
194
+ def config(self, *args: Any, **kwargs: Any) -> Any: ...
195
+ def end(self) -> None: ...
196
+ def isEnabled(self) -> bool: ...
197
+ def isRecording(self) -> int: ...
198
+ def isRunning(self) -> bool: ...
199
+ def record(self, buf: Any, rate: int = ..., stereo: bool = ...) -> bool: ...
200
+ def recordWavFile(self, path: Any, rate: int = ..., time: int = ..., stereo: bool = ...) -> bool: ...
201
+ def setSampleRate(self, rate: int) -> None: ...
202
+
203
+ class _Power:
204
+ class PORT:
205
+ A: int = 1
206
+ B1: int = 2
207
+ B2: int = 4
208
+ C1: int = 8
209
+ C2: int = 16
210
+ MAIN: int = 32768
211
+ PWR485: int = 64
212
+ PWRCAN: int = 128
213
+ USB: int = 32
214
+ def deepSleep(self, micro_seconds: int = ..., touch_wakeup: bool = ...) -> None: ...
215
+ def getBatteryCurrent(self) -> int: ...
216
+ def getBatteryLevel(self) -> int: ...
217
+ def getBatteryVoltage(self) -> int: ...
218
+ def getExtCurrent(self, ext_port: float) -> float: ...
219
+ def getExtOutput(self) -> bool: ...
220
+ def getExtVoltage(self, ext_port: float) -> float: ...
221
+ def getKeyState(self) -> int: ...
222
+ def getPortCurrent(self, port: int) -> float: ...
223
+ def getPortVbus(self, port: int) -> float: ...
224
+ def getType(self) -> bool: ...
225
+ def getUsbOutput(self) -> bool: ...
226
+ def getVBUSVoltage(self) -> int: ...
227
+ def isCharging(self) -> bool: ...
228
+ def lightSleep(self, micro_seconds: int = ..., touch_wakeup: bool = ...) -> None: ...
229
+ def powerOff(self) -> None: ...
230
+ def setBatteryCharge(self, enable: int) -> None: ...
231
+ def setChargeCurrent(self, ma: int) -> None: ...
232
+ def setChargeVoltage(self, max_mv: int) -> None: ...
233
+ def setExtOutput(self, enable: bool, port_mask: int = ...) -> None: ...
234
+ def setExtPortBusConfig(self, direction: int, output_enable: int = ..., voltage: int = ..., current_limit: int = ...) -> None: ...
235
+ def setLed(self, br: int) -> None: ...
236
+ def setUsbOutput(self, enable: int) -> None: ...
237
+ def setVibration(self, level: int) -> None: ...
238
+ def timerSleep(self, *args: Any, **kwargs: Any) -> Any: ...
239
+
240
+ class _Speaker:
241
+ def begin(self) -> bool: ...
242
+ def config(self, *args: Any, **kwargs: Any) -> Any: ...
243
+ def end(self) -> None: ...
244
+ def getChannelVolume(self, ch: int) -> int: ...
245
+ def getPlayingChannels(self) -> int: ...
246
+ def getVolume(self) -> int: ...
247
+ def getVolumePercentage(self) -> float: ...
248
+ def isEnabled(self) -> bool: ...
249
+ def isPlaying(self, *args: Any, **kwargs: Any) -> Any: ...
250
+ def isRunning(self) -> bool: ...
251
+ def playRaw(self, raw: Any, rate: int = ..., stereo: bool = ..., repeat: int = ..., channel: int = ..., stop_current_sound: bool = ...) -> bool: ...
252
+ def playWav(self, wav_data: Any, repeat: int = ..., ch: int = ..., stop_current_sound: bool = ...) -> None: ...
253
+ def playWavFile(self, path: Any, repeat: int = ..., ch: int = ..., stop_current_sound: bool = ...) -> str: ...
254
+ def setAllChannelVolume(self, volume: int) -> None: ...
255
+ def setChannelVolume(self, channel: int, volume: int) -> None: ...
256
+ def setPA(self, enable: bool) -> bool: ...
257
+ def setVolume(self, master_volume: int) -> None: ...
258
+ def setVolumePercentage(self, self_in: Any, percentage_in: float) -> None: ...
259
+ def stop(self, channel: int = ...) -> None: ...
260
+ def tone(self, frequency: int, duration: int, channel: int = ..., stop_current_sound: bool = ...) -> None: ...
261
+
262
+ class _Touch:
263
+ def getCount(self) -> int: ...
264
+ def getDetail(self, i: int = ...) -> bool: ...
265
+ def getTouchPointRaw(self, i: int = ...) -> int: ...
266
+ def getX(self) -> int: ...
267
+ def getY(self) -> int: ...
268
+
269
+ class BOARD:
270
+ ArduinoNessoN1: int = 23
271
+ M5ATOMDisplay: int = 192
272
+ M5AirQ: int = 15
273
+ M5Atom: int = 128
274
+ M5AtomEcho: int = 142
275
+ M5AtomEchoS3R: int = 145
276
+ M5AtomMatrix: int = 141
277
+ M5AtomPsram: int = 129
278
+ M5AtomS3: int = 11
279
+ M5AtomS3Lite: int = 137
280
+ M5AtomS3R: int = 18
281
+ M5AtomS3R_CAM: int = 144
282
+ M5AtomS3U: int = 138
283
+ M5AtomU: int = 130
284
+ M5Camera: int = 131
285
+ M5Capsule: int = 139
286
+ M5Cardputer: int = 14
287
+ M5CardputerADV: int = 24
288
+ M5Dial: int = 12
289
+ M5DinMeter: int = 13
290
+ M5DualKey: int = 147
291
+ M5ModuleDisplay: int = 199
292
+ M5ModuleRCA: int = 200
293
+ M5NanoC6: int = 140
294
+ M5Paper: int = 7
295
+ M5PaperColor: int = 28
296
+ M5PaperMono: int = 29
297
+ M5PaperS3: int = 19
298
+ M5PowerHub: int = 146
299
+ M5Stack: int = 1
300
+ M5StackChan: int = 27
301
+ M5StackCore2: int = 2
302
+ M5StackCoreInk: int = 6
303
+ M5StackCoreS3: int = 10
304
+ M5StamPLC: int = 21
305
+ M5StampC3: int = 134
306
+ M5StampC3U: int = 135
307
+ M5StampP4: int = 150
308
+ M5StampPico: int = 133
309
+ M5StampS3: int = 136
310
+ M5StampS3Bat: int = 149
311
+ M5Station: int = 9
312
+ M5StickC: int = 3
313
+ M5StickCPlus: int = 4
314
+ M5StickCPlus2: int = 5
315
+ M5StickS3: int = 26
316
+ M5StopWatch: int = 30
317
+ M5Tab5: int = 22
318
+ M5TimerCam: int = 132
319
+ M5Tough: int = 8
320
+ M5UnitC6L: int = 25
321
+ M5UnitGLASS: int = 196
322
+ M5UnitGLASS2: int = 197
323
+ M5UnitLCD: int = 193
324
+ M5UnitMiniOLED: int = 195
325
+ M5UnitOLED: int = 194
326
+ M5UnitRCA: int = 198
327
+ M5Unit_PoEP4: int = 148
328
+ unknown: int = 0
329
+
330
+ class UserDisplay:
331
+ class COLOR:
332
+ BLACK: int = 0
333
+ BLUE: int = 255
334
+ CYAN: int = 65535
335
+ DARKCYAN: int = 32896
336
+ DARKGREEN: int = 32768
337
+ DARKGREY: int = 8421504
338
+ GREEN: int = 65280
339
+ GREENYELLOW: int = 11403055
340
+ LIGHTGREY: int = 12632256
341
+ MAGENTA: int = 16711935
342
+ MAROON: int = 8388608
343
+ NAVY: int = 128
344
+ OLIVE: int = 8421376
345
+ ORANGE: int = 16753920
346
+ PINK: int = 16761035
347
+ PURPLE: int = 8388736
348
+ RED: int = 16711680
349
+ WHITE: int = 16777215
350
+ YELLOW: int = 16776960
351
+ class EPDMode:
352
+ EPD_FAST: int = 3
353
+ EPD_FASTEST: int = 4
354
+ EPD_QUALITY: int = 1
355
+ EPD_TEXT: int = 2
356
+ class FONTS:
357
+ ASCII7: Any
358
+ AlibabaPuHuiTiCN24: Any
359
+ AlibabaSansJA24: Any
360
+ AlibabaSansKR24: Any
361
+ DejaVu12: Any
362
+ DejaVu18: Any
363
+ DejaVu24: Any
364
+ DejaVu40: Any
365
+ DejaVu56: Any
366
+ DejaVu72: Any
367
+ DejaVu9: Any
368
+ EFontCN24: Any
369
+ EFontJA24: Any
370
+ EFontKR24: Any
371
+ Montserrat12: Any
372
+ Montserrat14: Any
373
+ Montserrat16: Any
374
+ Montserrat18: Any
375
+ Montserrat20: Any
376
+ Montserrat22: Any
377
+ Montserrat24: Any
378
+ Montserrat30: Any
379
+ Montserrat36: Any
380
+ Montserrat40: Any
381
+ Montserrat44: Any
382
+ Montserrat48: Any
383
+ class PANEL:
384
+ GC9107: int
385
+ GC9A01: int
386
+ GDEW0154M09: int
387
+ ILI9342: int
388
+ IT8951: int
389
+ SH110x: int
390
+ SSD1306: int
391
+ ST7735: int
392
+ ST7735S: int
393
+ ST7789: int
394
+ class TOUCH:
395
+ FT5X06: int
396
+ GT911: int
397
+ def clear(self, color: int = ...) -> None: ...
398
+ def delete(self) -> None: ...
399
+ def drawArc(self, x: int, y: int, r0: int, r1: int, angle0: int, angle1: int, color: int = ...) -> None: ...
400
+ def drawBmp(self, img: Any, x: int = ..., y: int = ..., maxW: int = ..., maxH: int = ..., offX: int = ..., offY: int = ..., scaleX: Any = ..., scaleY: Any = ...) -> None: ...
401
+ def drawCenterString(self, text: str, x: int, y: int, font: Any = ...) -> None: ...
402
+ def drawCircle(self, x: int, y: int, r: int, color: int = ...) -> None: ...
403
+ def drawEllipse(self, x: int, y: int, rx: int, ry: int, color: int = ...) -> None: ...
404
+ def drawEllipseArc(self, x: int, y: int, r0x: int, r1x: int, r0y: int, r1y: int, angle0: int, angle1: int, color: int = ...) -> None: ...
405
+ def drawImage(self, img: Any, x: int = ..., y: int = ..., maxW: int = ..., maxH: int = ..., offX: int = ..., offY: int = ..., scaleX: Any = ..., scaleY: Any = ...) -> None: ...
406
+ def drawJpg(self, img: Any, x: int = ..., y: int = ..., maxW: int = ..., maxH: int = ..., offX: int = ..., offY: int = ..., scaleX: Any = ..., scaleY: Any = ...) -> None: ...
407
+ def drawLine(self, x0: int, y0: int, x1: int, y1: int, color: int = ...) -> None: ...
408
+ def drawPixel(self, x: int, y: int, color: int = ...) -> None: ...
409
+ def drawPng(self, img: Any, x: int = ..., y: int = ..., maxW: int = ..., maxH: int = ..., offX: int = ..., offY: int = ..., scaleX: Any = ..., scaleY: Any = ...) -> None: ...
410
+ def drawQR(self, text: str, x: int, y: int, w: int, version: int = ...) -> None: ...
411
+ def drawRawBuf(self, buf: Any, x: int, y: int, w: int, h: int, len: int, swap: bool = ...) -> None: ...
412
+ def drawRect(self, x: int, y: int, w: int, h: int, color: int = ...) -> None: ...
413
+ def drawRightString(self, text: str, x: int, y: int, font: Any = ...) -> None: ...
414
+ def drawRoundRect(self, x: int, y: int, w: int, h: int, r: int, color: int = ...) -> None: ...
415
+ def drawString(self, text: str, x: int, y: int, font: Any = ...) -> None: ...
416
+ def drawTriangle(self, x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int = ...) -> None: ...
417
+ def endWrite(self) -> None: ...
418
+ def fillArc(self, x: int, y: int, r0: int, r1: int, angle0: int, angle1: int, color: int = ...) -> None: ...
419
+ def fillCircle(self, x: int, y: int, r: int, color: int = ...) -> None: ...
420
+ def fillEllipse(self, x: int, y: int, rx: int, ry: int, color: int = ...) -> None: ...
421
+ def fillEllipseArc(self, x: int, y: int, r0x: int, r1x: int, r0y: int, r1y: int, angle0: int, angle1: int, color: int = ...) -> None: ...
422
+ def fillRect(self, x: int, y: int, w: int, h: int, color: int = ...) -> None: ...
423
+ def fillRoundRect(self, x: int, y: int, w: int, h: int, r: int, color: int = ...) -> None: ...
424
+ def fillScreen(self, color: int = ...) -> None: ...
425
+ def fillTriangle(self, x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int = ...) -> None: ...
426
+ def fontHeight(self, font: Any = ...) -> int: ...
427
+ def getBrightness(self) -> int: ...
428
+ def getColorDepth(self) -> int: ...
429
+ def getCursor(self) -> int: ...
430
+ def getEpdMode(self) -> int: ...
431
+ def getRotation(self) -> int: ...
432
+ def height(self) -> int: ...
433
+ def isEPD(self) -> bool: ...
434
+ def loadFont(self, font: Any) -> bool: ...
435
+ def newCanvas(self, w: int, h: int, bpp: int = ..., psram: bool = ...) -> Any: ...
436
+ def powerSaveOff(self) -> None: ...
437
+ def powerSaveOn(self) -> None: ...
438
+ def print(self, text: str, color: int = ...) -> None: ...
439
+ def printf(self, *args: Any, **kwargs: Any) -> Any: ...
440
+ def push(self, x: int, y: int) -> None: ...
441
+ def readData(self, index: int) -> int: ...
442
+ def readData16(self, index: int) -> int: ...
443
+ def readData32(self, index: int) -> int: ...
444
+ def setBrightness(self, brightness: int) -> None: ...
445
+ def setColorDepth(self, bpp: int) -> None: ...
446
+ def setCursor(self, x: int, y: int) -> None: ...
447
+ def setEpdMode(self, epd_mode: int) -> None: ...
448
+ def setFont(self, font: Any) -> None: ...
449
+ def setRotation(self, r: int) -> None: ...
450
+ def setTextColor(self, fgcolor: int, bgcolor: int = ...) -> None: ...
451
+ def setTextScroll(self, scroll: bool) -> None: ...
452
+ def setTextSize(self, size: float) -> None: ...
453
+ def show(self, *args: Any, **kwargs: Any) -> Any: ...
454
+ def startWrite(self) -> None: ...
455
+ def textWidth(self, text: str, font: Any = ...) -> int: ...
456
+ def unloadFont(self) -> None: ...
457
+ def width(self) -> int: ...
458
+ def writeCommand(self, cmd: int) -> None: ...
459
+ def writeCommand16(self, cmd: int) -> None: ...
460
+ def writeData(self, data: int) -> None: ...
461
+ def writeData16(self, data: int) -> None: ...
462
+ def writeData32(self, data: int) -> None: ...
463
+
464
+
465
+ Als: _ALS
466
+ BtnA: _Button
467
+ BtnB: _Button
468
+ BtnC: _Button
469
+ BtnEXT: _Button
470
+ BtnPWR: _Button
471
+ Display: _Display
472
+ Imu: _IMU
473
+ Lcd: _Display
474
+ Led: _Led
475
+ Mic: _MIC
476
+ Power: _Power
477
+ Speaker: _Speaker
478
+ Touch: _Touch
479
+ Widgets: Any
480
+
481
+ def Displays(index: int) -> Any: ...
482
+ def addDisplay(*args: Any, **kwargs: Any) -> Any: ...
483
+ def begin(*args: Any, **kwargs: Any) -> Any: ...
484
+ def createMic(*args: Any, **kwargs: Any) -> Any: ...
485
+ def createSpeaker(*args: Any, **kwargs: Any) -> Any: ...
486
+ def end() -> None: ...
487
+ def getBoard() -> int: ...
488
+ def getDisplay(index: int) -> Any: ...
489
+ def getDisplayCount() -> int: ...
490
+ def getDisplayIndex(board: int) -> int: ...
491
+ def setPrimaryDisplay(index: int) -> None: ...
492
+ def update() -> None: ...
493
+
494
+
495
+ def __getattr__(name: str) -> Any: ...
@@ -0,0 +1,42 @@
1
+ Metadata-Version: 2.4
2
+ Name: m5stack-stubs
3
+ Version: 0.1.0
4
+ Summary: Type stubs (.pyi) for the M5Stack UIFlow2 MicroPython firmware — M5 module
5
+ Project-URL: Homepage, https://github.com/N0I0C0K/m5stack-stubs
6
+ Author: N0I0C0K
7
+ License-Expression: MIT
8
+ Keywords: cardputer,m5stack,micropython,pyi,pylance,stubs,type-stubs,uiflow
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Typing :: Stubs Only
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+
15
+ # m5stack-stubs
16
+
17
+ Type stubs (`.pyi`) for the **M5Stack UIFlow2** MicroPython firmware, so editors
18
+ (Pylance / pyright) give autocomplete and type checking for the `M5` module —
19
+ which is a compiled C module that no other stub package covers.
20
+
21
+ ```bash
22
+ pip install m5stack-stubs
23
+ ```
24
+
25
+ Then `import M5` resolves with real method signatures and constant values:
26
+
27
+ ```python
28
+ import M5
29
+ M5.Lcd.fillRect(0, 0, 100, 50, 0xFFFF) # fillRect(x, y, w, h, color=...) -> None
30
+ pressed: bool = M5.BtnA.isPressed() # isPressed() -> bool
31
+ adv = M5.BOARD.M5CardputerADV # 24
32
+ ```
33
+
34
+ Generated from the official firmware C source by
35
+ [m5stubgen](https://github.com/N0I0C0K/m5stack-stubs). The package version tracks
36
+ the firmware release it was generated from.
37
+
38
+ > Stub-only package — it ships `.pyi` files only and has no runtime effect.
39
+
40
+ ## License
41
+
42
+ MIT
@@ -0,0 +1,28 @@
1
+ # m5stack-stubs
2
+
3
+ Type stubs (`.pyi`) for the **M5Stack UIFlow2** MicroPython firmware, so editors
4
+ (Pylance / pyright) give autocomplete and type checking for the `M5` module —
5
+ which is a compiled C module that no other stub package covers.
6
+
7
+ ```bash
8
+ pip install m5stack-stubs
9
+ ```
10
+
11
+ Then `import M5` resolves with real method signatures and constant values:
12
+
13
+ ```python
14
+ import M5
15
+ M5.Lcd.fillRect(0, 0, 100, 50, 0xFFFF) # fillRect(x, y, w, h, color=...) -> None
16
+ pressed: bool = M5.BtnA.isPressed() # isPressed() -> bool
17
+ adv = M5.BOARD.M5CardputerADV # 24
18
+ ```
19
+
20
+ Generated from the official firmware C source by
21
+ [m5stubgen](https://github.com/N0I0C0K/m5stack-stubs). The package version tracks
22
+ the firmware release it was generated from.
23
+
24
+ > Stub-only package — it ships `.pyi` files only and has no runtime effect.
25
+
26
+ ## License
27
+
28
+ MIT
@@ -0,0 +1,31 @@
1
+ [project]
2
+ name = "m5stack-stubs"
3
+ version = "0.1.0"
4
+ description = "Type stubs (.pyi) for the M5Stack UIFlow2 MicroPython firmware — M5 module"
5
+ readme = "README.md"
6
+ requires-python = ">=3.9"
7
+ license = "MIT"
8
+ authors = [{ name = "N0I0C0K" }]
9
+ keywords = ["m5stack", "uiflow", "micropython", "stubs", "pyi", "pylance", "type-stubs", "cardputer"]
10
+ classifiers = [
11
+ "Typing :: Stubs Only",
12
+ "License :: OSI Approved :: MIT License",
13
+ "Programming Language :: Python :: 3",
14
+ ]
15
+
16
+ [project.urls]
17
+ Homepage = "https://github.com/N0I0C0K/m5stack-stubs"
18
+
19
+ [build-system]
20
+ requires = ["hatchling"]
21
+ build-backend = "hatchling.build"
22
+
23
+ # Ship the generated .pyi flat at the site-packages root (mirrors micropython-*-stubs),
24
+ # so `import M5` resolves the stub. Files are produced by `m5stubgen gen --out stubpkg`.
25
+ [tool.hatch.build.targets.wheel]
26
+ include = ["*.pyi", "unit/", "hardware/", "driver/"]
27
+ [tool.hatch.build.targets.wheel.force-include]
28
+ "M5.pyi" = "M5.pyi"
29
+
30
+ [tool.hatch.build.targets.sdist]
31
+ include = ["*.pyi", "unit/", "hardware/", "driver/", "README.md"]