-
Notifications
You must be signed in to change notification settings - Fork 30
New commands for myevic #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ClockSelect
wants to merge
14
commits into
Ban3:master
Choose a base branch
from
ClockSelect:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
df5b675
New commands for myevic
ClockSelect 1cf91b1
Integrated changes from master
ClockSelect 87dc7d1
Blanks cleanup
ClockSelect 46d35c0
Cleanup
ClockSelect 136dfd1
Logo dimensions for Presa 75 running myevic firmware
ClockSelect c523551
Fix time accuracy
ClockSelect fa55dda
Generic HID input command and LDROM update feature
ClockSelect 4937853
Notes about autosync time on device
nefelim4ag 9e7c901
Merge pull request #1 from Nefelim4ag/master
ClockSelect 3797156
Fix typo in udev rules
nefelim4ag 12d0059
Merge pull request #2 from Nefelim4ag/master
ClockSelect ffc5458
Added: check for usb device 0416:5020 in systemd service (#3)
nefelim4ag 45b2eb9
Add devices VTC Dual & Primo Mini
ClockSelect ef62fa6
Merge branch 'master' of https://github.com/ClockSelect/python-evic
ClockSelect File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,13 +56,15 @@ class HIDTransfer(object): | |
'E083': DeviceInfo("eGrip II", None, (64, 40)), | ||
'E092': DeviceInfo("eVic AIO", None, (64, 40)), | ||
'E115': DeviceInfo("eVic VTwo mini", None, (64, 40)), | ||
'E079': DeviceInfo("eVic VTC Dual", None, (64, 40)), | ||
'E150': DeviceInfo("eVic Basic", None, (64, 40)), | ||
'E196': DeviceInfo("eVic Primo Mini", None, (64, 40)), | ||
'M011': DeviceInfo("iStick TC100W", None, None), | ||
'M037': DeviceInfo("ASTER", None, (96, 16)), | ||
'M041': DeviceInfo("iStick Pico", None, (96, 16)), | ||
'M045': DeviceInfo("iStick Pico Mega", None, (96, 16)), | ||
'M046': DeviceInfo("iPower", None, (96, 16)), | ||
'W007': DeviceInfo("Presa TC75W", ['E052'], None), | ||
'W007': DeviceInfo("Presa TC75W", ['E052'], (64,40)), | ||
'W010': DeviceInfo("Classic", None, None), | ||
'W011': DeviceInfo("Lite", None, None), | ||
'W013': DeviceInfo("Stout", None, None), | ||
|
@@ -161,6 +163,48 @@ def read_dataflash(self): | |
|
||
return (dataflash, checksum) | ||
|
||
def fmc_read(self, start, length): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd add a small note to the docstring, mentioning |
||
"""Reads the device flash memory. | ||
|
||
Returns: | ||
An array containing the data flash memory content. | ||
""" | ||
|
||
# Send the command for reading the data flash | ||
self.send_command(0xC0, start, length) | ||
|
||
# Read the dataflash | ||
buf = self.read(length) | ||
return (buf) | ||
|
||
def hid_command(self, cmd, start, length): | ||
"""Send a HID command to the device. | ||
|
||
Returns: | ||
An array containing command response. | ||
""" | ||
|
||
# Send the command for reading the data flash | ||
self.send_command(cmd, start, length) | ||
|
||
# Read the response | ||
buf = self.read(length) | ||
return (buf) | ||
|
||
def read_screen(self): | ||
"""Reads the screen memory. | ||
|
||
Returns: | ||
An array containing the screen. | ||
""" | ||
|
||
# Send the command for reading the screen buffer | ||
self.send_command(0xC1, 0, 0x400) | ||
|
||
# Read the data | ||
buf = self.read(0x400) | ||
return (buf) | ||
|
||
def write(self, data): | ||
"""Writes data to the device. | ||
|
||
|
@@ -266,6 +310,17 @@ def write_flash(self, data, start): | |
|
||
self.write(data) | ||
|
||
def write_ldflash(self, data): | ||
"""Writes data to the flash memory. | ||
""" | ||
|
||
end = len(data) | ||
|
||
# Send the command for writing the data | ||
self.send_command(0x3C, 0x100000, end) | ||
|
||
self.write(data) | ||
|
||
def write_aprom(self, aprom): | ||
"""Writes the APROM to the device. | ||
|
||
|
@@ -275,6 +330,15 @@ def write_aprom(self, aprom): | |
|
||
self.write_flash(aprom.data, 0) | ||
|
||
def write_ldrom(self, ldrom): | ||
"""Writes the LDROM to the device. | ||
|
||
Args: | ||
aprom: A BinFile object containing an unencrypted LDROM image. | ||
""" | ||
|
||
self.write_ldflash(ldrom.data) | ||
|
||
def write_logo(self, logo): | ||
"""Writes the logo to the the device. | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add that
fmc-read
,time
andscreenshot
are specific to your FW.reset
is good.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.