qmk_firmware/assets/config_options.md.B6nk2VgQ.js

16 lines
36 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.Clpp4x2N.js";
const __pageData = JSON.parse('{"title":"Configuring QMK","description":"","frontmatter":{},"headers":[],"relativePath":"config_options.md","filePath":"config_options.md"}');
const _sfc_main = { name: "config_options.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="configuring-qmk" tabindex="-1">Configuring QMK <a class="header-anchor" href="#configuring-qmk" aria-label="Permalink to &quot;Configuring QMK&quot;"></a></h1><p>QMK is nearly infinitely configurable. Wherever possible we err on the side of allowing users to customize their keyboard, even at the expense of code size. That level of flexibility makes for a daunting configuration experience, however.</p><p>There are three main types of configuration files in QMK:</p><ul><li><code>config.h</code>, which contains various preprocessor directives (<code>#define</code>, <code>#ifdef</code>)</li><li><code>rules.mk</code>, which contains additional variables</li><li><code>info.json</code>, which is utilized for <a href="./data_driven_config">data-driven configuration</a></li></ul><p>This page will only discuss the first two types, <code>config.h</code> and <code>rules.mk</code>.</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>While not all settings have data-driven equivalents yet, keyboard makers are encouraged to utilize the <code>info.json</code> file to set the metadata for their boards when possible. See the <a href="./reference_info_json"><code>info.json</code> Format</a> page for more details.</p></div><p>These files exist at various levels in QMK and all files of the same type are combined to build the final configuration. The levels, from lowest priority to highest priority, are:</p><ul><li>QMK Default</li><li>Keyboard</li><li>Folders (Up to 5 levels deep)</li><li>Keymap</li></ul><h2 id="qmk-default" tabindex="-1">QMK Default <a class="header-anchor" href="#qmk-default" aria-label="Permalink to &quot;QMK Default&quot;"></a></h2><p>Every available setting in QMK has a default. If that setting is not set at the Keyboard, Folder, or Keymap level this is the setting that will be used.</p><h2 id="keyboard" tabindex="-1">Keyboard <a class="header-anchor" href="#keyboard" aria-label="Permalink to &quot;Keyboard&quot;"></a></h2><p>This level contains config options that should apply to the whole keyboard. Some settings won&#39;t change in revisions, or most keymaps. Other settings are merely defaults for this keyboard and can be overridden by folders and/or keymaps.</p><h2 id="folders" tabindex="-1">Folders <a class="header-anchor" href="#folders" aria-label="Permalink to &quot;Folders&quot;"></a></h2><p>Some keyboards have folders and sub-folders to allow for different hardware configurations. Most keyboards only go 1 folder deep, but QMK supports structures up to 5 folders deep. Each folder can have its own <code>config.h</code> and <code>rules.mk</code> files that are incorporated into the final configuration.</p><h2 id="keymap" tabindex="-1">Keymap <a class="header-anchor" href="#keymap" aria-label="Permalink to &quot;Keymap&quot;"></a></h2><p>This level contains all of the options for that particular keymap. If you wish to override a previous declaration, you can use <code>#undef &lt;variable&gt;</code> to undefine it, where you can then redefine it without an error.</p><h1 id="the-config-h-file" tabindex="-1">The <code>config.h</code> File <a class="header-anchor" href="#the-config-h-file" aria-label="Permalink to &quot;The `config.h` File&quot;"></a></h1><p>This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The <code>config.h</code> file shouldn&#39;t be including other <code>config.h</code> files.</p><h2 id="hardware-options" tabindex="-1">Hardware Options <a class="header-anchor" href="#hardware-options" aria-label="Permalink to &quot;Hardware Options&quot;"></a></h2><ul><li><code>#define VENDOR_ID 0x1234</code><ul><li>defines your VID, and for most DIY projects, can be whatever you want</li></ul></li><li><code>#define PRODUCT_ID 0x5678</code><ul><li>defines your PID, and for most DIY projects, can be whatever you want</li></ul></li><li><code>#define DEVICE_VER 0x0100</code><ul><li>define
const _hoisted_60 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_60);
}
const config_options = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
config_options as default
};