diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2019-04-08 19:57:43 -0400 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-04-08 16:57:43 -0700 |
| commit | fa4052c26e33b42b65521fd5ba9f94a3a778b275 (patch) | |
| tree | b16d69187656b109d98710359c9044edc716aaa2 /drivers/issi/is31fl3737.h | |
| parent | bc536b9b6d98e5428a28f6e6ba69675bd77b79cc (diff) | |
| download | qmk_firmware-fa4052c26e33b42b65521fd5ba9f94a3a778b275.tar.gz qmk_firmware-fa4052c26e33b42b65521fd5ba9f94a3a778b275.zip | |
Adds the Planck EZ, 3737 RGB, fixes out-of-tune notes (#5532)
* RGB Matrix overhaul
Breakout of animations to separate files
Integration of optimized int based math lib
Overhaul of rgb_matrix.c and animations for performance
* Updating effect function api for future extensions
* Combined the keypresses || keyreleases define checks into a single define so I stop forgetting it where necessary
* Moving define RGB_MATRIX_KEYREACTIVE_ENABLED earlier in the include chain
* Adds the Planck EZ, 3737 RGB, fixes out-of-tune notes
* fix bug in quantum/rgb_matrix_drivers.c
Co-Authored-By: jackhumbert <jack.humb@gmail.com>
* update command setting to the correct default
* correct rgb config
* remove commented-out lines
* update docs for the 3737
* Update docs/feature_rgb_matrix.md
Co-Authored-By: jackhumbert <jack.humb@gmail.com>
Diffstat (limited to 'drivers/issi/is31fl3737.h')
| -rw-r--r-- | drivers/issi/is31fl3737.h | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/drivers/issi/is31fl3737.h b/drivers/issi/is31fl3737.h new file mode 100644 index 000000000..69c4b9b53 --- /dev/null +++ b/drivers/issi/is31fl3737.h | |||
| @@ -0,0 +1,207 @@ | |||
| 1 | /* Copyright 2017 Jason Williams | ||
| 2 | * Copyright 2018 Jack Humbert | ||
| 3 | * Copyright 2018 Yiancar | ||
| 4 | * | ||
| 5 | * This program is free software: you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation, either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 19 | |||
| 20 | #ifndef IS31FL3737_DRIVER_H | ||
| 21 | #define IS31FL3737_DRIVER_H | ||
| 22 | |||
| 23 | #include <stdint.h> | ||
| 24 | #include <stdbool.h> | ||
| 25 | |||
| 26 | typedef struct is31_led { | ||
| 27 | uint8_t driver:2; | ||
| 28 | uint8_t r; | ||
| 29 | uint8_t g; | ||
| 30 | uint8_t b; | ||
| 31 | } __attribute__((packed)) is31_led; | ||
| 32 | |||
| 33 | extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; | ||
| 34 | |||
| 35 | void IS31FL3737_init( uint8_t addr ); | ||
| 36 | void IS31FL3737_write_register( uint8_t addr, uint8_t reg, uint8_t data ); | ||
| 37 | void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); | ||
| 38 | |||
| 39 | void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); | ||
| 40 | void IS31FL3737_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); | ||
| 41 | |||
| 42 | void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); | ||
| 43 | |||
| 44 | // This should not be called from an interrupt | ||
| 45 | // (eg. from a timer interrupt). | ||
| 46 | // Call this while idle (in between matrix scans). | ||
| 47 | // If the buffer is dirty, it will update the driver with the buffer. | ||
| 48 | void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); | ||
| 49 | void IS31FL3737_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); | ||
| 50 | |||
| 51 | #define A_1 0x00 | ||
| 52 | #define A_2 0x01 | ||
| 53 | #define A_3 0x02 | ||
| 54 | #define A_4 0x03 | ||
| 55 | #define A_5 0x04 | ||
| 56 | #define A_6 0x05 | ||
| 57 | #define A_7 0x08 | ||
| 58 | #define A_8 0x09 | ||
| 59 | #define A_9 0x0A | ||
| 60 | #define A_10 0x0B | ||
| 61 | #define A_11 0x0C | ||
| 62 | #define A_12 0x0D | ||
| 63 | |||
| 64 | #define B_1 0x10 | ||
| 65 | #define B_2 0x11 | ||
| 66 | #define B_3 0x12 | ||
| 67 | #define B_4 0x13 | ||
| 68 | #define B_5 0x14 | ||
| 69 | #define B_6 0x15 | ||
| 70 | #define B_7 0x18 | ||
| 71 | #define B_8 0x19 | ||
| 72 | #define B_9 0x1A | ||
| 73 | #define B_10 0x1B | ||
| 74 | #define B_11 0x1C | ||
| 75 | #define B_12 0x1D | ||
| 76 | |||
| 77 | #define C_1 0x20 | ||
| 78 | #define C_2 0x21 | ||
| 79 | #define C_3 0x22 | ||
| 80 | #define C_4 0x23 | ||
| 81 | #define C_5 0x24 | ||
| 82 | #define C_6 0x25 | ||
| 83 | #define C_7 0x28 | ||
| 84 | #define C_8 0x29 | ||
| 85 | #define C_9 0x2A | ||
| 86 | #define C_10 0x2B | ||
| 87 | #define C_11 0x2C | ||
| 88 | #define C_12 0x2D | ||
| 89 | |||
| 90 | #define D_1 0x30 | ||
| 91 | #define D_2 0x31 | ||
| 92 | #define D_3 0x32 | ||
| 93 | #define D_4 0x33 | ||
| 94 | #define D_5 0x34 | ||
| 95 | #define D_6 0x35 | ||
| 96 | #define D_7 0x38 | ||
| 97 | #define D_8 0x39 | ||
| 98 | #define D_9 0x3A | ||
| 99 | #define D_10 0x3B | ||
| 100 | #define D_11 0x3C | ||
| 101 | #define D_12 0x3D | ||
| 102 | |||
| 103 | #define E_1 0x40 | ||
| 104 | #define E_2 0x41 | ||
| 105 | #define E_3 0x42 | ||
| 106 | #define E_4 0x43 | ||
| 107 | #define E_5 0x44 | ||
| 108 | #define E_6 0x45 | ||
| 109 | #define E_7 0x48 | ||
| 110 | #define E_8 0x49 | ||
| 111 | #define E_9 0x4A | ||
| 112 | #define E_10 0x4B | ||
| 113 | #define E_11 0x4C | ||
| 114 | #define E_12 0x4D | ||
| 115 | |||
| 116 | #define F_1 0x50 | ||
| 117 | #define F_2 0x51 | ||
| 118 | #define F_3 0x52 | ||
| 119 | #define F_4 0x53 | ||
| 120 | #define F_5 0x54 | ||
| 121 | #define F_6 0x55 | ||
| 122 | #define F_7 0x58 | ||
| 123 | #define F_8 0x59 | ||
| 124 | #define F_9 0x5A | ||
| 125 | #define F_10 0x5B | ||
| 126 | #define F_11 0x5C | ||
| 127 | #define F_12 0x5D | ||
| 128 | |||
| 129 | #define G_1 0x60 | ||
| 130 | #define G_2 0x61 | ||
| 131 | #define G_3 0x62 | ||
| 132 | #define G_4 0x63 | ||
| 133 | #define G_5 0x64 | ||
| 134 | #define G_6 0x65 | ||
| 135 | #define G_7 0x68 | ||
| 136 | #define G_8 0x69 | ||
| 137 | #define G_9 0x6A | ||
| 138 | #define G_10 0x6B | ||
| 139 | #define G_11 0x6C | ||
| 140 | #define G_12 0x6D | ||
| 141 | |||
| 142 | #define H_1 0x70 | ||
| 143 | #define H_2 0x71 | ||
| 144 | #define H_3 0x72 | ||
| 145 | #define H_4 0x73 | ||
| 146 | #define H_5 0x74 | ||
| 147 | #define H_6 0x75 | ||
| 148 | #define H_7 0x78 | ||
| 149 | #define H_8 0x79 | ||
| 150 | #define H_9 0x7A | ||
| 151 | #define H_10 0x7B | ||
| 152 | #define H_11 0x7C | ||
| 153 | #define H_12 0x7D | ||
| 154 | |||
| 155 | #define I_1 0x80 | ||
| 156 | #define I_2 0x81 | ||
| 157 | #define I_3 0x82 | ||
| 158 | #define I_4 0x83 | ||
| 159 | #define I_5 0x84 | ||
| 160 | #define I_6 0x85 | ||
| 161 | #define I_7 0x88 | ||
| 162 | #define I_8 0x89 | ||
| 163 | #define I_9 0x8A | ||
| 164 | #define I_10 0x8B | ||
| 165 | #define I_11 0x8C | ||
| 166 | #define I_12 0x8D | ||
| 167 | |||
| 168 | #define J_1 0x90 | ||
| 169 | #define J_2 0x91 | ||
| 170 | #define J_3 0x92 | ||
| 171 | #define J_4 0x93 | ||
| 172 | #define J_5 0x94 | ||
| 173 | #define J_6 0x95 | ||
| 174 | #define J_7 0x98 | ||
| 175 | #define J_8 0x99 | ||
| 176 | #define J_9 0x9A | ||
| 177 | #define J_10 0x9B | ||
| 178 | #define J_11 0x9C | ||
| 179 | #define J_12 0x9D | ||
| 180 | |||
| 181 | #define K_1 0xA0 | ||
| 182 | #define K_2 0xA1 | ||
| 183 | #define K_3 0xA2 | ||
| 184 | #define K_4 0xA3 | ||
| 185 | #define K_5 0xA4 | ||
| 186 | #define K_6 0xA5 | ||
| 187 | #define K_7 0xA8 | ||
| 188 | #define K_8 0xA9 | ||
| 189 | #define K_9 0xAA | ||
| 190 | #define K_10 0xAB | ||
| 191 | #define K_11 0xAC | ||
| 192 | #define K_12 0xAD | ||
| 193 | |||
| 194 | #define L_1 0xB0 | ||
| 195 | #define L_2 0xB1 | ||
| 196 | #define L_3 0xB2 | ||
| 197 | #define L_4 0xB3 | ||
| 198 | #define L_5 0xB4 | ||
| 199 | #define L_6 0xB5 | ||
| 200 | #define L_7 0xB8 | ||
| 201 | #define L_8 0xB9 | ||
| 202 | #define L_9 0xBA | ||
| 203 | #define L_10 0xBB | ||
| 204 | #define L_11 0xBC | ||
| 205 | #define L_12 0xBD | ||
| 206 | |||
| 207 | #endif // IS31FL3737_DRIVER_H | ||
