Update(boards): xpython板卡执行 build:prod

This commit is contained in:
王立帮
2025-02-22 16:08:25 +08:00
parent fbf3b8e642
commit 2843d26aef
30 changed files with 631 additions and 54797 deletions

View File

@@ -21,6 +21,7 @@ _BOT035_PGA = const(0x20)
_BOT035_KB = const(0x1C)
_BOT035_MS = const(0x20)
_BOT035_STR = const(0x24)
_BOT035_STA = const(0x25)
_FONT_W = const(5)
_FONT_H = const(8)
_LEDS_W = const(12)
@@ -316,6 +317,10 @@ class BOT035(FrameBuffer):
else:
print("Warning: Please upgrade the coprocessor firmware to use this feature")
def hid_keyboard_state(self):
state = self._rreg(_BOT035_STA)
return bool(state & 0x10), bool(state & 0x20), bool(state & 0x40)
def hid_mouse(self, keys=0, move=(0, 0), wheel=0, release=True):
if self._version:
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes([keys & 0x0F, move[0] & 0xFF, move[1] & 0xFF, wheel & 0xFF]))