aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include/chstreams.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-29 18:03:49 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-29 18:03:49 +0000
commitb30ba31603e2e1f130e9af44f1f140390fff65fe (patch)
tree74a12daa05c7bb3e96d317cc8f2d536d09c33f64 /os/kernel/include/chstreams.h
parent40a709f42fb95106a467dccbda0f042280a1a21d (diff)
downloadChibiOS-b30ba31603e2e1f130e9af44f1f140390fff65fe.tar.gz
ChibiOS-b30ba31603e2e1f130e9af44f1f140390fff65fe.tar.bz2
ChibiOS-b30ba31603e2e1f130e9af44f1f140390fff65fe.zip
I2C API proposal.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3684 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/chstreams.h')
0 files changed, 0 insertions, 0 deletions
id='n127' href='#n127'>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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
# Backlighting

Many keyboards support backlit keys by way of individual LEDs placed through or underneath the keyswitches. This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously install multiple different single coloured LEDs on a keyboard.

QMK is able to control the brightness of these LEDs by switching them on and off rapidly in a certain ratio, a technique known as *Pulse Width Modulation*, or PWM. By altering the duty cycle of the PWM signal, it creates the illusion of dimming.

The MCU can only supply so much current to its GPIO pins. Instead of powering the backlight directly from the MCU, the backlight pin is connected to a transistor or MOSFET that switches the power to the LEDs.

## Feature Configuration

Most keyboards have backlighting enabled by default if they support it, but if it is not working for you, check that your `rules.mk` includes the following:

```makefile
BACKLIGHT_ENABLE = yes
```

## Keycodes
Once enabled the following keycodes below can be used to change the backlight level.

|Key      |Description                               |
|---------|------------------------------------------|
|`BL_TOGG`|Turn the backlight on or off              |
|`BL_STEP`|Cycle through backlight levels            |
|`BL_ON`  |Set the backlight to max brightness       |
|`BL_OFF` |Turn the backlight off                    |
|`BL_INC` |Increase the backlight level              |
|`BL_DEC` |Decrease the backlight level              |
|`BL_BRTG`|Toggle backlight breathing                |

## Backlight Functions

|Function  |Description                                                |
|----------|-----------------------------------------------------------|
|`backlight_toggle()`    |Turn the backlight on or off                 |
|`backlight_enable()`    |Turn the backlight on                        |
|`backlight_disable()`   |Turn the backlight off                       |
|`backlight_step()`      |Cycle through backlight levels               |
|`backlight_increase()`  |Increase the backlight level                 |
|`backlight_decrease()`  |Decrease the backlight level                 |
|`backlight_level(x)`    |Sets the backlight level to specified level  |