-
Notifications
You must be signed in to change notification settings - Fork 256
Added Improved Pi Revision Code Detection #294
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
Conversation
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.
One suggestion but fine as-is too.
@property | ||
def overvoltage(self): | ||
"""Overvoltage allowed/disallowed""" | ||
return self._get_property("overvoltage") | ||
|
||
@property | ||
def warranty_bit(self): | ||
"""Warranty bit""" | ||
return self._get_property("warranty") | ||
|
||
@property | ||
def otp_program(self): | ||
"""OTP programming allowed/disallowed""" | ||
return self._get_property("otp_program") | ||
|
||
@property | ||
def otp_read(self): | ||
"""OTP reading allowed/disallowed""" | ||
return self._get_property("otp_read") | ||
|
||
@property | ||
def rev_style(self): | ||
"""Revision Code style""" | ||
# Force new style for Rev Style | ||
return self._get_rev_prop_value("rev_style") | ||
|
||
@property | ||
def memory_size(self): | ||
"""Memory size""" | ||
return self._get_property("memory_size") | ||
|
||
@property | ||
def manufacturer(self): | ||
"""Manufacturer""" | ||
return self._get_property("manufacturer") | ||
|
||
@property | ||
def processor(self): | ||
"""Processor""" | ||
return self._get_property("processor") | ||
|
||
@property | ||
def type(self): | ||
"""Specific Model""" | ||
return self._get_property("type") | ||
|
||
@property | ||
def type_raw(self): | ||
"""Raw Value of Specific Model""" | ||
return self._get_property("type", raw=True) | ||
|
||
@property | ||
def revision(self): | ||
"""Revision Number""" | ||
return self._get_property("revision") |
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.
You could use a Data Descriptor class to factor these all out. (Works like CP Register does.)
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.
Thanks, I'll have to take a look at that. I'm not familiar with it.
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 think since this has been well tested as it is and I don't feel confident with descriptors, I'd rather use this as a starting point. That could be a future improvement.
Fixes #268.
This adds a revision code decoder to the Pi which can accurately check the model and revision number of the Raspberry Pi revision code along with some other information about it. This works for both new style and old style codes.
I added rpi_info.py, which if run on a Pi, it will display all the info for the device and if run on something else, it will prompt for a code to decode. I also added rev_code_tester.py, which will run through all the existing codes, run that code through the decoder, and check if it matches what is expected, which it does with 100% accuracy. By decoding it can ignore many of the similar variations of codes.
This also adds detection for the new CM4S modules.