<divid="app"><divclass="Layout"data-v-5d98c3a5><!--[--><!--]--><!--[--><spantabindex="-1"data-v-0f60ec36></span><ahref="#VPContent"class="VPSkipLink visually-hidden"data-v-0f60ec36> Skip to content </a><!--]--><!----><headerclass="VPNav"data-v-5d98c3a5data-v-ae24b3ad><divclass="VPNavBar has-sidebar top"data-v-ae24b3addata-v-ccf7ddec><divclass="wrapper"data-v-ccf7ddec><divclass="container"data-v-ccf7ddec><divclass="title"data-v-ccf7ddec><divclass="VPNavBarTitle has-sidebar"data-v-ccf7ddecdata-v-ab179fa1><aclass="title"href="/"data-v-ab179fa1><!--[--><!--]--><!--[--><!--[--><!--[--><imgclass="VPImage dark logo"src="/qmk-logo-dark.svg"altdata-v-8426fc1a><!--]--><!--[--><imgclass="VPImage light logo"src="/qmk-logo-light.svg"altdata-v-8426fc1a><!--]--><!--]--><!--]--><spandata-v-ab179fa1>QMK Firmware</span><!--[--><!--]--></a></div></div><divclass="content"data-v-ccf7ddec><divclass="content-body"data-v-ccf7ddec><!--[--><!--]--><divclass="VPNavBarSearch search"data-v-ccf7ddec><!--[--><!----><divid="local-search"><buttontype="button"class="DocSearch DocSearch-Button"aria-label="Search"><spanclass="DocSearch-Button-Container"><spanclass="vp-icon DocSearch-Search-Icon"></span><spanclass="DocSearch-Button-Placeholder">Search</span></span><spanclass="DocSearch-Button-Keys"><kbdclass="DocSearch-Button-Key"></kbd><kbdclass="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><navaria-labelledby="main-nav-aria-label"class="VPNavBarMenu menu"data-v-ccf7ddecdata-v-7f418b0f><spanid="main-nav-aria-label"class="visually-hidden"data-v-7f418b0f>Main Navigation</span><!--[--><!--[--><aclass="VPLink link VPNavBarMenuLink"href="/"tabindex="0"data-v-7f418b0fdata-v-9c663999><!--[--><spandata-v-9c663999>Home</span><!--]--></a><!--]--><!--]--></nav><!----><divclass="VPNavBarAppearance appearance"data-v-ccf7ddecdata-v-e6aabb21><buttonclass="VPSwitch VPSwitchAppearance"type="button"role="switch"title="Switch to dark theme"aria-checked="false"data-v-e6aabb21data-v-d1f28634data-v-1d5665e3><spanclass="check"data-v-1d5665e3><spanclass="icon"data-v-1d5665e3><!--[--><spanclass="vpi-sun sun"data-v-d1f28634></span><spanclass="vpi-moon moon"data-v-d1f28634></span><!--]--></span></span></button></div><divclass="VPSocialLinks VPNavBarSocialLinks social-links"data-v-ccf7ddecdata-v-0394ad82data-v-7bc22406><!--[--><aclass="VPSocialLink no-icon"href="https://reddit.com/r/olkb"aria-labeltarget="_blank"rel="noopener"data-v-7bc22406data-v-eee4e7cb><svgxmlns="http://www.w3.org/2000/svg"viewBox="0 0 50 50"width="50px"height="50px"><pathd="M293C28.0625327.1640633.38281326.54C25.8359384.61718825.3632815.433594256.40625C24.3554698.14062524.08593810.39453124.0312513.03125C19.23437513.17968814.82031314.42187511.2812516.46875C10.21484415.468758.85546914.968757.514.96875C6.08984414.968754.67578115.5117193.5937516.59375C1.42578118.7617191.42578122.2382813.5937524.40625L3.8437524.65625C3.312526.035156327.488281329C333.5273445.56640637.5859389.562540.4375C13.55859443.28906319.007813452545C30.9921884536.44140643.28906340.437540.4375C44.43359437.5859384733.5273444729C4727.48828146.687526.03515646.1562524.65625L46.4062524.40625C48.57421922.23828148.57421918.76171946.4062516.59375C45.32421915.51171943.91015614.9687542.514.96875C41.14453114.9687539.78515615.4687538.7187516.46875C35.19531314.43359430.80078113.19140626.0312513.03125C26.0937510.54687526.3632818.4687526.8757.09375C27.1640636.31640627.5273445.75781327.8755.4375C28.2226565.11718828.5390635295C29.460938529.6835945.12530.031255.40625C30.3789065.687530.7851566.14843831.31256.6875C32.2539067.65234433.6953138.71484436.093758.9375C36.53906311.23828138.574219134113C43.75134610.75468C465.2543.753413C38.605469336.5742194.71093836.093756.96875C34.31256.79687533.5273446.10937532.755.3125C32.3007814.85156331.8867194
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SRC += is31fl3741-mono.c </span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># For single-color</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SRC += is31fl3741.c </span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># For RGB</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">I2C_DRIVER_REQUIRED = yes</span></span></code></pre></div><h2id="basic-configuration"tabindex="-1">Basic Configuration <aclass="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>IS31FL3741_SDB_PIN</code></td><td><em>Not defined</em></td><td>The GPIO pin connected to the drivers' shutdown pins</td></tr><tr><td><code>IS31FL3741_I2C_TIMEOUT</code></td><td><code>100</code></td><td>The I²C timeout in milliseconds</td></tr><tr><td><code>IS31FL3741_I2C_PERSISTENCE</code></td><td><code>0</code></td><td>The number of times to retry I²C transmissions</td></tr><tr><td><code>IS31FL3741_I2C_ADDRESS_1</code></td><td><em>Not defined</em></td><td>The I²C address of driver 0</td></tr><tr><td><code>IS31FL3741_I2C_ADDRESS_2</code></td><td><em>Not defined</em></td><td>The I²C address of driver 1</td></tr><tr><td><code>IS31FL3741_I2C_ADDRESS_3</code></td><td><em>Not defined</em></td><td>The I²C address of driver 2</td></tr><tr><td><code>IS31FL3741_I2C_ADDRESS_4</code></td><td><em>Not defined</em></td><td>The I²C address of driver 3</td></tr><tr><td><code>IS31FL3741_CONFIGURATION</code></td><td><code>1</code></td><td>The value of the configuration register</td></tr><tr><td><code>IS31FL3741_PWM_FREQUENCY</code></td><td><code>IS31FL3741_PWM_FREQUENCY_29K_HZ</code></td><td>The PWM frequency of the LEDs (IS31FL3741A only)</td></tr><tr><td><code>IS31FL3741_SW_PULLUP</code></td><td><code>IS31FL3741_PUR_32K_OHM</code></td><td>The <code>SWx</code> pullup resistor value</td></tr><tr><td><code>IS31FL3741_CS_PULLDOWN</code></td><td><code>IS31FL3741_PDR_32K_OHM</code></td><td>The <code>CSx</code> pulldown resistor value</td></tr><tr><td><code>IS31FL3741_GLOBAL_CURRENT</code></td><td><code>0xFF</code></td><td>The global current control value</td></tr></tbody></table><h3id="i2c-addressing"tabindex="-1">I²C Addressing <aclass="header-anchor"href="#i2c-addressing"aria-label="Permalink to "I²C Addressing {#i2c-addressing}""></a></h3><p>The IS31FL3741 has four possible 7-bit I²C addresses, depending on how the <code>ADDR</code> pin is connected.</p><p>To configure this, set the <code>IS31FL3741_I2C_ADDRESS_n</code> defines to one of the following in your <code>config.h</code>, where <em>n</em> denotes the driver index:</p><table><thead><tr><th>Define</th><th>Value</th></tr></thead><tbody><tr><td><code>IS31FL3741_I2C_ADDRESS_GND</code></td><td><code>0x30</code></td></tr><tr><td><code>IS31FL3741_I2C_ADDRESS_SCL</code></td><td><code>0x31</code></td></tr><tr><td><code>IS31FL3741_I2C_ADDRESS_SDA</code></td><td><code>0x32</code></td></tr><tr><td><code>IS31FL3741_I2C_ADDRESS_VCC</code></td><td><code>0x33</code></td></tr></tbody></table><h3id="pwm-frequency"tabindex="-1">PWM Frequency <aclass="header-anchor"href="#pwm-frequency"aria-label="Permalink to "PWM Frequency {#pwm-frequency}""></a></h3><p>The PWM frequency can be adjusted (for IS31FL3741A only) by adding the following to your <code>config.h</code>:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IS31FL3741_PWM_FREQUENCY</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> IS31FL3741_PWM_FREQUENCY_29K_HZ</span></span></code></pre></div><p>Valid values are:</p><table><thead><tr><th>Define</th><th>Frequency</th></tr></thead><tbody><tr><td><code>IS31FL3741_PWM_FREQUENCY_29K_HZ</code></td><td>29 kHz (default)</td></tr><tr><td><code>IS31FL3741_PWM_FREQUENCY_3K6_HZ</code></td><td>3.6 kHz</td></tr><tr><td><code>IS31FL3741_PWM_FREQUENCY_1K8_HZ</code></
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IS31FL3741_CS_PULLDOWN</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> IS31FL3741_PDR_32K_OHM</span></span></code></pre></div><p>Valid values for <code>IS31FL3741_SW_PULLUP</code> are:</p><table><thead><tr><th>Define</th><th>Resistance</th></tr></thead><tbody><tr><td><code>IS31FL3741_PUR_0_OHM</code></td><td>None</td></tr><tr><td><code>IS31FL3741_PUR_0K5_OHM</code></td><td>0.5 kΩ</td></tr><tr><td><code>IS31FL3741_PUR_1K_OHM</code></td><td>1 kΩ</td></tr><tr><td><code>IS31FL3741_PUR_2K_OHM</code></td><td>2 kΩ</td></tr><tr><td><code>IS31FL3741_PUR_4K_OHM</code></td><td>4 kΩ</td></tr><tr><td><code>IS31FL3741_PUR_8K_OHM</code></td><td>8 kΩ</td></tr><tr><td><code>IS31FL3741_PUR_16K_OHM</code></td><td>16 kΩ</td></tr><tr><td><code>IS31FL3741_PUR_32K_OHM</code></td><td>32 kΩ (default)</td></tr></tbody></table><p>Valid values for <code>IS31FL3741_CS_PULLDOWN</code> are:</p><table><thead><tr><th>Define</th><th>Resistance</th></tr></thead><tbody><tr><td><code>IS31FL3741_PDR_0_OHM</code></td><td>None</td></tr><tr><td><code>IS31FL3741_PDR_0K5_OHM</code></td><td>0.5 kΩ</td></tr><tr><td><code>IS31FL3741_PDR_1K_OHM</code></td><td>1 kΩ</td></tr><tr><td><code>IS31FL3741_PDR_2K_OHM</code></td><td>2 kΩ</td></tr><tr><td><code>IS31FL3741_PDR_4K_OHM</code></td><td>4 kΩ</td></tr><tr><td><code>IS31FL3741_PDR_8K_OHM</code></td><td>8 kΩ</td></tr><tr><td><code>IS31FL3741_PDR_16K_OHM</code></td><td>16 kΩ</td></tr><tr><td><code>IS31FL3741_PDR_32K_OHM</code></td><td>32 kΩ (default)</td></tr></tbody></table><h3id="global-current-control"tabindex="-1">Global Current Control <aclass="header-anchor"href="#global-current-control"aria-label="Permalink to "Global Current Control {#global-current-control}""></a></h3><p>This setting controls the current sunk by the <code>CSx</code> pins, from 0 to 255. By default, the value is the maximum (255), but if you need to lower it, add the following to your <code>config.h</code>:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> IS31FL3741_GLOBAL_CURRENT</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> 0x</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">FF</span></span></code></pre></div><h2id="arm-configuration"tabindex="-1">ARM/ChibiOS Configuration <aclass="header-anchor"href="#arm-configuration"aria-label="Permalink to "ARM/ChibiOS Configuration {#arm-configuration}""></a></h2><p>Depending on the ChibiOS board configuration, you may need to <ahref="./i2c#arm-configuration">enable and configure I²C</a> at the keyboard level.</p><h2id="led-mapping"tabindex="-1">LED Mapping <aclass="header-anchor"href="#led-mapping"aria-label="Permalink to "LED Mapping {#led-mapping}""></a></h2><p>In order to use this driver, each output must be mapped to an LED index, by adding the following to your <code><keyboardname>.c</code>:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> is31fl3741_led_t</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PROGMEM </span><spanstyle="--shiki-light:#E36209;--shiki-dark:#FFAB70;">g_is31fl3741_leds</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[IS31FL3741_LED_COUNT] </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><p>In this example, the red, green and blue channels for the first LED index on driver 0 all have their anodes connected to the <code>SW1</code> pin, and their cathodes on the <code>CS1</code>, <code>CS2</code> and <code>CS3</code> pins respectively.</p><p>For the single-color driver, the principle is the same, but there is only one channel:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> is31fl3741_led_t</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PROGMEM </span><spanstyle="--shiki-light:#E36209;--shiki-dark:#FFAB70;">g_is31fl3741_leds</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[IS31FL3741_LED_COUNT] </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><p>These values correspond to the register indices as shown in the datasheet on page 12, figure 8.</p><h2id="api"tabindex="-1">API <aclass="header-anchor"href="#api"aria-label="Permalink to "API {#api}""></a></h2><h3id="api-is31fl3741-led-t"tabindex="-1"><code>struct is31fl3741_led_t</code><aclass="header-anchor"href="#api-is31fl3741-led-t"aria-label="Permalink to "`struct is31fl3741_led_t` {#api-is31fl3741-led-t}""></a></h3><p>Contains the PWM register addresses for a single RGB LED.</p><h4id="api-is31fl3741-led-t-members"tabindex="-1">Members <aclass="header-anchor"href="#api-is31fl3741-led-t-members"aria-label="Permalink to "Members {#api-is31fl3741-led-t-members}""></a></h4><ul><li><code>uint32_t driver</code><br> The driver index of the LED, from 0 to 3.</li><li><code>uint32_t r</code><br> The output PWM register address for the LED's red channel (RGB driver only).</li><li><code>uint32_t g</code><br> The output PWM register address for the LED's green channel (RGB driver only).</li><li><code>uint32_t b</code><br> The output PWM register address for the LED's blue channel (RGB driver only).</li><li><code>uint32_t v</code><br> The output PWM register address for the LED (single-color driver only).</li></ul><hr><h3id="api-is31fl3741-init"tabindex="-1"><code>void is31fl3741_init(uint8_t index)</code><aclass="header-anchor"href="#api-is31fl3741-init"aria-label="Permalink to "`void is31fl3741_init(uint8_t index)` {#api-is31fl3741-init}""></a></h3><p>Initialize the LED driver. This function should be called first.</p><h4id="api-is31fl3741-init-arguments"tabindex="-1">Arguments <aclass="header-anchor"href="#api-is31fl3741-init-arguments"aria-label="Permalink to "Arguments {#api-is31fl3741-init-arguments}""></a></h4><ul><li><code>uint8_t index</code><br> The driver index.</li></ul><hr><h3id="api-is31fl3741-write-register"tabindex="-1"><code>void is31fl3741_write_register(uint8_t index, uint8_t reg, uint8_t data)</code><aclass="header-anchor"href="#api-is31fl3741-write-register"aria-label="Permalink to "`void is31fl3741_write_register(uint8_t index, uint8_t reg, uint8_t data)` {#api-is31fl3741-write-register}""></a></h3><p>Set the value of the given register.</p><h4id="api-is31fl3741-write-register-arguments"tabindex="-1">Arguments <aclass="header-anchor"href="#api-is31fl3741-write-register-arguments"aria-label="Permalink to "Arguments {#api-is31fl3741-write-register-arguments}""></a></h4><ul><li><code>uint8_t index</code><br> The driver index.</li><li><code>uint8_t reg</code><br> The register address.</li><li><code>uint8_t data</code><br> The value to set.</li></ul><hr><h3id="api-is31fl3741-select-page"tabindex="-1"><code>void is31fl3741_select_page(uint8_t index, uint8_t page)</code><aclass="header-anchor"href="#api-is31fl3741-select-page"aria-label="Permalink to "`void is31fl3741_select_page(uint8_t index, uint8_t page)` {#api-is31fl3741-select-page}""></a></h3><p>Change the current page for configuring the LED driver.</p><h4id="api-is31fl3741-select-page-arguments"tabindex="-1">Arguments <aclass="header-anchor"href="#api-is31fl3741-select-page-arguments"aria-label="Permalink to "Arguments {#api-is31fl3741-select-page-arguments}""></a></h4><ul><li><code>uint8_t index</code><br> The driver index.</li><li><code>uint8_t page</code><br> The page number to select.</li></ul><hr><h3id="api-is31fl3741-set-color"tabindex="-1"><code>void is31fl3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue)</code><aclass="header-anchor"href="#api-is31fl3741-set-color"aria-label="Permalink to "`void is31fl3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue)` {#api-is31fl3741-set-color}""></a></h3><p>Set the color of a single LED (RGB driver only). This function does not immediately update the LEDs; call <code>is