diff options
| author | toraifu <braydon@kyaa.gg> | 2020-06-29 16:52:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-29 13:52:17 -0700 |
| commit | 09a53d1aa302a166cadbe7c75bc6f64a30e30fe3 (patch) | |
| tree | d1908c686f367e17edcdb35876814701a3f06540 /keyboards/fallacy/indicators.c | |
| parent | 4f9e5d4cdef8ee0ab5a361407ccd8c55dcc186b7 (diff) | |
| download | qmk_firmware-09a53d1aa302a166cadbe7c75bc6f64a30e30fe3.tar.gz qmk_firmware-09a53d1aa302a166cadbe7c75bc6f64a30e30fe3.zip | |
[Keyboard] Fallacy (#9499)
* Add Fallacy
* Accept suggestions
* fixed build error, renamed readme, added keymap specific config to force enable NKRO
* remove FORCE_NKRO on VIA keymap, fix header
* fix info.json to accurately reflect keymap
* remove additional empty layers from default_split_bs keymap
* Accept keymap formatting suggestions
* remove empty config files at keymap level
Diffstat (limited to 'keyboards/fallacy/indicators.c')
| -rwxr-xr-x | keyboards/fallacy/indicators.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/keyboards/fallacy/indicators.c b/keyboards/fallacy/indicators.c new file mode 100755 index 000000000..deda752fa --- /dev/null +++ b/keyboards/fallacy/indicators.c | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* Copyright 2020 B. Fletcher (toraifu) <typefast@kyaa.gg> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "indicators.h" | ||
| 18 | #include "drivers/issi/is31fl3731-simple.h" | ||
| 19 | #include "i2c_master.h" | ||
| 20 | |||
| 21 | /* Set up IS31FL3731 for use in powering indicator LEDs. Absolutely overkill for this job but it was already in the design. | ||
| 22 | * init IS31FL3731 and i2c | ||
| 23 | */ | ||
| 24 | void init_fallacy_leds(void) { | ||
| 25 | i2c_init(); | ||
| 26 | IS31FL3731_init(LED_DRIVER_ADDR_1); | ||
| 27 | |||
| 28 | for (int i = 0; i < LED_DRIVER_LED_COUNT; i++) { | ||
| 29 | IS31FL3731_set_led_control_register(i, true); | ||
| 30 | } | ||
| 31 | |||
| 32 | IS31FL3731_update_led_control_registers(LED_DRIVER_ADDR_1, 0); | ||
| 33 | } | ||
| 34 | |||
| 35 | |||
| 36 | /* update the buffer | ||
| 37 | */ | ||
| 38 | void update_fallacy_leds(void) { | ||
| 39 | IS31FL3731_update_pwm_buffers(LED_DRIVER_ADDR_1, 0); | ||
| 40 | } | ||
| 41 | |||
| 42 | |||
| 43 | /* wrapper to actually set the LED PWM | ||
| 44 | */ | ||
| 45 | void set_fallacy_led(int index, bool state) { | ||
| 46 | if (state) { | ||
| 47 | IS31FL3731_set_value(index, 128); | ||
| 48 | } | ||
| 49 | else { | ||
| 50 | IS31FL3731_set_value(index, 0); | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | |||
| 55 | /* define LED matrix | ||
| 56 | */ | ||
| 57 | const is31_led g_is31_leds[LED_DRIVER_LED_COUNT] = { | ||
| 58 | {0, C1_1}, | ||
| 59 | {0, C2_1}, | ||
| 60 | {0, C3_1}, | ||
| 61 | }; | ||
