aboutsummaryrefslogtreecommitdiffstats
path: root/tests/asicworld/code_tidbits_fsm_using_function.v
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-09-03 16:37:59 -0700
committerEddie Hung <eddie@fpgeh.com>2019-09-03 16:37:59 -0700
commit80aec0f006b91b0163c8be94f2450223e6e97a52 (patch)
treec52d47e482fe9c598450e97a6668afbab694e49b /tests/asicworld/code_tidbits_fsm_using_function.v
parent16316aa05d548c79fa1580defe71097efdeb78b9 (diff)
downloadyosys-80aec0f006b91b0163c8be94f2450223e6e97a52.tar.gz
yosys-80aec0f006b91b0163c8be94f2450223e6e97a52.tar.bz2
yosys-80aec0f006b91b0163c8be94f2450223e6e97a52.zip
st.ffP from if to assert
Diffstat (limited to 'tests/asicworld/code_tidbits_fsm_using_function.v')
0 files changed, 0 insertions, 0 deletions
122'>122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
# Supporting Your Keyboard in QMK Configurator

This page covers how to properly support keyboards in the [QMK Configurator](https://config.qmk.fm/).


## How the Configurator Understands Keyboards

To understand how the Configurator understands keyboards, first one must understand layout macros. For this exercise, we're going to imagine a 17-key numpad PCB, which we're going to call `numpad`.

```
|---------------|
|NLk| / | * | - |
|---+---+---+---|
|7  |8  |9  | + |
|---+---+---|   |
|4  |5  |6  |   |
|---+---+---+---|
|1  |2  |3  |Ent|
|-------+---|   |
|0      | . |   |
|---------------|
```

?> For more on layout macros, see [Understanding QMK: Matrix Scanning](understanding_qmk.md?id=matrix-scanning) and [Understanding QMK: Matrix to Physical Layout Map](understanding_qmk.md?id=matrix-to-physical-layout-map).

The Configurator's API reads the keyboard's `.h` file from `qmk_firmware/keyboards/<keyboard>/<keyboard>.h`. For our numpad, this file would be `qmk_firmware/keyboards/numpad/numpad.h`:

```c
#pragma once

#define LAYOUT( \
    k00, k01, k02, k03, \
    k10, k11, k12, k13, \
    k20, k21, k22,      \
    k30, k31, k32, k33, \
    k40,      k42       \
  ) { \
    { k00, k01,   k02, k03   }, \
    { k10, k11,   k12, k13   }, \
    { k20, k21,   k22, KC_NO }, \
    { k30, k31,   k32, k33   }, \
    { k40, KC_NO, k42, KC_NO }  \
}
```

QMK uses `KC_NO` to designate places in the switch matrix where there is no switch. Sometimes, `XXX`, `___` or `____` are used as shorthand to make this section easier to read if it needs to be debugged. This is usually defined near the beginning of the `.h` file:

```c
#pragma once

#define XXX KC_NO

#define LAYOUT( \
    k00, k01, k02, k03, \