config.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2021 System76
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. #pragma once
  18. #define RGB_MATRIX_DISABLE_KEYCODES // Disables control of rgb matrix by keycodes (must use code functions to control the feature)
  19. // I2C {
  20. #define F_SCL 100000UL // Run I2C bus at 100 kHz
  21. #define I2C_START_RETRY_COUNT 20
  22. #define I2C_TIMEOUT 100 // milliseconds
  23. // } I2C
  24. // EEPROM {
  25. #define EEPROM_SIZE 1024
  26. // TODO: Refactor with new user EEPROM code (coming soon)
  27. #define EEPROM_MAGIC 0x76EC
  28. #define EEPROM_MAGIC_ADDR 64
  29. // Bump this every time we change what we store
  30. // This will automatically reset the EEPROM with defaults
  31. // and avoid loading invalid data from the EEPROM
  32. #define EEPROM_VERSION 0x02
  33. #define EEPROM_VERSION_ADDR (EEPROM_MAGIC_ADDR + 2)
  34. // } EEPROM
  35. // Dynamic keymap {
  36. #define DYNAMIC_KEYMAP_LAYER_COUNT 4
  37. #define DYNAMIC_KEYMAP_MACRO_COUNT 0
  38. // Dynamic keymap starts after EEPROM version
  39. #define DYNAMIC_KEYMAP_EEPROM_ADDR (EEPROM_VERSION_ADDR + 1)
  40. // Dynamic macro starts after dynamic keymaps, it is disabled
  41. #define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR (DYNAMIC_KEYMAP_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2))
  42. #define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 0
  43. // } Dynamic keymap
  44. // System76 EC {
  45. #define SYSTEM76_EC_EEPROM_ADDR (DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE)
  46. #define SYSTEM76_EC_EEPROM_SIZE (EEPROM_SIZE - SYSTEM76_EC_EEPROM_ADDR)
  47. // } System76 EC