config.h (1925B)
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 18 #pragma once 19 20 // I2C { 21 #define F_SCL 100000UL // Run I2C bus at 100 kHz 22 #define I2C_START_RETRY_COUNT 20 23 #define I2C_TIMEOUT 100 // milliseconds 24 // } I2C 25 26 // EEPROM { 27 #define EEPROM_SIZE 1024 28 // TODO: Refactor with new user EEPROM code (coming soon) 29 #define EEPROM_MAGIC 0x76EC 30 #define EEPROM_MAGIC_ADDR 64 31 // Bump this every time we change what we store 32 // This will automatically reset the EEPROM with defaults 33 // and avoid loading invalid data from the EEPROM 34 #define EEPROM_VERSION 0x02 35 #define EEPROM_VERSION_ADDR (EEPROM_MAGIC_ADDR + 2) 36 // } EEPROM 37 38 // Dynamic keymap { 39 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 40 #define DYNAMIC_KEYMAP_MACRO_COUNT 0 41 // Dynamic keymap starts after EEPROM version 42 #define DYNAMIC_KEYMAP_EEPROM_ADDR (EEPROM_VERSION_ADDR + 1) 43 // Dynamic macro starts after dynamic keymaps, it is disabled 44 #define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR (DYNAMIC_KEYMAP_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2)) 45 #define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 0 46 // } Dynamic keymap 47 48 // System76 EC { 49 #define SYSTEM76_EC_EEPROM_ADDR (DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE) 50 #define SYSTEM76_EC_EEPROM_SIZE (EEPROM_SIZE - SYSTEM76_EC_EEPROM_ADDR) 51 // } System76 EC