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('

APA102 Driver

This driver provides support for APA102 addressable RGB LEDs. They are similar to the WS2812 LEDs, but have increased data and refresh rates.

Usage

In most cases, the APA102 driver code is automatically included if you are using either the RGBLight or RGB Matrix feature with the apa102 driver set, and you would use those APIs instead.

However, if you need to use the driver standalone, add the following to your rules.mk:

make
APA102_DRIVER_REQUIRED = yes

You can then call the APA102 API by including apa102.h in your code.

Basic Configuration

Add the following to your config.h:

DefineDefaultDescription
APA102_DI_PINNot definedThe GPIO pin connected to the DI pin of the first LED in the chain
APA102_CI_PINNot definedThe GPIO pin connected to the CI pin of the first LED in the chain
APA102_DEFAULT_BRIGHTNESS31The default global brightness level of the LEDs, from 0 to 31

API

void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds)

Send RGB data to the APA102 LED chain.

Arguments


void apa102_set_brightness(uint8_t brightness)

Set the global brightness.

Arguments

', 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 };