Arjen Hiemstra 63e8cf72a3 Add 'plugins/USBPrinting/' from commit 'b28ca0881a6c2564f5447476f7b21de5645c10bd'
git-subtree-dir: plugins/USBPrinting
git-subtree-mainline: 3823afd8cca1fe92b69082d51d0d50946b904e91
git-subtree-split: b28ca0881a6c2564f5447476f7b21de5645c10bd
2015-04-30 12:30:37 +02:00

26 lines
690 B
Python

"""
Database of AVR chips for avr_isp programming. Contains signatures and flash sizes from the AVR datasheets.
To support more chips add the relevant data to the avrChipDB list.
This is a python 3 conversion of the code created by David Braam for the Cura project.
"""
avrChipDB = {
'ATMega1280': {
'signature': [0x1E, 0x97, 0x03],
'pageSize': 128,
'pageCount': 512,
},
'ATMega2560': {
'signature': [0x1E, 0x98, 0x01],
'pageSize': 128,
'pageCount': 1024,
},
}
def getChipFromDB(sig):
for chip in avrChipDB.values():
if chip['signature'] == sig:
return chip
return False