eeprom_teensy.h 828 B

12345678910111213141516171819202122232425
  1. // Copyright 2022 Nick Brassel (@tzarc)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <ch.h>
  5. #include <hal.h>
  6. #if defined(K20x)
  7. /* Teensy 3.0, 3.1, 3.2; mchck; infinity keyboard */
  8. // The EEPROM is really RAM with a hardware-based backup system to
  9. // flash memory. Selecting a smaller size EEPROM allows more wear
  10. // leveling, for higher write endurance. If you edit this file,
  11. // set this to the smallest size your application can use. Also,
  12. // due to Freescale's implementation, writing 16 or 32 bit words
  13. // (aligned to 2 or 4 byte boundaries) has twice the endurance
  14. // compared to writing 8 bit bytes.
  15. //
  16. # ifndef EEPROM_SIZE
  17. # define EEPROM_SIZE 32
  18. # endif
  19. #elif defined(KL2x) /* Teensy LC (emulated) */
  20. # define EEPROM_SIZE 128
  21. #else
  22. # error Unsupported Teensy EEPROM.
  23. #endif