Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08f409f

Browse files
committed
changes gt911 driver
1 parent888080e commit08f409f

File tree

1 file changed

+9
-3
lines changed
  • api_drivers/common_api_drivers/indev

1 file changed

+9
-3
lines changed

‎api_drivers/common_api_drivers/indev/gt911.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,19 @@ def hw_reset(self):
8282
)
8383

8484
self._i2c.read_mem(_VENDOR_ID_REG,buf=self._mv[:1])
85-
print('Touch Vendor id:',hex(self._buf[0]))
85+
print(f'Touch Vendor id: 0x{hex(self._buf[0])[2:].upper()}')
86+
x,y=self.hw_size
87+
print(f'Touch resolution: x={x}, y={y}')
8688

89+
@property
90+
defhw_size(self):
8791
self._i2c.read_mem(_X_CORD_RES_REG,buf=self._mv[:2])
88-
print('Touch Configured width:',self._buf[0]+ (self._buf[1]<<8))
92+
x=self._buf[0]+ (self._buf[1]<<8)
8993

9094
self._i2c.read_mem(_Y_CORD_RES_REG,buf=self._mv[:2])
91-
print('Touch Configured height:',self._buf[0]+ (self._buf[1]<<8))
95+
y=self._buf[0]+ (self._buf[1]<<8)
96+
97+
returnx,y
9298

9399
@property
94100
deffirmware_config(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp