mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-02-27 01:56:43 +00:00
16 lines
4.3 KiB
JavaScript
16 lines
4.3 KiB
JavaScript
import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
|
||
const __pageData = JSON.parse('{"title":"APA102 Driver","description":"","frontmatter":{},"headers":[],"relativePath":"drivers/apa102.md","filePath":"drivers/apa102.md"}');
|
||
const _sfc_main = { name: "drivers/apa102.md" };
|
||
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="apa102-driver" tabindex="-1">APA102 Driver <a class="header-anchor" href="#apa102-driver" aria-label="Permalink to "APA102 Driver {#apa102-driver}""></a></h1><p>This driver provides support for APA102 addressable RGB LEDs. They are similar to the <a href="./ws2812">WS2812</a> LEDs, but have increased data and refresh rates.</p><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to "Usage {#usage}""></a></h2><p>In most cases, the APA102 driver code is automatically included if you are using either the <a href="./../features/rgblight">RGBLight</a> or <a href="./../features/rgb_matrix">RGB Matrix</a> feature with the <code>apa102</code> driver set, and you would use those APIs instead.</p><p>However, if you need to use the driver standalone, add the following to your <code>rules.mk</code>:</p><div class="language-make vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">make</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">APA102_DRIVER_REQUIRED = yes</span></span></code></pre></div><p>You can then call the APA102 API by including <code>apa102.h</code> in your code.</p><h2 id="basic-configuration" tabindex="-1">Basic Configuration <a class="header-anchor" href="#basic-configuration" aria-label="Permalink to "Basic Configuration {#basic-configuration}""></a></h2><p>Add the following to your <code>config.h</code>:</p><table><thead><tr><th>Define</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>APA102_DI_PIN</code></td><td><em>Not defined</em></td><td>The GPIO pin connected to the DI pin of the first LED in the chain</td></tr><tr><td><code>APA102_CI_PIN</code></td><td><em>Not defined</em></td><td>The GPIO pin connected to the CI pin of the first LED in the chain</td></tr><tr><td><code>APA102_DEFAULT_BRIGHTNESS</code></td><td><code>31</code></td><td>The default global brightness level of the LEDs, from 0 to 31</td></tr></tbody></table><h2 id="api" tabindex="-1">API <a class="header-anchor" href="#api" aria-label="Permalink to "API {#api}""></a></h2><h3 id="void-apa102-setleds-rgb-led-t-start-led-uint16-t-num-leds" tabindex="-1"><code>void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds)</code> <a class="header-anchor" href="#void-apa102-setleds-rgb-led-t-start-led-uint16-t-num-leds" aria-label="Permalink to "`void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds)`""></a></h3><p>Send RGB data to the APA102 LED chain.</p><h4 id="api-apa102-setleds-arguments" tabindex="-1">Arguments <a class="header-anchor" href="#api-apa102-setleds-arguments" aria-label="Permalink to "Arguments {#api-apa102-setleds-arguments}""></a></h4><ul><li><code>rgb_led_t *start_led</code><br> A pointer to the LED array.</li><li><code>uint16_t num_leds</code><br> The length of the LED array.</li></ul><hr><h3 id="void-apa102-set-brightness-uint8-t-brightness" tabindex="-1"><code>void apa102_set_brightness(uint8_t brightness)</code> <a class="header-anchor" href="#void-apa102-set-brightness-uint8-t-brightness" aria-label="Permalink to "`void apa102_set_brightness(uint8_t brightness)`""></a></h3><p>Set the global brightness.</p><h4 id="api-apa102-set-brightness-arguments" tabindex="-1">Arguments <a class="header-anchor" href="#api-apa102-set-brightness-arguments" aria-label="Permalink to "Arguments {#api-apa102-set-brightness-arguments}""></a></h4><ul><li><code>uint8_t brightness</code><br> The brightness level to set, from 0 to 31.</li></ul>', 20);
|
||
const _hoisted_21 = [
|
||
_hoisted_1
|
||
];
|
||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||
return openBlock(), createElementBlock("div", null, _hoisted_21);
|
||
}
|
||
const apa102 = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||
export {
|
||
__pageData,
|
||
apa102 as default
|
||
};
|