You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

369 lines
12 KiB

  1. # `info.json`
  2. The information contained in `info.json` is combined with the `config.h` and `rules.mk` files, dynamically generating the necessary configuration for your keyboard at compile time. It is also used by the [QMK API](https://github.com/qmk/qmk_api), and contains the information [QMK Configurator](https://config.qmk.fm/) needs to display a representation of your keyboard. Its key/value pairs are ruled by the [`data/schemas/keyboard.jsonschema`](https://github.com/qmk/qmk_firmware/blob/master/data/schemas/keyboard.jsonschema) file. To learn more about the why and how of the schema file see the [Data Driven Configuration](https://docs.qmk.fm/#/data_driven_config) page.
  3. You can create `info.json` files at every level under `qmk_firmware/keyboards/<name>`. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` specifies more specific information about Clueboard 66%.
  4. ## `info.json` Format
  5. The `info.json` file is a JSON formatted dictionary. The first six keys noted here must be defined in `info.json`, or your keyboard will not be accepted into the QMK repository.
  6. * `keyboard_name`
  7. * A free-form text string describing the keyboard.
  8. * Example: `Clueboard 66%`
  9. * `manufacturer`
  10. * A free-form text string describing the keyboard's manufacturer.
  11. * Example: `Clueboard`
  12. * `url`
  13. * A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard.
  14. * Example: `https://clueboard.co`
  15. * `maintainer`
  16. * GitHub username of the maintainer, or `qmk` for community maintained boards.
  17. * Example: `skullydazed`
  18. * `usb`
  19. * Configure USB VID, PID, and device version. See the [USB](#USB) section for more detail.
  20. * `debounce`
  21. * The amount of time in milliseconds to wait for debounce to happen.
  22. * Default: `5`
  23. * `diode_direction`
  24. * The direction diodes face. See [`DIRECT_PINS` in the hardware configuration](https://docs.qmk.fm/#/config_options?id=hardware-options) for more details.
  25. * `layout_aliases`
  26. * A dictionary containing layout aliases. The key is the alias and the value is a layout in `layouts` it maps to.
  27. * `layouts`
  28. * Physical Layout representations. See the [Layout Format](#layout-format) section for more detail.
  29. * `matrix_pins`
  30. * Configure the pins corresponding to columns and rows, or direct pins. See the [Matrix Pins](#matrix-pins) section for more detail.
  31. * `rgblight`
  32. * Configure the [RGB Lighting feature](feature_rgblight.md). See the [RGB Lighting](#rgb-lighting) section for more detail.
  33. ?> For all the available keys and their allowed values refer back to the [`data/schemas/keyboard.jsonschema`](https://github.com/qmk/qmk_firmware/blob/master/data/schemas/keyboard.jsonschema) file.
  34. ## Layout Format
  35. Within our `info.json` file the `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout macros, for example `LAYOUT_ansi` or `LAYOUT_iso`.
  36. * `layout`
  37. * A list of Key Dictionaries describing the physical layout. See the next section for more details.
  38. ### Key Dictionary Format
  39. Each Key Dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Data for <https://keyboard-layout-editor.com> you will find many of the concepts the same. We re-use the same key names and layout choices wherever possible, but unlike keyboard-layout-editor each key is stateless, inheriting no properties from the keys that came before it.
  40. All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key.
  41. * `x`
  42. * **Required**. The absolute position of the key in the horizontal axis, in Key Units.
  43. * `y`
  44. * **Required**. The absolute position of the key in the vertical axis, in Key Units.
  45. * `w`
  46. * The width of the key, in Key Units.
  47. * Default: `1`
  48. * `h`
  49. * The height of the key, in Key Units.
  50. * Default: `1`
  51. * `label`
  52. * What to name this position in the matrix. This should usually correspond to the keycode for the first layer of the default keymap.
  53. * `matrix`
  54. * A two item list describing the row and column location for this key.
  55. * Example: `[0, 4]`
  56. ## Matrix Pins
  57. Currently QMK supports connecting switches either directly to GPIO pins or via a switch matrix. At this time you can not combine these, they are mutually exclusive.
  58. ### Switch Matrix
  59. Most keyboards use a switch matrix to connect keyswitches to the MCU. You can define your pin columns and rows to configure your switch matrix. When defining switch matrices you should also define your `diode_direction`.
  60. Example:
  61. ```json
  62. {
  63. "diode_direction": "COL2ROW",
  64. "matrix_pins": {
  65. "cols": ["F4", "E6", "B1", "D2"],
  66. "rows": ["B0", "D3", "D5", "D4", "D6"]
  67. }
  68. }
  69. ```
  70. ### Direct Pins
  71. Direct pins are when you connect one side of the switch to GND and the other side to a GPIO pin on your MCU. No diode is required, but there is a 1:1 mapping between switches and pins.
  72. When specifying direct pins you need to arrange them in nested arrays. The outer array consists of rows, while the inner array uses text strings to identify the pins used in each row. You can use `null` to indicate an empty spot in the matrix.
  73. Notice that when using direct pins, `diode_direction` is left undefined.
  74. Example:
  75. ```json
  76. {
  77. "matrix_pins": {
  78. "direct": [
  79. ["A10", "A9"],
  80. ["A0", "B8"],
  81. [null, "B11"],
  82. ["B9", "A8"],
  83. ["A7", "B1"],
  84. [null, "B2"]
  85. ]
  86. }
  87. }
  88. ```
  89. ### Additional Options
  90. * `input_pressed_state`
  91. * This configures state of the GPIO pins when the key is pressed - `1` for high, `0` for low
  92. * Default: `0`
  93. Example:
  94. ```json
  95. "matrix_pins": {
  96. "input_pressed_state": 1,
  97. },
  98. ```
  99. ## Non-RGB LED Lighting
  100. This section controls basic 2-pin LEDs, which typically pass through keyswitches and are soldered into the PCB, or are placed in PCB sockets.
  101. ### Backlight
  102. Enable by setting
  103. ```json
  104. "features": {
  105. "backlight": true
  106. }
  107. ```
  108. * `breathing`
  109. * Enable backlight breathing, if supported
  110. * `breathing_period`
  111. * The length of one backlight “breath” in seconds
  112. * `levels`
  113. * The number of brightness levels (maximum 31, excluding off)
  114. * `max_brightness`
  115. * The maximum duty cycle of the backlight LED(s) (0-255)
  116. * `pin`
  117. * The pin that controls the backlight LED(s)
  118. * `pins`
  119. * Array of pins that controls the backlight LED(s) (See [Multiple Backlight Pins](feature_backlight.md#multiple-backlight-pins))
  120. * `on_state`
  121. * The state of the indicator pins when the LED is "on" - `1` for high, `0` for low
  122. * Default: `1`
  123. Example:
  124. ```json
  125. {
  126. "backlight": {
  127. "breathing": true,
  128. "breathing_period": 5,
  129. "levels": 15,
  130. "pin": "B7"
  131. }
  132. }
  133. ```
  134. ### LED Indicators
  135. Used for indicating Num Lock, Caps Lock, and Scroll Lock. May be soldered in-switch or in a dedicated area.
  136. * `num_lock`
  137. * The pin that controls the `Num Lock` LED
  138. * `caps_lock`
  139. * The pin that controls the `Caps Lock` LED
  140. * `scroll_lock`
  141. * The pin that controls the `Scroll Lock` LED
  142. * `compose`
  143. * The pin that controls the `Compose` LED
  144. * `kana`
  145. * The pin that controls the `Kana` LED
  146. * `on_state`
  147. * The state of the indicator pins when the LED is "on" - `1` for high, `0` for low
  148. * Default: `1`
  149. Example:
  150. ```json
  151. {
  152. "indicators": {
  153. "num_lock": "B6",
  154. "caps_lock": "D2",
  155. "scroll_lock": "A3"
  156. }
  157. }
  158. ```
  159. ## RGB Lighting
  160. This section controls the legacy WS2812 support in QMK. This should not be confused with the RGB Matrix feature, which can be used to control both WS2812 and ISSI RGB LEDs.
  161. The following items can be set. Not every value is required.
  162. * `led_count`
  163. * The number of LEDs in your strip
  164. * `pin`
  165. * The GPIO pin that your LED strip is connected to
  166. * `animations`
  167. * A dictionary that lists enabled and disabled animations. See [RGB Light Animations](#rgb_light_animations) below.
  168. * `sleep`
  169. * Set to `true` to enable lighting during host sleep
  170. * `split`
  171. * Set to `true` to enable synchronization functionality between split halves
  172. * `split_count`
  173. * For split keyboards, the number of LEDs on each side
  174. * Example `[ 10 , 10 ]`
  175. * `max_brightness`
  176. * What the maximum brightness (value) level is (0-255)
  177. * `hue_steps`
  178. * How many steps of adjustment to have for hue
  179. * `saturation_steps`
  180. * How many steps of adjustment to have for saturation
  181. * `brightness_steps`
  182. * How many steps of adjustment to have for brightness (value)
  183. Example:
  184. ```json
  185. {
  186. "rgblight": {
  187. "led_count": 4,
  188. "pin": "F6",
  189. "hue_steps": 10,
  190. "saturation_steps": 17,
  191. "brightness_steps": 17,
  192. "animations": {
  193. "knight": true,
  194. "rainbow_swirl": true
  195. }
  196. }
  197. }
  198. ```
  199. ### RGBLight Animations
  200. The following animations can be enabled:
  201. |Key |Description |
  202. |-----------------|--------------------------------------|
  203. |`alternating` |Enable alternating animation mode. |
  204. |`breathing` |Enable breathing animation mode. |
  205. |`christmas` |Enable christmas animation mode. |
  206. |`knight` |Enable knight animation mode. |
  207. |`rainbow_mood` |Enable rainbow mood animation mode. |
  208. |`rainbow_swirl` |Enable rainbow swirl animation mode. |
  209. |`rgb_test` |Enable RGB test animation mode. |
  210. |`snake` |Enable snake animation mode. |
  211. |`static_gradient`|Enable static gradient mode. |
  212. |`twinkle` |Enable twinkle animation mode. |
  213. ## USB
  214. Every USB keyboard needs to have its USB parameters defined. At a minimum you need to set the Vendor ID, Product ID, and device version.
  215. Example:
  216. ```json
  217. {
  218. "usb": {
  219. "vid": "0xC1ED",
  220. "pid": "0x23B0",
  221. "device_version": "1.0.0"
  222. }
  223. }
  224. ```
  225. The device version is a BCD (binary coded decimal) value, in the format `MMmr`, so the below value would look like `0x0100` in the generated code. This also means the maximum valid values for each part are `99.9.9`, despite it being a hexadecimal value under the hood.
  226. ## Encoders
  227. This section controls the basic [rotary encoder](feature_encoders.md) support.
  228. Enable by setting
  229. ```json
  230. "features": {
  231. "encoder": true
  232. }
  233. ```
  234. The following items can be set. Not every value is required.
  235. * `pin_a`
  236. * __Required__. A pad definition
  237. * `pin_b`
  238. * __Required__. B pad definition
  239. * `resolution`
  240. * How many pulses the encoder registers between each detent
  241. Examples:
  242. ```json
  243. {
  244. "encoder": {
  245. "rotary": [
  246. { "pin_a": "B5", "pin_b": "A2" }
  247. ]
  248. }
  249. }
  250. ```
  251. ```json
  252. {
  253. "encoder": {
  254. "rotary": [
  255. { "pin_a": "B5", "pin_b": "A2", "resolution": 4 }
  256. { "pin_a": "B6", "pin_b": "A3", "resolution": 2 }
  257. ]
  258. }
  259. }
  260. ```
  261. ## Secure
  262. The following options can be configured:
  263. |Key |Description |
  264. |------------------|---------------------------------------------------------------------------------|
  265. |`unlock_sequence` | Timeout for the user to perform the configured unlock sequence - `0` to disable |
  266. |`unlock_timeout` | Timeout while unlocked before returning to locked - `0` to disable |
  267. |`idle_timeout` | Array of matrix locations describing a sequential sequence of keypresses |
  268. Example:
  269. ```json
  270. {
  271. "secure": {
  272. "unlock_sequence": [ [0,0], [0,1] ],
  273. "unlock_timeout": 5000,
  274. "idle_timeout": 60000
  275. }
  276. }
  277. ```
  278. ## Bootmagic
  279. This section configures [Bootmagic Lite](feature_bootmagic.md) support.
  280. The following options can be configured:
  281. |Key |Description |
  282. |---------|-----------------------------------------------------------------------------|
  283. |`matrix` | A two item list describing the row and column location for the trigger key. |
  284. Example:
  285. ```json
  286. {
  287. "bootmagic": {
  288. "enabled": true,
  289. "matrix": [0, 0]
  290. },
  291. }
  292. ```