File: chipDB.py

package info (click to toggle)
cura 5.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 122,888 kB
  • sloc: python: 44,572; sh: 81; xml: 32; makefile: 16
file content (25 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
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.
"""

avr_chip_db = {
    "ATMega1280": {
            "signature": [0x1E, 0x97, 0x03],
            "pageSize": 128,
            "pageCount": 512,
    },
    "ATMega2560": {
            "signature": [0x1E, 0x98, 0x01],
            "pageSize": 128,
            "pageCount": 1024,
    },
}

def getChipFromDB(sig):
    for chip in avr_chip_db.values():
        if chip["signature"] == sig:
            return chip
    return False