chipDB.py 694 B

12345678910111213141516171819202122232425
  1. """
  2. Database of AVR chips for avr_isp programming. Contains signatures and flash sizes from the AVR datasheets.
  3. To support more chips add the relevant data to the avrChipDB list.
  4. This is a python 3 conversion of the code created by David Braam for the Cura project.
  5. """
  6. avr_chip_db = {
  7. "ATMega1280": {
  8. "signature": [0x1E, 0x97, 0x03],
  9. "pageSize": 128,
  10. "pageCount": 512,
  11. },
  12. "ATMega2560": {
  13. "signature": [0x1E, 0x98, 0x01],
  14. "pageSize": 128,
  15. "pageCount": 1024,
  16. },
  17. }
  18. def getChipFromDB(sig):
  19. for chip in avr_chip_db.values():
  20. if chip["signature"] == sig:
  21. return chip
  22. return False