diff options
Diffstat (limited to 'keyboards/lets_split')
26 files changed, 2017 insertions, 184 deletions
diff --git a/keyboards/lets_split/common/glcdfont.c b/keyboards/lets_split/common/glcdfont.c new file mode 100644 index 000000000..6f88bd23a --- /dev/null +++ b/keyboards/lets_split/common/glcdfont.c | |||
| @@ -0,0 +1,276 @@ | |||
| 1 | // This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. | ||
| 2 | // See gfxfont.h for newer custom bitmap font info. | ||
| 3 | |||
| 4 | #ifndef FONT5X7_H | ||
| 5 | #define FONT5X7_H | ||
| 6 | |||
| 7 | #ifdef __AVR__ | ||
| 8 | #include <avr/io.h> | ||
| 9 | #include <avr/pgmspace.h> | ||
| 10 | #elif defined(ESP8266) | ||
| 11 | #include <pgmspace.h> | ||
| 12 | #else | ||
| 13 | #define PROGMEM | ||
| 14 | #endif | ||
| 15 | |||
| 16 | // Standard ASCII 5x7 font | ||
| 17 | |||
| 18 | static const unsigned char font[] PROGMEM = { | ||
| 19 | 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 20 | 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, | ||
| 21 | 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, | ||
| 22 | 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, | ||
| 23 | 0x18, 0x3C, 0x7E, 0x3C, 0x18, | ||
| 24 | 0x1C, 0x57, 0x7D, 0x57, 0x1C, | ||
| 25 | 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, | ||
| 26 | 0x00, 0x18, 0x3C, 0x18, 0x00, | ||
| 27 | 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, | ||
| 28 | 0x00, 0x18, 0x24, 0x18, 0x00, | ||
| 29 | 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, | ||
| 30 | 0x30, 0x48, 0x3A, 0x06, 0x0E, | ||
| 31 | 0x26, 0x29, 0x79, 0x29, 0x26, | ||
| 32 | 0x40, 0x7F, 0x05, 0x05, 0x07, | ||
| 33 | 0x40, 0x7F, 0x05, 0x25, 0x3F, | ||
| 34 | 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, | ||
| 35 | 0x7F, 0x3E, 0x1C, 0x1C, 0x08, | ||
| 36 | 0x08, 0x1C, 0x1C, 0x3E, 0x7F, | ||
| 37 | 0x14, 0x22, 0x7F, 0x22, 0x14, | ||
| 38 | 0x5F, 0x5F, 0x00, 0x5F, 0x5F, | ||
| 39 | 0x06, 0x09, 0x7F, 0x01, 0x7F, | ||
| 40 | 0x00, 0x66, 0x89, 0x95, 0x6A, | ||
| 41 | 0x60, 0x60, 0x60, 0x60, 0x60, | ||
| 42 | 0x94, 0xA2, 0xFF, 0xA2, 0x94, | ||
| 43 | 0x08, 0x04, 0x7E, 0x04, 0x08, | ||
| 44 | 0x10, 0x20, 0x7E, 0x20, 0x10, | ||
| 45 | 0x08, 0x08, 0x2A, 0x1C, 0x08, | ||
| 46 | 0x08, 0x1C, 0x2A, 0x08, 0x08, | ||
| 47 | 0x1E, 0x10, 0x10, 0x10, 0x10, | ||
| 48 | 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, | ||
| 49 | 0x30, 0x38, 0x3E, 0x38, 0x30, | ||
| 50 | 0x06, 0x0E, 0x3E, 0x0E, 0x06, | ||
| 51 | 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 52 | 0x00, 0x00, 0x5F, 0x00, 0x00, | ||
| 53 | 0x00, 0x07, 0x00, 0x07, 0x00, | ||
| 54 | 0x14, 0x7F, 0x14, 0x7F, 0x14, | ||
| 55 | 0x24, 0x2A, 0x7F, 0x2A, 0x12, | ||
| 56 | 0x23, 0x13, 0x08, 0x64, 0x62, | ||
| 57 | 0x36, 0x49, 0x56, 0x20, 0x50, | ||
| 58 | 0x00, 0x08, 0x07, 0x03, 0x00, | ||
| 59 | 0x00, 0x1C, 0x22, 0x41, 0x00, | ||
| 60 | 0x00, 0x41, 0x22, 0x1C, 0x00, | ||
| 61 | 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, | ||
| 62 | 0x08, 0x08, 0x3E, 0x08, 0x08, | ||
| 63 | 0x00, 0x80, 0x70, 0x30, 0x00, | ||
| 64 | 0x08, 0x08, 0x08, 0x08, 0x08, | ||
| 65 | 0x00, 0x00, 0x60, 0x60, 0x00, | ||
| 66 | 0x20, 0x10, 0x08, 0x04, 0x02, | ||
| 67 | 0x3E, 0x51, 0x49, 0x45, 0x3E, | ||
| 68 | 0x00, 0x42, 0x7F, 0x40, 0x00, | ||
| 69 | 0x72, 0x49, 0x49, 0x49, 0x46, | ||
| 70 | 0x21, 0x41, 0x49, 0x4D, 0x33, | ||
| 71 | 0x18, 0x14, 0x12, 0x7F, 0x10, | ||
| 72 | 0x27, 0x45, 0x45, 0x45, 0x39, | ||
| 73 | 0x3C, 0x4A, 0x49, 0x49, 0x31, | ||
| 74 | 0x41, 0x21, 0x11, 0x09, 0x07, | ||
| 75 | 0x36, 0x49, 0x49, 0x49, 0x36, | ||
| 76 | 0x46, 0x49, 0x49, 0x29, 0x1E, | ||
| 77 | 0x00, 0x00, 0x14, 0x00, 0x00, | ||
| 78 | 0x00, 0x40, 0x34, 0x00, 0x00, | ||
| 79 | 0x00, 0x08, 0x14, 0x22, 0x41, | ||
| 80 | 0x14, 0x14, 0x14, 0x14, 0x14, | ||
| 81 | 0x00, 0x41, 0x22, 0x14, 0x08, | ||
| 82 | 0x02, 0x01, 0x59, 0x09, 0x06, | ||
| 83 | 0x3E, 0x41, 0x5D, 0x59, 0x4E, | ||
| 84 | 0x7C, 0x12, 0x11, 0x12, 0x7C, | ||
| 85 | 0x7F, 0x49, 0x49, 0x49, 0x36, | ||
| 86 | 0x3E, 0x41, 0x41, 0x41, 0x22, | ||
| 87 | 0x7F, 0x41, 0x41, 0x41, 0x3E, | ||
| 88 | 0x7F, 0x49, 0x49, 0x49, 0x41, | ||
| 89 | 0x7F, 0x09, 0x09, 0x09, 0x01, | ||
| 90 | 0x3E, 0x41, 0x41, 0x51, 0x73, | ||
| 91 | 0x7F, 0x08, 0x08, 0x08, 0x7F, | ||
| 92 | 0x00, 0x41, 0x7F, 0x41, 0x00, | ||
| 93 | 0x20, 0x40, 0x41, 0x3F, 0x01, | ||
| 94 | 0x7F, 0x08, 0x14, 0x22, 0x41, | ||
| 95 | 0x7F, 0x40, 0x40, 0x40, 0x40, | ||
| 96 | 0x7F, 0x02, 0x1C, 0x02, 0x7F, | ||
| 97 | 0x7F, 0x04, 0x08, 0x10, 0x7F, | ||
| 98 | 0x3E, 0x41, 0x41, 0x41, 0x3E, | ||
| 99 | 0x7F, 0x09, 0x09, 0x09, 0x06, | ||
| 100 | 0x3E, 0x41, 0x51, 0x21, 0x5E, | ||
| 101 | 0x7F, 0x09, 0x19, 0x29, 0x46, | ||
| 102 | 0x26, 0x49, 0x49, 0x49, 0x32, | ||
| 103 | 0x03, 0x01, 0x7F, 0x01, 0x03, | ||
| 104 | 0x3F, 0x40, 0x40, 0x40, 0x3F, | ||
| 105 | 0x1F, 0x20, 0x40, 0x20, 0x1F, | ||
| 106 | 0x3F, 0x40, 0x38, 0x40, 0x3F, | ||
| 107 | 0x63, 0x14, 0x08, 0x14, 0x63, | ||
| 108 | 0x03, 0x04, 0x78, 0x04, 0x03, | ||
| 109 | 0x61, 0x59, 0x49, 0x4D, 0x43, | ||
| 110 | 0x00, 0x7F, 0x41, 0x41, 0x41, | ||
| 111 | 0x02, 0x04, 0x08, 0x10, 0x20, | ||
| 112 | 0x00, 0x41, 0x41, 0x41, 0x7F, | ||
| 113 | 0x04, 0x02, 0x01, 0x02, 0x04, | ||
| 114 | 0x40, 0x40, 0x40, 0x40, 0x40, | ||
| 115 | 0x00, 0x03, 0x07, 0x08, 0x00, | ||
| 116 | 0x20, 0x54, 0x54, 0x78, 0x40, | ||
| 117 | 0x7F, 0x28, 0x44, 0x44, 0x38, | ||
| 118 | 0x38, 0x44, 0x44, 0x44, 0x28, | ||
| 119 | 0x38, 0x44, 0x44, 0x28, 0x7F, | ||
| 120 | 0x38, 0x54, 0x54, 0x54, 0x18, | ||
| 121 | 0x00, 0x08, 0x7E, 0x09, 0x02, | ||
| 122 | 0x18, 0xA4, 0xA4, 0x9C, 0x78, | ||
| 123 | 0x7F, 0x08, 0x04, 0x04, 0x78, | ||
| 124 | 0x00, 0x44, 0x7D, 0x40, 0x00, | ||
| 125 | 0x20, 0x40, 0x40, 0x3D, 0x00, | ||
| 126 | 0x7F, 0x10, 0x28, 0x44, 0x00, | ||
| 127 | 0x00, 0x41, 0x7F, 0x40, 0x00, | ||
| 128 | 0x7C, 0x04, 0x78, 0x04, 0x78, | ||
| 129 | 0x7C, 0x08, 0x04, 0x04, 0x78, | ||
| 130 | 0x38, 0x44, 0x44, 0x44, 0x38, | ||
| 131 | 0xFC, 0x18, 0x24, 0x24, 0x18, | ||
| 132 | 0x18, 0x24, 0x24, 0x18, 0xFC, | ||
| 133 | 0x7C, 0x08, 0x04, 0x04, 0x08, | ||
| 134 | 0x48, 0x54, 0x54, 0x54, 0x24, | ||
| 135 | 0x04, 0x04, 0x3F, 0x44, 0x24, | ||
| 136 | 0x3C, 0x40, 0x40, 0x20, 0x7C, | ||
| 137 | 0x1C, 0x20, 0x40, 0x20, 0x1C, | ||
| 138 | 0x3C, 0x40, 0x30, 0x40, 0x3C, | ||
| 139 | 0x44, 0x28, 0x10, 0x28, 0x44, | ||
| 140 | 0x4C, 0x90, 0x90, 0x90, 0x7C, | ||
| 141 | 0x44, 0x64, 0x54, 0x4C, 0x44, | ||
| 142 | 0x00, 0x08, 0x36, 0x41, 0x00, | ||
| 143 | 0x00, 0x00, 0x77, 0x00, 0x00, | ||
| 144 | 0x00, 0x41, 0x36, 0x08, 0x00, | ||
| 145 | 0x02, 0x01, 0x02, 0x04, 0x02, | ||
| 146 | 0x3C, 0x26, 0x23, 0x26, 0x3C, | ||
| 147 | 0x1E, 0xA1, 0xA1, 0x61, 0x12, | ||
| 148 | 0x3A, 0x40, 0x40, 0x20, 0x7A, | ||
| 149 | 0x38, 0x54, 0x54, 0x55, 0x59, | ||
| 150 | 0x21, 0x55, 0x55, 0x79, 0x41, | ||
| 151 | 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut | ||
| 152 | 0x21, 0x55, 0x54, 0x78, 0x40, | ||
| 153 | 0x20, 0x54, 0x55, 0x79, 0x40, | ||
| 154 | 0x0C, 0x1E, 0x52, 0x72, 0x12, | ||
| 155 | 0x39, 0x55, 0x55, 0x55, 0x59, | ||
| 156 | 0x39, 0x54, 0x54, 0x54, 0x59, | ||
| 157 | 0x39, 0x55, 0x54, 0x54, 0x58, | ||
| 158 | 0x00, 0x00, 0x45, 0x7C, 0x41, | ||
| 159 | 0x00, 0x02, 0x45, 0x7D, 0x42, | ||
| 160 | 0x00, 0x01, 0x45, 0x7C, 0x40, | ||
| 161 | 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut | ||
| 162 | 0xF0, 0x28, 0x25, 0x28, 0xF0, | ||
| 163 | 0x7C, 0x54, 0x55, 0x45, 0x00, | ||
| 164 | 0x20, 0x54, 0x54, 0x7C, 0x54, | ||
| 165 | 0x7C, 0x0A, 0x09, 0x7F, 0x49, | ||
| 166 | 0x32, 0x49, 0x49, 0x49, 0x32, | ||
| 167 | 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut | ||
| 168 | 0x32, 0x4A, 0x48, 0x48, 0x30, | ||
| 169 | 0x3A, 0x41, 0x41, 0x21, 0x7A, | ||
| 170 | 0x3A, 0x42, 0x40, 0x20, 0x78, | ||
| 171 | 0x00, 0x9D, 0xA0, 0xA0, 0x7D, | ||
| 172 | 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut | ||
| 173 | 0x3D, 0x40, 0x40, 0x40, 0x3D, | ||
| 174 | 0x3C, 0x24, 0xFF, 0x24, 0x24, | ||
| 175 | 0x48, 0x7E, 0x49, 0x43, 0x66, | ||
| 176 | 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, | ||
| 177 | 0xFF, 0x09, 0x29, 0xF6, 0x20, | ||
| 178 | 0xC0, 0x88, 0x7E, 0x09, 0x03, | ||
| 179 | 0x20, 0x54, 0x54, 0x79, 0x41, | ||
| 180 | 0x00, 0x00, 0x44, 0x7D, 0x41, | ||
| 181 | 0x30, 0x48, 0x48, 0x4A, 0x32, | ||
| 182 | 0x38, 0x40, 0x40, 0x22, 0x7A, | ||
| 183 | 0x00, 0x7A, 0x0A, 0x0A, 0x72, | ||
| 184 | 0x7D, 0x0D, 0x19, 0x31, 0x7D, | ||
| 185 | 0x26, 0x29, 0x29, 0x2F, 0x28, | ||
| 186 | 0x26, 0x29, 0x29, 0x29, 0x26, | ||
| 187 | 0x30, 0x48, 0x4D, 0x40, 0x20, | ||
| 188 | 0x38, 0x08, 0x08, 0x08, 0x08, | ||
| 189 | 0x08, 0x08, 0x08, 0x08, 0x38, | ||
| 190 | 0x2F, 0x10, 0xC8, 0xAC, 0xBA, | ||
| 191 | 0x2F, 0x10, 0x28, 0x34, 0xFA, | ||
| 192 | 0x00, 0x00, 0x7B, 0x00, 0x00, | ||
| 193 | 0x08, 0x14, 0x2A, 0x14, 0x22, | ||
| 194 | 0x22, 0x14, 0x2A, 0x14, 0x08, | ||
| 195 | 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code | ||
| 196 | 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block | ||
| 197 | 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block | ||
| 198 | 0x00, 0x00, 0x00, 0xFF, 0x00, | ||
| 199 | 0x10, 0x10, 0x10, 0xFF, 0x00, | ||
| 200 | 0x14, 0x14, 0x14, 0xFF, 0x00, | ||
| 201 | 0x10, 0x10, 0xFF, 0x00, 0xFF, | ||
| 202 | 0x10, 0x10, 0xF0, 0x10, 0xF0, | ||
| 203 | 0x14, 0x14, 0x14, 0xFC, 0x00, | ||
| 204 | 0x14, 0x14, 0xF7, 0x00, 0xFF, | ||
| 205 | 0x00, 0x00, 0xFF, 0x00, 0xFF, | ||
| 206 | 0x14, 0x14, 0xF4, 0x04, 0xFC, | ||
| 207 | 0x14, 0x14, 0x17, 0x10, 0x1F, | ||
| 208 | 0x10, 0x10, 0x1F, 0x10, 0x1F, | ||
| 209 | 0x14, 0x14, 0x14, 0x1F, 0x00, | ||
| 210 | 0x10, 0x10, 0x10, 0xF0, 0x00, | ||
| 211 | 0x00, 0x00, 0x00, 0x1F, 0x10, | ||
| 212 | 0x10, 0x10, 0x10, 0x1F, 0x10, | ||
| 213 | 0x10, 0x10, 0x10, 0xF0, 0x10, | ||
| 214 | 0x00, 0x00, 0x00, 0xFF, 0x10, | ||
| 215 | 0x10, 0x10, 0x10, 0x10, 0x10, | ||
| 216 | 0x10, 0x10, 0x10, 0xFF, 0x10, | ||
| 217 | 0x00, 0x00, 0x00, 0xFF, 0x14, | ||
| 218 | 0x00, 0x00, 0xFF, 0x00, 0xFF, | ||
| 219 | 0x00, 0x00, 0x1F, 0x10, 0x17, | ||
| 220 | 0x00, 0x00, 0xFC, 0x04, 0xF4, | ||
| 221 | 0x14, 0x14, 0x17, 0x10, 0x17, | ||
| 222 | 0x14, 0x14, 0xF4, 0x04, 0xF4, | ||
| 223 | 0x00, 0x00, 0xFF, 0x00, 0xF7, | ||
| 224 | 0x14, 0x14, 0x14, 0x14, 0x14, | ||
| 225 | 0x14, 0x14, 0xF7, 0x00, 0xF7, | ||
| 226 | 0x14, 0x14, 0x14, 0x17, 0x14, | ||
| 227 | 0x10, 0x10, 0x1F, 0x10, 0x1F, | ||
| 228 | 0x14, 0x14, 0x14, 0xF4, 0x14, | ||
| 229 | 0x10, 0x10, 0xF0, 0x10, 0xF0, | ||
| 230 | 0x00, 0x00, 0x1F, 0x10, 0x1F, | ||
| 231 | 0x00, 0x00, 0x00, 0x1F, 0x14, | ||
| 232 | 0x00, 0x00, 0x00, 0xFC, 0x14, | ||
| 233 | 0x00, 0x00, 0xF0, 0x10, 0xF0, | ||
| 234 | 0x10, 0x10, 0xFF, 0x10, 0xFF, | ||
| 235 | 0x14, 0x14, 0x14, 0xFF, 0x14, | ||
| 236 | 0x10, 0x10, 0x10, 0x1F, 0x00, | ||
| 237 | 0x00, 0x00, 0x00, 0xF0, 0x10, | ||
| 238 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
| 239 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, | ||
| 240 | 0xFF, 0xFF, 0xFF, 0x00, 0x00, | ||
| 241 | 0x00, 0x00, 0x00, 0xFF, 0xFF, | ||
| 242 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, | ||
| 243 | 0x38, 0x44, 0x44, 0x38, 0x44, | ||
| 244 | 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta | ||
| 245 | 0x7E, 0x02, 0x02, 0x06, 0x06, | ||
| 246 | 0x02, 0x7E, 0x02, 0x7E, 0x02, | ||
| 247 | 0x63, 0x55, 0x49, 0x41, 0x63, | ||
| 248 | 0x38, 0x44, 0x44, 0x3C, 0x04, | ||
| 249 | 0x40, 0x7E, 0x20, 0x1E, 0x20, | ||
| 250 | 0x06, 0x02, 0x7E, 0x02, 0x02, | ||
| 251 | 0x99, 0xA5, 0xE7, 0xA5, 0x99, | ||
| 252 | 0x1C, 0x2A, 0x49, 0x2A, 0x1C, | ||
| 253 | 0x4C, 0x72, 0x01, 0x72, 0x4C, | ||
| 254 | 0x30, 0x4A, 0x4D, 0x4D, 0x30, | ||
| 255 | 0x30, 0x48, 0x78, 0x48, 0x30, | ||
| 256 | 0xBC, 0x62, 0x5A, 0x46, 0x3D, | ||
| 257 | 0x3E, 0x49, 0x49, 0x49, 0x00, | ||
| 258 | 0x7E, 0x01, 0x01, 0x01, 0x7E, | ||
| 259 | 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, | ||
| 260 | 0x44, 0x44, 0x5F, 0x44, 0x44, | ||
| 261 | 0x40, 0x51, 0x4A, 0x44, 0x40, | ||
| 262 | 0x40, 0x44, 0x4A, 0x51, 0x40, | ||
| 263 | 0x00, 0x00, 0xFF, 0x01, 0x03, | ||
| 264 | 0xE0, 0x80, 0xFF, 0x00, 0x00, | ||
| 265 | 0x08, 0x08, 0x6B, 0x6B, 0x08, | ||
| 266 | 0x36, 0x12, 0x36, 0x24, 0x36, | ||
| 267 | 0x06, 0x0F, 0x09, 0x0F, 0x06, | ||
| 268 | 0x00, 0x00, 0x18, 0x18, 0x00, | ||
| 269 | 0x00, 0x00, 0x10, 0x10, 0x00, | ||
| 270 | 0x30, 0x40, 0xFF, 0x01, 0x01, | ||
| 271 | 0x00, 0x1F, 0x01, 0x01, 0x1E, | ||
| 272 | 0x00, 0x19, 0x1D, 0x17, 0x12, | ||
| 273 | 0x00, 0x3C, 0x3C, 0x3C, 0x3C, | ||
| 274 | 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP | ||
| 275 | }; | ||
| 276 | #endif // FONT5X7_H | ||
diff --git a/keyboards/lets_split/i2c.h b/keyboards/lets_split/i2c.h index 08ce4b009..c15b6bc50 100644 --- a/keyboards/lets_split/i2c.h +++ b/keyboards/lets_split/i2c.h | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #define SLAVE_BUFFER_SIZE 0x10 | 16 | #define SLAVE_BUFFER_SIZE 0x10 |
| 17 | 17 | ||
| 18 | // i2c SCL clock frequency | 18 | // i2c SCL clock frequency |
| 19 | #define SCL_CLOCK 100000L | 19 | #define SCL_CLOCK 400000L |
| 20 | 20 | ||
| 21 | extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; | 21 | extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; |
| 22 | 22 | ||
| @@ -28,4 +28,22 @@ uint8_t i2c_master_read(int); | |||
| 28 | void i2c_reset_state(void); | 28 | void i2c_reset_state(void); |
| 29 | void i2c_slave_init(uint8_t address); | 29 | void i2c_slave_init(uint8_t address); |
| 30 | 30 | ||
| 31 | |||
| 32 | static inline unsigned char i2c_start_read(unsigned char addr) { | ||
| 33 | return i2c_master_start((addr << 1) | I2C_READ); | ||
| 34 | } | ||
| 35 | |||
| 36 | static inline unsigned char i2c_start_write(unsigned char addr) { | ||
| 37 | return i2c_master_start((addr << 1) | I2C_WRITE); | ||
| 38 | } | ||
| 39 | |||
| 40 | // from SSD1306 scrips | ||
| 41 | extern unsigned char i2c_rep_start(unsigned char addr); | ||
| 42 | extern void i2c_start_wait(unsigned char addr); | ||
| 43 | extern unsigned char i2c_readAck(void); | ||
| 44 | extern unsigned char i2c_readNak(void); | ||
| 45 | extern unsigned char i2c_read(unsigned char ack); | ||
| 46 | |||
| 47 | #define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); | ||
| 48 | |||
| 31 | #endif | 49 | #endif |
diff --git a/keyboards/lets_split/keymaps/OLED_sample/Makefile b/keyboards/lets_split/keymaps/OLED_sample/Makefile new file mode 100644 index 000000000..90616d1f1 --- /dev/null +++ b/keyboards/lets_split/keymaps/OLED_sample/Makefile | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | |||
| 2 | # Build Options | ||
| 3 | # change to "no" to disable the options, or define them in the Makefile in | ||
| 4 | # the appropriate keymap folder that will get included automatically | ||
| 5 | # | ||
| 6 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
| 7 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 8 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 9 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 10 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 11 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 12 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 13 | MIDI_ENABLE = no # MIDI controls | ||
| 14 | AUDIO_ENABLE = no # Audio output on port C6 | ||
| 15 | UNICODE_ENABLE = no # Unicode | ||
| 16 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 17 | RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | ||
| 18 | ONEHAND_ENABLE = no # Enable one-hand typing | ||
| 19 | |||
| 20 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 21 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 22 | |||
| 23 | ifndef QUANTUM_DIR | ||
| 24 | include ../../../../Makefile | ||
| 25 | endif \ No newline at end of file | ||
diff --git a/keyboards/lets_split/keymaps/OLED_sample/config.h b/keyboards/lets_split/keymaps/OLED_sample/config.h new file mode 100644 index 000000000..353ea368c --- /dev/null +++ b/keyboards/lets_split/keymaps/OLED_sample/config.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #define USE_I2C | ||
| 19 | //#define USE_SERIAL | ||
| 20 | //#define MASTER_RIGHT | ||
| 21 | #define FLIP_HALF | ||
| 22 | |||
| 23 | #define SSD1306OLED | ||
| 24 | |||
| 25 | |||
| 26 | #define PREVENT_STUCK_MODIFIERS | ||
| 27 | #define TAPPING_FORCE_HOLD | ||
| 28 | #define TAPPING_TERM 100 | ||
| 29 | |||
| 30 | #undef RGBLED_NUM | ||
| 31 | #define RGBLIGHT_ANIMATIONS | ||
| 32 | #define RGBLED_NUM 6 | ||
| 33 | #define RGBLIGHT_HUE_STEP 10 | ||
| 34 | #define RGBLIGHT_SAT_STEP 17 | ||
| 35 | #define RGBLIGHT_VAL_STEP 17 | ||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | #ifdef SUBPROJECT_rev1 | ||
| 41 | #include "../../rev1/config.h" | ||
| 42 | #endif | ||
| 43 | #ifdef SUBPROJECT_rev2 | ||
| 44 | #include "../../rev2/config.h" | ||
| 45 | #endif \ No newline at end of file | ||
diff --git a/keyboards/lets_split/keymaps/OLED_sample/keymap.c b/keyboards/lets_split/keymaps/OLED_sample/keymap.c new file mode 100644 index 000000000..072b825ab --- /dev/null +++ b/keyboards/lets_split/keymaps/OLED_sample/keymap.c | |||
| @@ -0,0 +1,356 @@ | |||
| 1 | #include "lets_split.h" | ||
| 2 | #include "bootloader.h" | ||
| 3 | #include "action_layer.h" | ||
| 4 | #include "eeconfig.h" | ||
| 5 | #include "tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/Peripheral/TWI.h" | ||
| 6 | #ifdef AUDIO_ENABLE | ||
| 7 | #include "audio.h" | ||
| 8 | #endif | ||
| 9 | |||
| 10 | extern keymap_config_t keymap_config; | ||
| 11 | |||
| 12 | //Following line allows macro to read current RGB settings | ||
| 13 | extern rgblight_config_t rgblight_config; | ||
| 14 | |||
| 15 | |||
| 16 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 17 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 18 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 19 | // entirely and just use numbers. | ||
| 20 | #define _QWERTY 0 | ||
| 21 | #define _COLEMAK 1 | ||
| 22 | #define _DVORAK 2 | ||
| 23 | #define _LOWER 3 | ||
| 24 | #define _RAISE 4 | ||
| 25 | #define _ADJUST 16 | ||
| 26 | |||
| 27 | enum custom_keycodes { | ||
| 28 | QWERTY = SAFE_RANGE, | ||
| 29 | COLEMAK, | ||
| 30 | DVORAK, | ||
| 31 | LOWER, | ||
| 32 | RAISE, | ||
| 33 | ADJUST, | ||
| 34 | BACKLIT, | ||
| 35 | RGBLED_TOGGLE, | ||
| 36 | RGBLED_STEP_MODE, | ||
| 37 | RGBLED_INCREASE_HUE, | ||
| 38 | RGBLED_DECREASE_HUE, | ||
| 39 | RGBLED_INCREASE_SAT, | ||
| 40 | RGBLED_DECREASE_SAT, | ||
| 41 | RGBLED_INCREASE_VAL, | ||
| 42 | RGBLED_DECREASE_VAL, | ||
| 43 | }; | ||
| 44 | |||
| 45 | enum macro_keycodes { | ||
| 46 | KC_SAMPLEMACRO, | ||
| 47 | }; | ||
| 48 | |||
| 49 | |||
| 50 | // Fillers to make layering more clear | ||
| 51 | #define _______ KC_TRNS | ||
| 52 | #define XXXXXXX KC_NO | ||
| 53 | //Macros | ||
| 54 | #define M_SAMPLE M(KC_SAMPLEMACRO) | ||
| 55 | |||
| 56 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 57 | |||
| 58 | /* Qwerty | ||
| 59 | * ,-----------------------------------------------------------------------------------. | ||
| 60 | * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | | ||
| 61 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 62 | * | Esc | A | S | D | F | G | H | J | K | L | ; | " | | ||
| 63 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 64 | * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | ||
| 65 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 66 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 67 | * `-----------------------------------------------------------------------------------' | ||
| 68 | */ | ||
| 69 | [_QWERTY] = KEYMAP( \ | ||
| 70 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ | ||
| 71 | KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
| 72 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ | ||
| 73 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 74 | ), | ||
| 75 | |||
| 76 | /* Colemak | ||
| 77 | * ,-----------------------------------------------------------------------------------. | ||
| 78 | * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | | ||
| 79 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 80 | * | Esc | A | R | S | T | D | H | N | E | I | O | " | | ||
| 81 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 82 | * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | | ||
| 83 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 84 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 85 | * `-----------------------------------------------------------------------------------' | ||
| 86 | */ | ||
| 87 | [_COLEMAK] = KEYMAP( \ | ||
| 88 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ | ||
| 89 | KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ | ||
| 90 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ | ||
| 91 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 92 | ), | ||
| 93 | |||
| 94 | /* Dvorak | ||
| 95 | * ,-----------------------------------------------------------------------------------. | ||
| 96 | * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | | ||
| 97 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 98 | * | Esc | A | O | E | U | I | D | H | T | N | S | / | | ||
| 99 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 100 | * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | | ||
| 101 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 102 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 103 | * `-----------------------------------------------------------------------------------' | ||
| 104 | */ | ||
| 105 | [_DVORAK] = KEYMAP( \ | ||
| 106 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ | ||
| 107 | KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ | ||
| 108 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ | ||
| 109 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 110 | ), | ||
| 111 | |||
| 112 | /* Lower | ||
| 113 | * ,-----------------------------------------------------------------------------------. | ||
| 114 | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | ||
| 115 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 116 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | | ||
| 117 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 118 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | | ||
| 119 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 120 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 121 | * `-----------------------------------------------------------------------------------' | ||
| 122 | */ | ||
| 123 | [_LOWER] = KEYMAP( \ | ||
| 124 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ | ||
| 125 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ | ||
| 126 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ | ||
| 127 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ | ||
| 128 | ), | ||
| 129 | |||
| 130 | /* Raise | ||
| 131 | * ,-----------------------------------------------------------------------------------. | ||
| 132 | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | ||
| 133 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 134 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | ||
| 135 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 136 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | | ||
| 137 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 138 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 139 | * `-----------------------------------------------------------------------------------' | ||
| 140 | */ | ||
| 141 | [_RAISE] = KEYMAP( \ | ||
| 142 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ | ||
| 143 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ | ||
| 144 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ | ||
| 145 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ | ||
| 146 | ), | ||
| 147 | |||
| 148 | /* Adjust (Lower + Raise) | ||
| 149 | * ,-----------------------------------------------------------------------------------. | ||
| 150 | * | | Reset| | | | | | | | | | Del | | ||
| 151 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 152 | * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | | ||
| 153 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 154 | * | | | | | | | | | | | | | | ||
| 155 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 156 | * | | | | | | | | | | | | | ||
| 157 | * `-----------------------------------------------------------------------------------' | ||
| 158 | */ | ||
| 159 | [_ADJUST] = KEYMAP( \ | ||
| 160 | _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ | ||
| 161 | _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ | ||
| 162 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 163 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 164 | ) | ||
| 165 | |||
| 166 | |||
| 167 | }; | ||
| 168 | |||
| 169 | |||
| 170 | #ifdef AUDIO_ENABLE | ||
| 171 | |||
| 172 | float tone_startup[][2] = SONG(STARTUP_SOUND); | ||
| 173 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
| 174 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
| 175 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
| 176 | float tone_plover[][2] = SONG(PLOVER_SOUND); | ||
| 177 | float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); | ||
| 178 | float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); | ||
| 179 | float tone_goodbye[][2] = SONG(GOODBYE_SOUND); | ||
| 180 | #endif | ||
| 181 | |||
| 182 | // define variables for reactive RGB | ||
| 183 | bool TOG_STATUS = false; | ||
| 184 | int RGB_current_mode; | ||
| 185 | |||
| 186 | void persistant_default_layer_set(uint16_t default_layer) { | ||
| 187 | eeconfig_update_default_layer(default_layer); | ||
| 188 | default_layer_set(default_layer); | ||
| 189 | } | ||
| 190 | |||
| 191 | // Setting ADJUST layer RGB back to default | ||
| 192 | void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { | ||
| 193 | if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { | ||
| 194 | rgblight_mode(RGB_current_mode); | ||
| 195 | layer_on(layer3); | ||
| 196 | } else { | ||
| 197 | layer_off(layer3); | ||
| 198 | } | ||
| 199 | } | ||
| 200 | |||
| 201 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 202 | switch (keycode) { | ||
| 203 | case QWERTY: | ||
| 204 | if (record->event.pressed) { | ||
| 205 | #ifdef AUDIO_ENABLE | ||
| 206 | PLAY_NOTE_ARRAY(tone_qwerty, false, 0); | ||
| 207 | #endif | ||
| 208 | persistant_default_layer_set(1UL<<_QWERTY); | ||
| 209 | } | ||
| 210 | return false; | ||
| 211 | break; | ||
| 212 | case COLEMAK: | ||
| 213 | if (record->event.pressed) { | ||
| 214 | #ifdef AUDIO_ENABLE | ||
| 215 | PLAY_NOTE_ARRAY(tone_colemak, false, 0); | ||
| 216 | #endif | ||
| 217 | persistant_default_layer_set(1UL<<_COLEMAK); | ||
| 218 | } | ||
| 219 | return false; | ||
| 220 | break; | ||
| 221 | case DVORAK: | ||
| 222 | if (record->event.pressed) { | ||
| 223 | #ifdef AUDIO_ENABLE | ||
| 224 | PLAY_NOTE_ARRAY(tone_dvorak, false, 0); | ||
| 225 | #endif | ||
| 226 | persistant_default_layer_set(1UL<<_DVORAK); | ||
| 227 | } | ||
| 228 | return false; | ||
| 229 | break; | ||
| 230 | case LOWER: | ||
| 231 | if (record->event.pressed) { | ||
| 232 | //not sure how to have keyboard check mode and set it to a variable, so my work around | ||
| 233 | //uses another variable that would be set to true after the first time a reactive key is pressed. | ||
| 234 | if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false | ||
| 235 | } else { | ||
| 236 | TOG_STATUS = !TOG_STATUS; | ||
| 237 | rgblight_mode(16); | ||
| 238 | } | ||
| 239 | layer_on(_LOWER); | ||
| 240 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 241 | } else { | ||
| 242 | rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change | ||
| 243 | TOG_STATUS = false; | ||
| 244 | layer_off(_LOWER); | ||
| 245 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 246 | } | ||
| 247 | return false; | ||
| 248 | break; | ||
| 249 | case RAISE: | ||
| 250 | if (record->event.pressed) { | ||
| 251 | //not sure how to have keyboard check mode and set it to a variable, so my work around | ||
| 252 | //uses another variable that would be set to true after the first time a reactive key is pressed. | ||
| 253 | if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false | ||
| 254 | } else { | ||
| 255 | TOG_STATUS = !TOG_STATUS; | ||
| 256 | rgblight_mode(15); | ||
| 257 | } | ||
| 258 | layer_on(_RAISE); | ||
| 259 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 260 | } else { | ||
| 261 | rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change | ||
| 262 | layer_off(_RAISE); | ||
| 263 | TOG_STATUS = false; | ||
| 264 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 265 | } | ||
| 266 | return false; | ||
| 267 | break; | ||
| 268 | case BACKLIT: | ||
| 269 | if (record->event.pressed) { | ||
| 270 | register_code(KC_RSFT); | ||
| 271 | #ifdef BACKLIGHT_ENABLE | ||
| 272 | backlight_step(); | ||
| 273 | #endif | ||
| 274 | } else { | ||
| 275 | unregister_code(KC_RSFT); | ||
| 276 | } | ||
| 277 | return false; | ||
| 278 | break; | ||
| 279 | //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released | ||
| 280 | case RGB_MOD: | ||
| 281 | if (record->event.pressed) { | ||
| 282 | rgblight_mode(RGB_current_mode); | ||
| 283 | rgblight_step(); | ||
| 284 | RGB_current_mode = rgblight_config.mode; | ||
| 285 | } | ||
| 286 | return false; | ||
| 287 | break; | ||
| 288 | } | ||
| 289 | return true; | ||
| 290 | } | ||
| 291 | |||
| 292 | void matrix_init_user(void) { | ||
| 293 | #ifdef AUDIO_ENABLE | ||
| 294 | startup_user(); | ||
| 295 | #endif | ||
| 296 | RGB_current_mode = rgblight_config.mode; | ||
| 297 | } | ||
| 298 | |||
| 299 | //SSD1306 OLED init and update loop, make sure to add #define SSD1306OLED in config.h | ||
| 300 | #ifdef SSD1306OLED | ||
| 301 | void matrix_master_OLED_init (void) { | ||
| 302 | TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); | ||
| 303 | iota_gfx_init(); // turns on the display | ||
| 304 | } | ||
| 305 | |||
| 306 | void matrix_scan_user(void) { | ||
| 307 | iota_gfx_task(); // this is what updates the display continuously | ||
| 308 | } | ||
| 309 | #endif | ||
| 310 | |||
| 311 | #ifdef AUDIO_ENABLE | ||
| 312 | |||
| 313 | void startup_user() | ||
| 314 | { | ||
| 315 | _delay_ms(20); // gets rid of tick | ||
| 316 | PLAY_NOTE_ARRAY(tone_startup, false, 0); | ||
| 317 | } | ||
| 318 | |||
| 319 | void shutdown_user() | ||
| 320 | { | ||
| 321 | PLAY_NOTE_ARRAY(tone_goodbye, false, 0); | ||
| 322 | _delay_ms(150); | ||
| 323 | stop_all_notes(); | ||
| 324 | } | ||
| 325 | |||
| 326 | void music_on_user(void) | ||
| 327 | { | ||
| 328 | music_scale_user(); | ||
| 329 | } | ||
| 330 | |||
| 331 | void music_scale_user(void) | ||
| 332 | { | ||
| 333 | PLAY_NOTE_ARRAY(music_scale, false, 0); | ||
| 334 | } | ||
| 335 | |||
| 336 | #endif | ||
| 337 | |||
| 338 | /* | ||
| 339 | * Macro definition | ||
| 340 | */ | ||
| 341 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
| 342 | { | ||
| 343 | if (!eeconfig_is_enabled()) { | ||
| 344 | eeconfig_init(); | ||
| 345 | } | ||
| 346 | |||
| 347 | switch (id) { | ||
| 348 | case KC_SAMPLEMACRO: | ||
| 349 | if (record->event.pressed){ | ||
| 350 | return MACRO (I(10), T(H), T(E), T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); | ||
| 351 | } | ||
| 352 | |||
| 353 | } | ||
| 354 | |||
| 355 | return MACRO_NONE; | ||
| 356 | } | ||
diff --git a/keyboards/lets_split/keymaps/OLED_sample/readme.md b/keyboards/lets_split/keymaps/OLED_sample/readme.md new file mode 100644 index 000000000..02888855b --- /dev/null +++ b/keyboards/lets_split/keymaps/OLED_sample/readme.md | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | SSD1306 OLED Display via I2C | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Features | ||
| 5 | -------- | ||
| 6 | |||
| 7 | Some features supported by the firmware: | ||
| 8 | |||
| 9 | |||
| 10 | * I2C connection between the two halves is required as the OLED display will use this connection as well. Note this | ||
| 11 | requires pull-up resistors on the data and clock lines. | ||
| 12 | * OLED display will connect from either side | ||
| 13 | |||
| 14 | |||
| 15 | Wiring | ||
| 16 | ------ | ||
| 17 | |||
| 18 | |||
| 19 | Work in progress... | ||
| 20 | |||
| 21 | |||
| 22 | OLED Configuration | ||
| 23 | ------------------------------- | ||
| 24 | |||
| 25 | Work in progress... | ||
diff --git a/keyboards/lets_split/keymaps/hexwire/Makefile b/keyboards/lets_split/keymaps/hexwire/Makefile new file mode 100644 index 000000000..1e5761278 --- /dev/null +++ b/keyboards/lets_split/keymaps/hexwire/Makefile | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | RGBLIGHT_ENABLE = yes | ||
| 2 | |||
| 3 | ifndef QUANTUM_DIR | ||
| 4 | include ../../../../Makefile | ||
| 5 | endif | ||
diff --git a/keyboards/lets_split/keymaps/hexwire/README.md b/keyboards/lets_split/keymaps/hexwire/README.md new file mode 100644 index 000000000..edf2b6627 --- /dev/null +++ b/keyboards/lets_split/keymaps/hexwire/README.md | |||
| @@ -0,0 +1,108 @@ | |||
| 1 | Hexwire's Let's Split Layout | ||
| 2 | ============================ | ||
| 3 | |||
| 4 | ### Changes from default layout | ||
| 5 | |||
| 6 | - Main layer | ||
| 7 | - The right space bar key has been changed to backspace, as I only hit space with my left thumb | ||
| 8 | - Backtick is at the lower right and also serves goes to the 3rd function layer when held | ||
| 9 | - Enter key acts as shift when held | ||
| 10 | - Escape key acts as control when held | ||
| 11 | - Minus key at upper right | ||
| 12 | - Lower layer | ||
| 13 | - Numbers are on the lower layer, to make it easier to use a numpad on the right hand | ||
| 14 | - Arrow keys | ||
| 15 | - Straight and curly brackets in the middle two columns | ||
| 16 | - Screenshot keys for MacOS | ||
| 17 | - Upper layer | ||
| 18 | - Symbols are on the upper layer | ||
| 19 | - Media keys | ||
| 20 | - Page Up/Down, Home/End | ||
| 21 | - 3rd function layer | ||
| 22 | - Function keys | ||
| 23 | |||
| 24 | ## Layouts | ||
| 25 | |||
| 26 | ### Qwerty | ||
| 27 | |||
| 28 | ``` | ||
| 29 | ,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 30 | TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, | ||
| 31 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 32 | X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, | ||
| 33 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 34 | LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , | ||
| 35 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 36 | X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT | ||
| 37 | `----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 38 | ``` | ||
| 39 | |||
| 40 | ### Colemak | ||
| 41 | |||
| 42 | ``` | ||
| 43 | ,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 44 | TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, | ||
| 45 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 46 | X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, | ||
| 47 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 48 | LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , | ||
| 49 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 50 | X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT | ||
| 51 | `----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 52 | ``` | ||
| 53 | |||
| 54 | ### Dvorak | ||
| 55 | |||
| 56 | ``` | ||
| 57 | ,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 58 | TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, | ||
| 59 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 60 | X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, | ||
| 61 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 62 | LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , | ||
| 63 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 64 | X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT | ||
| 65 | `----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 66 | ``` | ||
| 67 | |||
| 68 | ### Lower | ||
| 69 | |||
| 70 | ``` | ||
| 71 | ,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 72 | , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , | ||
| 73 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 74 | DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, | ||
| 75 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 76 | ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , | ||
| 77 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 78 | , , , , , , DEL , , P0 ,PDOT, , | ||
| 79 | `----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 80 | ``` | ||
| 81 | |||
| 82 | ### Raise | ||
| 83 | |||
| 84 | ``` | ||
| 85 | ,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 86 | ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , | ||
| 87 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 88 | DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, | ||
| 89 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 90 | MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , | ||
| 91 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 92 | , , , , , , , , , , , | ||
| 93 | `----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 94 | ``` | ||
| 95 | |||
| 96 | ### 3rd function layer | ||
| 97 | |||
| 98 | ``` | ||
| 99 | ,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 100 | F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , | ||
| 101 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 102 | , , , , , , , , , , , , | ||
| 103 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 104 | , , , , , , , , , , , , | ||
| 105 | |----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 106 | , , , , , , , , , , , | ||
| 107 | `----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 108 | ``` | ||
diff --git a/keyboards/lets_split/keymaps/hexwire/config.h b/keyboards/lets_split/keymaps/hexwire/config.h new file mode 100644 index 000000000..9c8c6d7f4 --- /dev/null +++ b/keyboards/lets_split/keymaps/hexwire/config.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | |||
| 19 | #define USE_SERIAL | ||
| 20 | |||
| 21 | #define TAPPING_TERM 150 | ||
| 22 | |||
| 23 | #undef RGBLED_NUM | ||
| 24 | #define RGBLIGHT_ANIMATIONS | ||
| 25 | #define RGBLED_NUM 8 | ||
| 26 | #define RGBLIGHT_HUE_STEP 8 | ||
| 27 | #define RGBLIGHT_SAT_STEP 8 | ||
| 28 | #define RGBLIGHT_VAL_STEP 8 | ||
| 29 | |||
| 30 | #ifdef SUBPROJECT_rev1 | ||
| 31 | #include "../../rev1/config.h" | ||
| 32 | #define COMPACT_KEYMAP( \ | ||
| 33 | k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ | ||
| 34 | k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ | ||
| 35 | k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ | ||
| 36 | k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ | ||
| 37 | ) \ | ||
| 38 | { \ | ||
| 39 | { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05 }, \ | ||
| 40 | { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15 }, \ | ||
| 41 | { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25 }, \ | ||
| 42 | { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35 }, \ | ||
| 43 | { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45 }, \ | ||
| 44 | { KC_##k50, KC_##k51, KC_##k52, KC_##k53, KC_##k54, KC_##k55 }, \ | ||
| 45 | { KC_##k60, KC_##k61, KC_##k62, KC_##k63, KC_##k64, KC_##k65 }, \ | ||
| 46 | { KC_##k70, KC_##k71, KC_##k72, KC_##k73, KC_##k74, KC_##k75 } \ | ||
| 47 | } | ||
| 48 | #endif | ||
| 49 | #ifdef SUBPROJECT_rev2 | ||
| 50 | #include "../../rev2/config.h" | ||
| 51 | #define COMPACT_KEYMAP( \ | ||
| 52 | k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \ | ||
| 53 | k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \ | ||
| 54 | k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \ | ||
| 55 | k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \ | ||
| 56 | ) \ | ||
| 57 | { \ | ||
| 58 | { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05 }, \ | ||
| 59 | { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15 }, \ | ||
| 60 | { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25 }, \ | ||
| 61 | { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35 }, \ | ||
| 62 | { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45 }, \ | ||
| 63 | { KC_##k50, KC_##k51, KC_##k52, KC_##k53, KC_##k54, KC_##k55 }, \ | ||
| 64 | { KC_##k60, KC_##k61, KC_##k62, KC_##k63, KC_##k64, KC_##k65 }, \ | ||
| 65 | { KC_##k70, KC_##k71, KC_##k72, KC_##k73, KC_##k74, KC_##k75 } \ | ||
| 66 | } | ||
| 67 | #endif | ||
| 68 | #ifdef SUBPROJECT_rev2fliphalf | ||
| 69 | #include "../../rev2fliphalf/config.h" | ||
| 70 | #endif | ||
diff --git a/keyboards/lets_split/keymaps/hexwire/keymap.c b/keyboards/lets_split/keymaps/hexwire/keymap.c new file mode 100644 index 000000000..f8370490d --- /dev/null +++ b/keyboards/lets_split/keymaps/hexwire/keymap.c | |||
| @@ -0,0 +1,205 @@ | |||
| 1 | #include "lets_split.h" | ||
| 2 | #include "action_layer.h" | ||
| 3 | #include "eeconfig.h" | ||
| 4 | |||
| 5 | extern keymap_config_t keymap_config; | ||
| 6 | |||
| 7 | #define _QWERTY 0 | ||
| 8 | #define _COLEMAK 1 | ||
| 9 | #define _DVORAK 2 | ||
| 10 | #define _LOWER 3 | ||
| 11 | #define _RAISE 4 | ||
| 12 | #define _FN3 5 | ||
| 13 | #define _FN4 6 | ||
| 14 | #define _ADJUST 16 | ||
| 15 | |||
| 16 | enum custom_keycodes { | ||
| 17 | QWERTY = SAFE_RANGE, | ||
| 18 | COLEMAK, | ||
| 19 | DVORAK, | ||
| 20 | LOWER, | ||
| 21 | RAISE, | ||
| 22 | FN3, | ||
| 23 | FN4, | ||
| 24 | ADJUST, | ||
| 25 | }; | ||
| 26 | |||
| 27 | #define KC_ KC_TRNS | ||
| 28 | #define _______ KC_TRNS | ||
| 29 | |||
| 30 | #define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen | ||
| 31 | #define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen | ||
| 32 | #define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen | ||
| 33 | #define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen | ||
| 34 | #define KC_X0 MT(MOD_LCTL, KC_ESC) | ||
| 35 | #define KC_X1 LOWER | ||
| 36 | #define KC_X2 RAISE | ||
| 37 | #define KC_X3 LT(_FN3, KC_GRV) | ||
| 38 | #define KC_X4 MT(MOD_LSFT, KC_ENT) | ||
| 39 | |||
| 40 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 41 | |||
| 42 | [_QWERTY] = COMPACT_KEYMAP( | ||
| 43 | //,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 44 | TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, | ||
| 45 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 46 | X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, | ||
| 47 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 48 | LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , | ||
| 49 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 50 | X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT | ||
| 51 | //`----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 52 | ), | ||
| 53 | |||
| 54 | [_COLEMAK] = COMPACT_KEYMAP( | ||
| 55 | //,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 56 | TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, | ||
| 57 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 58 | X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, | ||
| 59 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 60 | LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , | ||
| 61 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 62 | X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT | ||
| 63 | //`----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 64 | ), | ||
| 65 | |||
| 66 | [_DVORAK] = COMPACT_KEYMAP( | ||
| 67 | //,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 68 | TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, | ||
| 69 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 70 | X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, | ||
| 71 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 72 | LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , | ||
| 73 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 74 | X3 ,LCTL,LALT,LGUI, X1 ,SPC , BSPC, X2 ,LEFT,DOWN, UP ,RGHT | ||
| 75 | //`----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 76 | ), | ||
| 77 | |||
| 78 | [_LOWER] = COMPACT_KEYMAP( | ||
| 79 | //,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 80 | , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , | ||
| 81 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 82 | DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, | ||
| 83 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 84 | ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , | ||
| 85 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 86 | , , , , , , DEL , , P0 ,PDOT, , | ||
| 87 | //`----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 88 | ), | ||
| 89 | |||
| 90 | [_RAISE] = COMPACT_KEYMAP( | ||
| 91 | //,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 92 | ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , | ||
| 93 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 94 | DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, | ||
| 95 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 96 | MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , | ||
| 97 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 98 | , , , , , , , , , , , | ||
| 99 | //`----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 100 | ), | ||
| 101 | |||
| 102 | [_FN3] = COMPACT_KEYMAP( | ||
| 103 | //,----+----+----+----+----+----. ,----+----+----+----+----+----. | ||
| 104 | F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , | ||
| 105 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 106 | , , , , , , , , , , , , | ||
| 107 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 108 | , , , , , , , , , , , , | ||
| 109 | //|----+----+----+----+----+----| |----+----+----+----+----+----| | ||
| 110 | , , , , , , , , , , , | ||
| 111 | //`----+----+----+----+----+----' `----+----+----+----+----+----' | ||
| 112 | ), | ||
| 113 | |||
| 114 | /* Adjust (Lower + Raise) | ||
| 115 | * ,-----------------------------------------------------------------------------------. | ||
| 116 | * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | | ||
| 117 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 118 | * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | | ||
| 119 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 120 | * | | | | | | | | | | | | | | ||
| 121 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 122 | * | | | | | | | | | | | | | ||
| 123 | * `-----------------------------------------------------------------------------------' | ||
| 124 | */ | ||
| 125 | [_ADJUST] = KEYMAP( \ | ||
| 126 | _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ | ||
| 127 | _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ | ||
| 128 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 129 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 130 | ) | ||
| 131 | |||
| 132 | |||
| 133 | }; | ||
| 134 | |||
| 135 | #ifdef AUDIO_ENABLE | ||
| 136 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
| 137 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
| 138 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
| 139 | #endif | ||
| 140 | |||
| 141 | void persistant_default_layer_set(uint16_t default_layer) { | ||
| 142 | eeconfig_update_default_layer(default_layer); | ||
| 143 | default_layer_set(default_layer); | ||
| 144 | } | ||
| 145 | |||
| 146 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 147 | switch (keycode) { | ||
| 148 | case QWERTY: | ||
| 149 | if (record->event.pressed) { | ||
| 150 | #ifdef AUDIO_ENABLE | ||
| 151 | PLAY_NOTE_ARRAY(tone_qwerty, false, 0); | ||
| 152 | #endif | ||
| 153 | persistant_default_layer_set(1UL<<_QWERTY); | ||
| 154 | } | ||
| 155 | return false; | ||
| 156 | break; | ||
| 157 | case COLEMAK: | ||
| 158 | if (record->event.pressed) { | ||
| 159 | #ifdef AUDIO_ENABLE | ||
| 160 | PLAY_NOTE_ARRAY(tone_colemak, false, 0); | ||
| 161 | #endif | ||
| 162 | persistant_default_layer_set(1UL<<_COLEMAK); | ||
| 163 | } | ||
| 164 | return false; | ||
| 165 | break; | ||
| 166 | case DVORAK: | ||
| 167 | if (record->event.pressed) { | ||
| 168 | #ifdef AUDIO_ENABLE | ||
| 169 | PLAY_NOTE_ARRAY(tone_dvorak, false, 0); | ||
| 170 | #endif | ||
| 171 | persistant_default_layer_set(1UL<<_DVORAK); | ||
| 172 | } | ||
| 173 | return false; | ||
| 174 | break; | ||
| 175 | case LOWER: | ||
| 176 | if (record->event.pressed) { | ||
| 177 | layer_on(_LOWER); | ||
| 178 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 179 | } else { | ||
| 180 | layer_off(_LOWER); | ||
| 181 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 182 | } | ||
| 183 | return false; | ||
| 184 | break; | ||
| 185 | case RAISE: | ||
| 186 | if (record->event.pressed) { | ||
| 187 | layer_on(_RAISE); | ||
| 188 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 189 | } else { | ||
| 190 | layer_off(_RAISE); | ||
| 191 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 192 | } | ||
| 193 | return false; | ||
| 194 | break; | ||
| 195 | case ADJUST: | ||
| 196 | if (record->event.pressed) { | ||
| 197 | layer_on(_ADJUST); | ||
| 198 | } else { | ||
| 199 | layer_off(_ADJUST); | ||
| 200 | } | ||
| 201 | return false; | ||
| 202 | break; | ||
| 203 | } | ||
| 204 | return true; | ||
| 205 | } | ||
diff --git a/keyboards/lets_split/keymaps/smt/config.h b/keyboards/lets_split/keymaps/smt/config.h new file mode 100644 index 000000000..ba271d1ac --- /dev/null +++ b/keyboards/lets_split/keymaps/smt/config.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | |||
| 19 | #define USE_SERIAL | ||
| 20 | |||
| 21 | #define MASTER_LEFT | ||
| 22 | // #define _MASTER_RIGHT | ||
| 23 | // #define EE_HANDS | ||
| 24 | |||
| 25 | |||
| 26 | #ifdef SUBPROJECT_rev1 | ||
| 27 | #include "../../rev1/config.h" | ||
| 28 | #endif | ||
| 29 | #ifdef SUBPROJECT_rev2 | ||
| 30 | #include "../../rev2/config.h" | ||
| 31 | #endif | ||
| 32 | #ifdef SUBPROJECT_rev2fliphalf | ||
| 33 | #include "../../rev2fliphalf/config.h" | ||
| 34 | #endif | ||
diff --git a/keyboards/lets_split/keymaps/smt/keymap.c b/keyboards/lets_split/keymaps/smt/keymap.c new file mode 100644 index 000000000..c4bdb7ebc --- /dev/null +++ b/keyboards/lets_split/keymaps/smt/keymap.c | |||
| @@ -0,0 +1,219 @@ | |||
| 1 | #include "lets_split.h" | ||
| 2 | #include "action_layer.h" | ||
| 3 | #include "eeconfig.h" | ||
| 4 | |||
| 5 | extern keymap_config_t keymap_config; | ||
| 6 | |||
| 7 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 8 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 9 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 10 | // entirely and just use numbers. | ||
| 11 | #define _QWERTY 0 | ||
| 12 | #define _COLEMAK 1 | ||
| 13 | #define _DVORAK 2 | ||
| 14 | #define _LOWER 3 | ||
| 15 | #define _RAISE 4 | ||
| 16 | #define _ADJUST 16 | ||
| 17 | |||
| 18 | enum custom_keycodes { | ||
| 19 | QWERTY = SAFE_RANGE, | ||
| 20 | COLEMAK, | ||
| 21 | DVORAK, | ||
| 22 | LOWER, | ||
| 23 | RAISE, | ||
| 24 | ADJUST, | ||
| 25 | }; | ||
| 26 | |||
| 27 | // Fillers to make layering more clear | ||
| 28 | #define _______ KC_TRNS | ||
| 29 | #define XXXXXXX KC_NO | ||
| 30 | |||
| 31 | // Custom macros | ||
| 32 | #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl | ||
| 33 | #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift | ||
| 34 | #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) | ||
| 35 | #define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift) | ||
| 36 | |||
| 37 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 38 | |||
| 39 | /* Qwerty | ||
| 40 | * ,-----------------------------------------. ,-----------------------------------------. | ||
| 41 | * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | | ||
| 42 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 43 | * | Esc | A | S | D | F | G | | H | J | K | L | ; | " | | ||
| 44 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 45 | * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | | ||
| 46 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 47 | * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | | ||
| 48 | * `-----------------------------------------' `-----------------------------------------' | ||
| 49 | */ | ||
| 50 | [_QWERTY] = KEYMAP( \ | ||
| 51 | HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ | ||
| 52 | CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
| 53 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ | ||
| 54 | MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 55 | ), | ||
| 56 | |||
| 57 | /* Colemak | ||
| 58 | * ,-----------------------------------------. ,-----------------------------------------. | ||
| 59 | * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | | ||
| 60 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 61 | * | Esc | A | R | S | T | D | | H | N | E | I | O | " | | ||
| 62 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 63 | * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | | ||
| 64 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 65 | * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | | ||
| 66 | * `-----------------------------------------' `-----------------------------------------' | ||
| 67 | */ | ||
| 68 | [_COLEMAK] = KEYMAP( \ | ||
| 69 | HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ | ||
| 70 | CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ | ||
| 71 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ | ||
| 72 | MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 73 | ), | ||
| 74 | |||
| 75 | /* Dvorak | ||
| 76 | * ,-----------------------------------------. ,-----------------------------------------. | ||
| 77 | * | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp | | ||
| 78 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 79 | * | Esc | A | O | E | U | I | | D | H | T | N | S | - | | ||
| 80 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 81 | * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | | ||
| 82 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 83 | * | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | | ||
| 84 | * `-----------------------------------------' `-----------------------------------------' | ||
| 85 | */ | ||
| 86 | [_DVORAK] = KEYMAP( \ | ||
| 87 | HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ | ||
| 88 | CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ | ||
| 89 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ | ||
| 90 | MEH_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 91 | ), | ||
| 92 | |||
| 93 | /* Lower | ||
| 94 | * ,-----------------------------------------. ,-----------------------------------------. | ||
| 95 | * | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | | ||
| 96 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 97 | * | $ | F1 | F2 | F3 | F4 | F5 | | F6 | 4 | 5 | 6 | | | | ||
| 98 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 99 | * | | F7 | F8 | F9 | F10 | F11 | | F12 | 1 | 2 | 3 | | | | ||
| 100 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 101 | * | | | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 102 | * `-----------------------------------------' `-----------------------------------------' | ||
| 103 | */ | ||
| 104 | [_LOWER] = KEYMAP( \ | ||
| 105 | ALL_T(KC_0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ | ||
| 106 | CTL_T(KC_DLR), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, _______, _______, \ | ||
| 107 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, _______, _______, \ | ||
| 108 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY | ||
| 109 | ), | ||
| 110 | |||
| 111 | /* Raise | ||
| 112 | * ,-----------------------------------------. ,-----------------------------------------. | ||
| 113 | * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | | ||
| 114 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 115 | * | | | | | | | | _ | ? | + | { | } | | | | ||
| 116 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 117 | * | | | | | | | | - | / | = | [ | ] | \ | | ||
| 118 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 119 | * | | | | | | | | | | Home |PageDn|PageUp| End | | ||
| 120 | * `-----------------------------------------' `-----------------------------------------' | ||
| 121 | */ | ||
| 122 | [_RAISE] = KEYMAP( \ | ||
| 123 | ALL_T(KC_TILD), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ | ||
| 124 | _______, _______, _______, _______, _______, _______, KC_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ | ||
| 125 | _______, _______, _______, _______, _______, _______, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, SFT_T(KC_BSLS), \ | ||
| 126 | _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END | ||
| 127 | ), | ||
| 128 | |||
| 129 | /* Adjust (Lower + Raise) | ||
| 130 | * ,-----------------------------------------. ,-----------------------------------------. | ||
| 131 | * | | Reset| | | | | | | | | | | Reset| | ||
| 132 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 133 | * | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | | ||
| 134 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 135 | * | | | | | | | | | | | | | | | ||
| 136 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 137 | * | | | | | | | | | | | | | | | ||
| 138 | * `-----------------------------------------' `-----------------------------------------' | ||
| 139 | */ | ||
| 140 | [_ADJUST] = KEYMAP( \ | ||
| 141 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ | ||
| 142 | _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ | ||
| 143 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 144 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 145 | ) | ||
| 146 | |||
| 147 | }; | ||
| 148 | |||
| 149 | #ifdef AUDIO_ENABLE | ||
| 150 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
| 151 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
| 152 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
| 153 | #endif | ||
| 154 | |||
| 155 | void persistant_default_layer_set(uint16_t default_layer) { | ||
| 156 | eeconfig_update_default_layer(default_layer); | ||
| 157 | default_layer_set(default_layer); | ||
| 158 | } | ||
| 159 | |||
| 160 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 161 | switch (keycode) { | ||
| 162 | case QWERTY: | ||
| 163 | if (record->event.pressed) { | ||
| 164 | #ifdef AUDIO_ENABLE | ||
| 165 | PLAY_NOTE_ARRAY(tone_qwerty, false, 0); | ||
| 166 | #endif | ||
| 167 | persistant_default_layer_set(1UL<<_QWERTY); | ||
| 168 | } | ||
| 169 | return false; | ||
| 170 | break; | ||
| 171 | case COLEMAK: | ||
| 172 | if (record->event.pressed) { | ||
| 173 | #ifdef AUDIO_ENABLE | ||
| 174 | PLAY_NOTE_ARRAY(tone_colemak, false, 0); | ||
| 175 | #endif | ||
| 176 | persistant_default_layer_set(1UL<<_COLEMAK); | ||
| 177 | } | ||
| 178 | return false; | ||
| 179 | break; | ||
| 180 | case DVORAK: | ||
| 181 | if (record->event.pressed) { | ||
| 182 | #ifdef AUDIO_ENABLE | ||
| 183 | PLAY_NOTE_ARRAY(tone_dvorak, false, 0); | ||
| 184 | #endif | ||
| 185 | persistant_default_layer_set(1UL<<_DVORAK); | ||
| 186 | } | ||
| 187 | return false; | ||
| 188 | break; | ||
| 189 | case LOWER: | ||
| 190 | if (record->event.pressed) { | ||
| 191 | layer_on(_LOWER); | ||
| 192 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 193 | } else { | ||
| 194 | layer_off(_LOWER); | ||
| 195 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 196 | } | ||
| 197 | return false; | ||
| 198 | break; | ||
| 199 | case RAISE: | ||
| 200 | if (record->event.pressed) { | ||
| 201 | layer_on(_RAISE); | ||
| 202 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 203 | } else { | ||
| 204 | layer_off(_RAISE); | ||
| 205 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 206 | } | ||
| 207 | return false; | ||
| 208 | break; | ||
| 209 | case ADJUST: | ||
| 210 | if (record->event.pressed) { | ||
| 211 | layer_on(_ADJUST); | ||
| 212 | } else { | ||
| 213 | layer_off(_ADJUST); | ||
| 214 | } | ||
| 215 | return false; | ||
| 216 | break; | ||
| 217 | } | ||
| 218 | return true; | ||
| 219 | } | ||
diff --git a/keyboards/lets_split/keymaps/smt/readme.md b/keyboards/lets_split/keymaps/smt/readme.md new file mode 100644 index 000000000..20bc662f0 --- /dev/null +++ b/keyboards/lets_split/keymaps/smt/readme.md | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | # smt's Let's Split keymap | ||
| 2 | |||
| 3 | This keymap is ported from my Planck keymap. | ||
| 4 | |||
| 5 | |||
| 6 | ## Qwerty | ||
| 7 | |||
| 8 | ``` | ||
| 9 | ,-----------------------------------------. ,-----------------------------------------. | ||
| 10 | | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | | ||
| 11 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 12 | | Esc | A | S | D | F | G | | H | J | K | L | ; | " | | ||
| 13 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 14 | | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | | ||
| 15 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 16 | | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | | ||
| 17 | `-----------------------------------------' `-----------------------------------------' | ||
| 18 | ``` | ||
| 19 | |||
| 20 | ## Colemak | ||
| 21 | |||
| 22 | ``` | ||
| 23 | ,-----------------------------------------. ,-----------------------------------------. | ||
| 24 | | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | | ||
| 25 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 26 | | Esc | A | R | S | T | D | | H | N | E | I | O | " | | ||
| 27 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 28 | | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | | ||
| 29 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 30 | | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | | ||
| 31 | `-----------------------------------------' `-----------------------------------------' | ||
| 32 | ``` | ||
| 33 | |||
| 34 | ## Dvorak | ||
| 35 | |||
| 36 | ``` | ||
| 37 | ,-----------------------------------------. ,-----------------------------------------. | ||
| 38 | | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp | | ||
| 39 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 40 | | Esc | A | O | E | U | I | | D | H | T | N | S | - | | ||
| 41 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 42 | | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | | ||
| 43 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 44 | | ` | Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right | | ||
| 45 | `-----------------------------------------' `-----------------------------------------' | ||
| 46 | ``` | ||
| 47 | |||
| 48 | ## Lower | ||
| 49 | |||
| 50 | ``` | ||
| 51 | ,-----------------------------------------. ,-----------------------------------------. | ||
| 52 | | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | | ||
| 53 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 54 | | $ | F1 | F2 | F3 | F4 | F5 | | F6 | 4 | 5 | 6 | | | | ||
| 55 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 56 | | | F7 | F8 | F9 | F10 | F11 | | F12 | 1 | 2 | 3 | | | | ||
| 57 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 58 | | | | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 59 | `-----------------------------------------' `-----------------------------------------' | ||
| 60 | ``` | ||
| 61 | |||
| 62 | ## Raise | ||
| 63 | |||
| 64 | ``` | ||
| 65 | ,-----------------------------------------. ,-----------------------------------------. | ||
| 66 | | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | | ||
| 67 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 68 | | | | | | | | | _ | ? | + | { | } | | | | ||
| 69 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 70 | | | | | | | | | - | / | = | [ | ] | \ | | ||
| 71 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 72 | | | | | | | | | | | Home |PageDn|PageUp| End | | ||
| 73 | `-----------------------------------------' `-----------------------------------------' | ||
| 74 | ``` | ||
| 75 | |||
| 76 | ## Adjust (Lower + Raise) | ||
| 77 | |||
| 78 | ``` | ||
| 79 | ,-----------------------------------------. ,-----------------------------------------. | ||
| 80 | | | Reset| | | | | | | | | | | Reset| | ||
| 81 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 82 | | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | | ||
| 83 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 84 | | | | | | | | | | | | | | | | ||
| 85 | |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 86 | | | | | | | | | | | | | | | | ||
| 87 | `-----------------------------------------' `-----------------------------------------' | ||
| 88 | ``` | ||
diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c index 138969004..81dfb1445 100644 --- a/keyboards/lets_split/matrix.c +++ b/keyboards/lets_split/matrix.c | |||
| @@ -226,9 +226,7 @@ uint8_t matrix_scan(void) | |||
| 226 | TXLED0; | 226 | TXLED0; |
| 227 | error_count = 0; | 227 | error_count = 0; |
| 228 | } | 228 | } |
| 229 | |||
| 230 | matrix_scan_quantum(); | 229 | matrix_scan_quantum(); |
| 231 | |||
| 232 | return ret; | 230 | return ret; |
| 233 | } | 231 | } |
| 234 | 232 | ||
diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h index 2f5bde953..5fb87cf5d 100644 --- a/keyboards/lets_split/rev1/config.h +++ b/keyboards/lets_split/rev1/config.h | |||
| @@ -63,6 +63,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 63 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | 63 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ |
| 64 | ) | 64 | ) |
| 65 | 65 | ||
| 66 | /* ws2812 RGB LED */ | ||
| 67 | #define RGB_DI_PIN D3 | ||
| 68 | #define RGBLIGHT_TIMER | ||
| 69 | #define RGBLED_NUM 16 // Number of LEDs | ||
| 70 | #define ws2812_PORTREG PORTD | ||
| 71 | #define ws2812_DDRREG DDRD | ||
| 72 | |||
| 66 | /* | 73 | /* |
| 67 | * Feature disable options | 74 | * Feature disable options |
| 68 | * These options are also useful to firmware size reduction. | 75 | * These options are also useful to firmware size reduction. |
diff --git a/keyboards/lets_split/rev2/rev2.c b/keyboards/lets_split/rev2/rev2.c index c505d3a6e..8bfa171d0 100644 --- a/keyboards/lets_split/rev2/rev2.c +++ b/keyboards/lets_split/rev2/rev2.c | |||
| @@ -5,6 +5,13 @@ | |||
| 5 | float tone_goodbye[][2] = SONG(GOODBYE_SOUND); | 5 | float tone_goodbye[][2] = SONG(GOODBYE_SOUND); |
| 6 | #endif | 6 | #endif |
| 7 | 7 | ||
| 8 | #ifdef SSD1306OLED | ||
| 9 | void led_set_kb(uint8_t usb_led) { | ||
| 10 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
| 11 | led_set_user(usb_led); | ||
| 12 | } | ||
| 13 | #endif | ||
| 14 | |||
| 8 | void matrix_init_kb(void) { | 15 | void matrix_init_kb(void) { |
| 9 | 16 | ||
| 10 | #ifdef AUDIO_ENABLE | 17 | #ifdef AUDIO_ENABLE |
| @@ -30,3 +37,4 @@ void shutdown_user(void) { | |||
| 30 | stop_all_notes(); | 37 | stop_all_notes(); |
| 31 | #endif | 38 | #endif |
| 32 | } | 39 | } |
| 40 | |||
diff --git a/keyboards/lets_split/rev2/rev2.h b/keyboards/lets_split/rev2/rev2.h index 990976de2..054731366 100644 --- a/keyboards/lets_split/rev2/rev2.h +++ b/keyboards/lets_split/rev2/rev2.h | |||
| @@ -6,23 +6,66 @@ | |||
| 6 | //void promicro_bootloader_jmp(bool program); | 6 | //void promicro_bootloader_jmp(bool program); |
| 7 | #include "quantum.h" | 7 | #include "quantum.h" |
| 8 | 8 | ||
| 9 | |||
| 10 | #ifdef USE_I2C | ||
| 11 | #include <stddef.h> | ||
| 12 | #ifdef __AVR__ | ||
| 13 | #include <avr/io.h> | ||
| 14 | #include <avr/interrupt.h> | ||
| 15 | #endif | ||
| 16 | #ifdef SSD1306OLED | ||
| 17 | extern bool iota_gfx_init(void); | ||
| 18 | extern void iota_gfx_task(void); | ||
| 19 | extern bool iota_gfx_off(void); | ||
| 20 | extern bool iota_gfx_on(void); | ||
| 21 | extern void iota_gfx_flush(void); | ||
| 22 | extern void iota_gfx_write_char(uint8_t c); | ||
| 23 | extern void iota_gfx_write(const char *data); | ||
| 24 | extern void iota_gfx_write_P(const char *data); | ||
| 25 | extern void iota_gfx_clear_screen(void); | ||
| 26 | #endif | ||
| 27 | #endif | ||
| 28 | |||
| 9 | //void promicro_bootloader_jmp(bool program); | 29 | //void promicro_bootloader_jmp(bool program); |
| 10 | 30 | ||
| 31 | #ifndef FLIP_HALF | ||
| 32 | //Standard Keymap | ||
| 11 | #define KEYMAP( \ | 33 | #define KEYMAP( \ |
| 12 | k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \ | 34 | k40, k41, k42, k43, k44, k45, k05, k04, k03, k02, k01, k00, \ |
| 13 | k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \ | 35 | k50, k51, k52, k53, k54, k55, k15, k14, k13, k12, k11, k10, \ |
| 14 | k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \ | 36 | k60, k61, k62, k63, k64, k65, k25, k24, k23, k22, k21, k20, \ |
| 15 | k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \ | 37 | k70, k71, k72, k73, k74, k75, k35, k34, k33, k32, k31, k30 \ |
| 38 | ) \ | ||
| 39 | { \ | ||
| 40 | { k45, k44, k43, k42, k41, k40 }, \ | ||
| 41 | { k55, k54, k53, k52, k51, k50 }, \ | ||
| 42 | { k65, k64, k63, k62, k61, k60 }, \ | ||
| 43 | { k75, k74, k73, k72, k71, k70 }, \ | ||
| 44 | { k00, k01, k02, k03, k04, k05 }, \ | ||
| 45 | { k10, k11, k12, k13, k14, k15 }, \ | ||
| 46 | { k20, k21, k22, k23, k24, k25 }, \ | ||
| 47 | { k30, k31, k32, k33, k34, k35 } \ | ||
| 48 | } | ||
| 49 | |||
| 50 | #else | ||
| 51 | // Keymap with one side flipped | ||
| 52 | #define KEYMAP( \ | ||
| 53 | k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ | ||
| 54 | k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ | ||
| 55 | k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ | ||
| 56 | k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ | ||
| 16 | ) \ | 57 | ) \ |
| 17 | { \ | 58 | { \ |
| 18 | { k00, k01, k02, k03, k04, k05 }, \ | 59 | { k00, k01, k02, k03, k04, k05 }, \ |
| 19 | { k10, k11, k12, k13, k14, k15 }, \ | 60 | { k10, k11, k12, k13, k14, k15 }, \ |
| 20 | { k20, k21, k22, k23, k24, k25 }, \ | 61 | { k20, k21, k22, k23, k24, k25 }, \ |
| 21 | { k30, k31, k32, k33, k34, k35 }, \ | 62 | { k30, k31, k32, k33, k34, k35 }, \ |
| 22 | { k40, k41, k42, k43, k44, k45 }, \ | 63 | { k45, k44, k43, k42, k41, k40 }, \ |
| 23 | { k50, k51, k52, k53, k54, k55 }, \ | 64 | { k55, k54, k53, k52, k51, k50 }, \ |
| 24 | { k60, k61, k62, k63, k64, k65 }, \ | 65 | { k65, k64, k63, k62, k61, k60 }, \ |
| 25 | { k70, k71, k72, k73, k74, k75 } \ | 66 | { k75, k74, k73, k72, k71, k70 } \ |
| 26 | } | 67 | } |
| 68 | #endif | ||
| 69 | |||
| 27 | 70 | ||
| 28 | #endif \ No newline at end of file | 71 | #endif \ No newline at end of file |
diff --git a/keyboards/lets_split/rev2fliphalf/Makefile b/keyboards/lets_split/rev2fliphalf/Makefile deleted file mode 100644 index 4e2a6f00f..000000000 --- a/keyboards/lets_split/rev2fliphalf/Makefile +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | ifndef MAKEFILE_INCLUDED | ||
| 2 | include ../../Makefile | ||
| 3 | endif \ No newline at end of file | ||
diff --git a/keyboards/lets_split/rev2fliphalf/config.h b/keyboards/lets_split/rev2fliphalf/config.h deleted file mode 100644 index 1c45cf136..000000000 --- a/keyboards/lets_split/rev2fliphalf/config.h +++ /dev/null | |||
| @@ -1,91 +0,0 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef CONFIG_H | ||
| 19 | #define CONFIG_H | ||
| 20 | |||
| 21 | #include "config_common.h" | ||
| 22 | |||
| 23 | /* USB Device descriptor parameter */ | ||
| 24 | #define VENDOR_ID 0xFEED | ||
| 25 | #define PRODUCT_ID 0x3060 | ||
| 26 | #define DEVICE_VER 0x0001 | ||
| 27 | #define MANUFACTURER Wootpatoot | ||
| 28 | #define PRODUCT Lets Split v2 | ||
| 29 | #define DESCRIPTION A split keyboard for the cheap makers | ||
| 30 | |||
| 31 | /* key matrix size */ | ||
| 32 | // Rows are doubled-up | ||
| 33 | #define MATRIX_ROWS 8 | ||
| 34 | #define MATRIX_COLS 6 | ||
| 35 | |||
| 36 | // wiring of each half | ||
| 37 | #define MATRIX_ROW_PINS { D7, E6, B4, B5 } | ||
| 38 | //#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } | ||
| 39 | #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order | ||
| 40 | |||
| 41 | //#define CATERINA_BOOTLOADER | ||
| 42 | |||
| 43 | /* COL2ROW or ROW2COL */ | ||
| 44 | #define DIODE_DIRECTION COL2ROW | ||
| 45 | |||
| 46 | /* define if matrix has ghost */ | ||
| 47 | //#define MATRIX_HAS_GHOST | ||
| 48 | |||
| 49 | /* number of backlight levels */ | ||
| 50 | // #define BACKLIGHT_LEVELS 3 | ||
| 51 | |||
| 52 | /* Set 0 if debouncing isn't needed */ | ||
| 53 | #define DEBOUNCING_DELAY 5 | ||
| 54 | |||
| 55 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 56 | #define LOCKING_SUPPORT_ENABLE | ||
| 57 | /* Locking resynchronize hack */ | ||
| 58 | #define LOCKING_RESYNC_ENABLE | ||
| 59 | |||
| 60 | /* key combination for command */ | ||
| 61 | #define IS_COMMAND() ( \ | ||
| 62 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
| 63 | ) | ||
| 64 | |||
| 65 | /* ws2812 RGB LED */ | ||
| 66 | #define RGB_DI_PIN D3 | ||
| 67 | #define RGBLIGHT_TIMER | ||
| 68 | #define RGBLED_NUM 12 // Number of LEDs | ||
| 69 | #define ws2812_PORTREG PORTD | ||
| 70 | #define ws2812_DDRREG DDRD | ||
| 71 | |||
| 72 | /* | ||
| 73 | * Feature disable options | ||
| 74 | * These options are also useful to firmware size reduction. | ||
| 75 | */ | ||
| 76 | |||
| 77 | /* disable debug print */ | ||
| 78 | // #define NO_DEBUG | ||
| 79 | |||
| 80 | /* disable print */ | ||
| 81 | // #define NO_PRINT | ||
| 82 | |||
| 83 | /* disable action features */ | ||
| 84 | //#define NO_ACTION_LAYER | ||
| 85 | //#define NO_ACTION_TAPPING | ||
| 86 | //#define NO_ACTION_ONESHOT | ||
| 87 | //#define NO_ACTION_MACRO | ||
| 88 | //#define NO_ACTION_FUNCTION | ||
| 89 | |||
| 90 | |||
| 91 | #endif \ No newline at end of file | ||
diff --git a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c b/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c deleted file mode 100644 index c505d3a6e..000000000 --- a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | #include "lets_split.h" | ||
| 2 | |||
| 3 | #ifdef AUDIO_ENABLE | ||
| 4 | float tone_startup[][2] = SONG(STARTUP_SOUND); | ||
| 5 | float tone_goodbye[][2] = SONG(GOODBYE_SOUND); | ||
| 6 | #endif | ||
| 7 | |||
| 8 | void matrix_init_kb(void) { | ||
| 9 | |||
| 10 | #ifdef AUDIO_ENABLE | ||
| 11 | _delay_ms(20); // gets rid of tick | ||
| 12 | PLAY_NOTE_ARRAY(tone_startup, false, 0); | ||
| 13 | #endif | ||
| 14 | |||
| 15 | // // green led on | ||
| 16 | // DDRD |= (1<<5); | ||
| 17 | // PORTD &= ~(1<<5); | ||
| 18 | |||
| 19 | // // orange led on | ||
| 20 | // DDRB |= (1<<0); | ||
| 21 | // PORTB &= ~(1<<0); | ||
| 22 | |||
| 23 | matrix_init_user(); | ||
| 24 | }; | ||
| 25 | |||
| 26 | void shutdown_user(void) { | ||
| 27 | #ifdef AUDIO_ENABLE | ||
| 28 | PLAY_NOTE_ARRAY(tone_goodbye, false, 0); | ||
| 29 | _delay_ms(150); | ||
| 30 | stop_all_notes(); | ||
| 31 | #endif | ||
| 32 | } | ||
diff --git a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h b/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h deleted file mode 100644 index 7dc8e5ba8..000000000 --- a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | #ifndef REV2FLIPHALF_H | ||
| 2 | #define REV2FLIPHALF_H | ||
| 3 | |||
| 4 | #include "../lets_split.h" | ||
| 5 | |||
| 6 | //void promicro_bootloader_jmp(bool program); | ||
| 7 | #include "quantum.h" | ||
| 8 | |||
| 9 | //void promicro_bootloader_jmp(bool program); | ||
| 10 | |||
| 11 | #define KEYMAP( \ | ||
| 12 | k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ | ||
| 13 | k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ | ||
| 14 | k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ | ||
| 15 | k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ | ||
| 16 | ) \ | ||
| 17 | { \ | ||
| 18 | { k00, k01, k02, k03, k04, k05 }, \ | ||
| 19 | { k10, k11, k12, k13, k14, k15 }, \ | ||
| 20 | { k20, k21, k22, k23, k24, k25 }, \ | ||
| 21 | { k30, k31, k32, k33, k34, k35 }, \ | ||
| 22 | { k40, k41, k42, k43, k44, k45 }, \ | ||
| 23 | { k50, k51, k52, k53, k54, k55 }, \ | ||
| 24 | { k60, k61, k62, k63, k64, k65 }, \ | ||
| 25 | { k70, k71, k72, k73, k74, k75 } \ | ||
| 26 | } | ||
| 27 | |||
| 28 | #endif \ No newline at end of file | ||
diff --git a/keyboards/lets_split/rev2fliphalf/rules.mk b/keyboards/lets_split/rev2fliphalf/rules.mk deleted file mode 100644 index 80a942d06..000000000 --- a/keyboards/lets_split/rev2fliphalf/rules.mk +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | BACKLIGHT_ENABLE = no | ||
| 2 | |||
| 3 | ifndef QUANTUM_DIR | ||
| 4 | include ../../../Makefile | ||
| 5 | endif | ||
diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk index 0efa78550..ff159e0f0 100644 --- a/keyboards/lets_split/rules.mk +++ b/keyboards/lets_split/rules.mk | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | SRC += matrix.c \ | 1 | SRC += matrix.c \ |
| 2 | i2c.c \ | 2 | i2c.c \ |
| 3 | split_util.c \ | 3 | split_util.c \ |
| 4 | serial.c | 4 | serial.c\ |
| 5 | ssd1306.c | ||
| 5 | 6 | ||
| 6 | # MCU name | 7 | # MCU name |
| 7 | #MCU = at90usb1287 | 8 | #MCU = at90usb1287 |
| @@ -73,15 +74,3 @@ USE_I2C ?= yes | |||
| 73 | SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend | 74 | SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend |
| 74 | 75 | ||
| 75 | CUSTOM_MATRIX = yes | 76 | CUSTOM_MATRIX = yes |
| 76 | |||
| 77 | avrdude: build | ||
| 78 | ls /dev/tty* > /tmp/1; \ | ||
| 79 | echo "Reset your Pro Micro now"; \ | ||
| 80 | while [[ -z $$USB ]]; do \ | ||
| 81 | sleep 1; \ | ||
| 82 | ls /dev/tty* > /tmp/2; \ | ||
| 83 | USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ | ||
| 84 | done; \ | ||
| 85 | avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex | ||
| 86 | |||
| 87 | .PHONY: avrdude | ||
diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c index 226dc1881..46586fbc0 100644 --- a/keyboards/lets_split/split_util.c +++ b/keyboards/lets_split/split_util.c | |||
| @@ -21,7 +21,7 @@ static void setup_handedness(void) { | |||
| 21 | #ifdef EE_HANDS | 21 | #ifdef EE_HANDS |
| 22 | isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); | 22 | isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); |
| 23 | #else | 23 | #else |
| 24 | // I2C_MASTER_RIGHT is deprecated use MASTER_RIGHT instead since this works for both serial and i2c | 24 | // I2c_MASTER_RIGHT ish deprecate use MASTER_RIGHT instead since this works for both serial and i2c: |
| 25 | #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) | 25 | #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) |
| 26 | isLeftHand = !has_usb(); | 26 | isLeftHand = !has_usb(); |
| 27 | #else | 27 | #else |
| @@ -33,6 +33,9 @@ static void setup_handedness(void) { | |||
| 33 | static void keyboard_master_setup(void) { | 33 | static void keyboard_master_setup(void) { |
| 34 | #ifdef USE_I2C | 34 | #ifdef USE_I2C |
| 35 | i2c_master_init(); | 35 | i2c_master_init(); |
| 36 | #ifdef SSD1306OLED | ||
| 37 | matrix_master_OLED_init (); | ||
| 38 | #endif | ||
| 36 | #else | 39 | #else |
| 37 | serial_master_init(); | 40 | serial_master_init(); |
| 38 | #endif | 41 | #endif |
diff --git a/keyboards/lets_split/split_util.h b/keyboards/lets_split/split_util.h index 6b896679c..3ae76c209 100644 --- a/keyboards/lets_split/split_util.h +++ b/keyboards/lets_split/split_util.h | |||
| @@ -19,4 +19,6 @@ void split_keyboard_setup(void); | |||
| 19 | bool has_usb(void); | 19 | bool has_usb(void); |
| 20 | void keyboard_slave_loop(void); | 20 | void keyboard_slave_loop(void); |
| 21 | 21 | ||
| 22 | void matrix_master_OLED_init (void); | ||
| 23 | |||
| 22 | #endif | 24 | #endif |
diff --git a/keyboards/lets_split/ssd1306.c b/keyboards/lets_split/ssd1306.c new file mode 100644 index 000000000..3c7816bb3 --- /dev/null +++ b/keyboards/lets_split/ssd1306.c | |||
| @@ -0,0 +1,468 @@ | |||
| 1 | #include "config.h" | ||
| 2 | #include "i2c.h" | ||
| 3 | #include <stdbool.h> | ||
| 4 | #include <string.h> | ||
| 5 | #include <stdio.h> | ||
| 6 | #include "print.h" | ||
| 7 | #include "lets_split.h" | ||
| 8 | #include "common/glcdfont.c" | ||
| 9 | #ifdef ADAFRUIT_BLE_ENABLE | ||
| 10 | #include "adafruit_ble.h" | ||
| 11 | #endif | ||
| 12 | #ifdef PROTOCOL_LUFA | ||
| 13 | #include "lufa.h" | ||
| 14 | #endif | ||
| 15 | #include "sendchar.h" | ||
| 16 | #include "pincontrol.h" | ||
| 17 | |||
| 18 | //assign the right code to your layers | ||
| 19 | #define _BASE 0 | ||
| 20 | #define _LOWER 8 | ||
| 21 | #define _RAISE 16 | ||
| 22 | #define _FNLAYER 64 | ||
| 23 | #define _NUMLAY 128 | ||
| 24 | #define _NLOWER 136 | ||
| 25 | #define _NFNLAYER 192 | ||
| 26 | #define _MOUSECURSOR 256 | ||
| 27 | #define _ADJUST 65560 | ||
| 28 | |||
| 29 | // Set this to 1 to help diagnose early startup problems | ||
| 30 | // when testing power-on with ble. Turn it off otherwise, | ||
| 31 | // as the latency of printing most of the debug info messes | ||
| 32 | // with the matrix scan, causing keys to drop. | ||
| 33 | #define DEBUG_TO_SCREEN 0 | ||
| 34 | |||
| 35 | // Controls the SSD1306 128x32 OLED display via i2c | ||
| 36 | |||
| 37 | #define i2cAddress 0x3C | ||
| 38 | |||
| 39 | #define DisplayHeight 32 | ||
| 40 | #define DisplayWidth 128 | ||
| 41 | |||
| 42 | #define FontHeight 8 | ||
| 43 | #define FontWidth 6 | ||
| 44 | |||
| 45 | #define MatrixRows (DisplayHeight / FontHeight) | ||
| 46 | #define MatrixCols (DisplayWidth / FontWidth) | ||
| 47 | |||
| 48 | struct CharacterMatrix { | ||
| 49 | uint8_t display[MatrixRows][MatrixCols]; | ||
| 50 | uint8_t *cursor; | ||
| 51 | bool dirty; | ||
| 52 | }; | ||
| 53 | |||
| 54 | static struct CharacterMatrix display; | ||
| 55 | //static uint16_t last_battery_update; | ||
| 56 | //static uint32_t vbat; | ||
| 57 | //#define BatteryUpdateInterval 10000 /* milliseconds */ | ||
| 58 | #define ScreenOffInterval 300000 /* milliseconds */ | ||
| 59 | #if DEBUG_TO_SCREEN | ||
| 60 | static uint8_t displaying; | ||
| 61 | #endif | ||
| 62 | static uint16_t last_flush; | ||
| 63 | |||
| 64 | enum ssd1306_cmds { | ||
| 65 | DisplayOff = 0xAE, | ||
| 66 | DisplayOn = 0xAF, | ||
| 67 | |||
| 68 | SetContrast = 0x81, | ||
| 69 | DisplayAllOnResume = 0xA4, | ||
| 70 | |||
| 71 | DisplayAllOn = 0xA5, | ||
| 72 | NormalDisplay = 0xA6, | ||
| 73 | InvertDisplay = 0xA7, | ||
| 74 | SetDisplayOffset = 0xD3, | ||
| 75 | SetComPins = 0xda, | ||
| 76 | SetVComDetect = 0xdb, | ||
| 77 | SetDisplayClockDiv = 0xD5, | ||
| 78 | SetPreCharge = 0xd9, | ||
| 79 | SetMultiPlex = 0xa8, | ||
| 80 | SetLowColumn = 0x00, | ||
| 81 | SetHighColumn = 0x10, | ||
| 82 | SetStartLine = 0x40, | ||
| 83 | |||
| 84 | SetMemoryMode = 0x20, | ||
| 85 | ColumnAddr = 0x21, | ||
| 86 | PageAddr = 0x22, | ||
| 87 | |||
| 88 | ComScanInc = 0xc0, | ||
| 89 | ComScanDec = 0xc8, | ||
| 90 | SegRemap = 0xa0, | ||
| 91 | SetChargePump = 0x8d, | ||
| 92 | ExternalVcc = 0x01, | ||
| 93 | SwitchCapVcc = 0x02, | ||
| 94 | |||
| 95 | ActivateScroll = 0x2f, | ||
| 96 | DeActivateScroll = 0x2e, | ||
| 97 | SetVerticalScrollArea = 0xa3, | ||
| 98 | RightHorizontalScroll = 0x26, | ||
| 99 | LeftHorizontalScroll = 0x27, | ||
| 100 | VerticalAndRightHorizontalScroll = 0x29, | ||
| 101 | VerticalAndLeftHorizontalScroll = 0x2a, | ||
| 102 | }; | ||
| 103 | |||
| 104 | |||
| 105 | // Write command sequence. | ||
| 106 | // Returns true on success. | ||
| 107 | static inline bool _send_cmd1(uint8_t cmd) { | ||
| 108 | bool res = false; | ||
| 109 | |||
| 110 | if (i2c_start_write(i2cAddress)) { | ||
| 111 | xprintf("failed to start write to %d\n", i2cAddress); | ||
| 112 | goto done; | ||
| 113 | } | ||
| 114 | |||
| 115 | if (i2c_master_write(0x0 /* command byte follows */)) { | ||
| 116 | print("failed to write control byte\n"); | ||
| 117 | |||
| 118 | goto done; | ||
| 119 | } | ||
| 120 | |||
| 121 | if (i2c_master_write(cmd)) { | ||
| 122 | xprintf("failed to write command %d\n", cmd); | ||
| 123 | goto done; | ||
| 124 | } | ||
| 125 | res = true; | ||
| 126 | done: | ||
| 127 | i2c_master_stop(); | ||
| 128 | return res; | ||
| 129 | } | ||
| 130 | |||
| 131 | // Write 2-byte command sequence. | ||
| 132 | // Returns true on success | ||
| 133 | static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { | ||
| 134 | if (!_send_cmd1(cmd)) { | ||
| 135 | return false; | ||
| 136 | } | ||
| 137 | return _send_cmd1(opr); | ||
| 138 | } | ||
| 139 | |||
| 140 | // Write 3-byte command sequence. | ||
| 141 | // Returns true on success | ||
| 142 | static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { | ||
| 143 | if (!_send_cmd1(cmd)) { | ||
| 144 | return false; | ||
| 145 | } | ||
| 146 | if (!_send_cmd1(opr1)) { | ||
| 147 | return false; | ||
| 148 | } | ||
| 149 | return _send_cmd1(opr2); | ||
| 150 | } | ||
| 151 | |||
| 152 | #define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} | ||
| 153 | #define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} | ||
| 154 | #define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} | ||
| 155 | |||
| 156 | static void matrix_clear(struct CharacterMatrix *matrix); | ||
| 157 | |||
| 158 | static void clear_display(void) { | ||
| 159 | matrix_clear(&display); | ||
| 160 | |||
| 161 | // Clear all of the display bits (there can be random noise | ||
| 162 | // in the RAM on startup) | ||
| 163 | send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); | ||
| 164 | send_cmd3(ColumnAddr, 0, DisplayWidth - 1); | ||
| 165 | |||
| 166 | if (i2c_start_write(i2cAddress)) { | ||
| 167 | goto done; | ||
| 168 | } | ||
| 169 | if (i2c_master_write(0x40)) { | ||
| 170 | // Data mode | ||
| 171 | goto done; | ||
| 172 | } | ||
| 173 | for (uint8_t row = 0; row < MatrixRows; ++row) { | ||
| 174 | for (uint8_t col = 0; col < DisplayWidth; ++col) { | ||
| 175 | i2c_master_write(0); | ||
| 176 | } | ||
| 177 | } | ||
| 178 | |||
| 179 | display.dirty = false; | ||
| 180 | |||
| 181 | done: | ||
| 182 | i2c_master_stop(); | ||
| 183 | } | ||
| 184 | |||
| 185 | #if DEBUG_TO_SCREEN | ||
| 186 | #undef sendchar | ||
| 187 | static int8_t capture_sendchar(uint8_t c) { | ||
| 188 | sendchar(c); | ||
| 189 | iota_gfx_write_char(c); | ||
| 190 | |||
| 191 | if (!displaying) { | ||
| 192 | iota_gfx_flush(); | ||
| 193 | } | ||
| 194 | return 0; | ||
| 195 | } | ||
| 196 | #endif | ||
| 197 | |||
| 198 | bool iota_gfx_init(void) { | ||
| 199 | bool success = false; | ||
| 200 | |||
| 201 | send_cmd1(DisplayOff); | ||
| 202 | send_cmd2(SetDisplayClockDiv, 0x80); | ||
| 203 | send_cmd2(SetMultiPlex, DisplayHeight - 1); | ||
| 204 | |||
| 205 | send_cmd2(SetDisplayOffset, 0); | ||
| 206 | |||
| 207 | |||
| 208 | send_cmd1(SetStartLine | 0x0); | ||
| 209 | send_cmd2(SetChargePump, 0x14 /* Enable */); | ||
| 210 | send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); | ||
| 211 | |||
| 212 | /// Flips the display orientation 0 degrees | ||
| 213 | send_cmd1(SegRemap | 0x1); | ||
| 214 | send_cmd1(ComScanDec); | ||
| 215 | /* | ||
| 216 | // the following Flip the display orientation 180 degrees | ||
| 217 | send_cmd1(SegRemap); | ||
| 218 | send_cmd1(ComScanInc); | ||
| 219 | // end flip */ | ||
| 220 | send_cmd2(SetComPins, 0x2); | ||
| 221 | send_cmd2(SetContrast, 0x8f); | ||
| 222 | send_cmd2(SetPreCharge, 0xf1); | ||
| 223 | send_cmd2(SetVComDetect, 0x40); | ||
| 224 | send_cmd1(DisplayAllOnResume); | ||
| 225 | send_cmd1(NormalDisplay); | ||
| 226 | send_cmd1(DeActivateScroll); | ||
| 227 | send_cmd1(DisplayOn); | ||
| 228 | |||
| 229 | send_cmd2(SetContrast, 0); // Dim | ||
| 230 | |||
| 231 | clear_display(); | ||
| 232 | |||
| 233 | success = true; | ||
| 234 | |||
| 235 | iota_gfx_flush(); | ||
| 236 | |||
| 237 | #if DEBUG_TO_SCREEN | ||
| 238 | print_set_sendchar(capture_sendchar); | ||
| 239 | #endif | ||
| 240 | |||
| 241 | done: | ||
| 242 | return success; | ||
| 243 | } | ||
| 244 | |||
| 245 | bool iota_gfx_off(void) { | ||
| 246 | bool success = false; | ||
| 247 | |||
| 248 | send_cmd1(DisplayOff); | ||
| 249 | success = true; | ||
| 250 | |||
| 251 | done: | ||
| 252 | return success; | ||
| 253 | } | ||
| 254 | |||
| 255 | bool iota_gfx_on(void) { | ||
| 256 | bool success = false; | ||
| 257 | |||
| 258 | send_cmd1(DisplayOn); | ||
| 259 | success = true; | ||
| 260 | |||
| 261 | done: | ||
| 262 | return success; | ||
| 263 | } | ||
| 264 | |||
| 265 | static void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { | ||
| 266 | *matrix->cursor = c; | ||
| 267 | ++matrix->cursor; | ||
| 268 | |||
| 269 | if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { | ||
| 270 | // We went off the end; scroll the display upwards by one line | ||
| 271 | memmove(&matrix->display[0], &matrix->display[1], | ||
| 272 | MatrixCols * (MatrixRows - 1)); | ||
| 273 | matrix->cursor = &matrix->display[MatrixRows - 1][0]; | ||
| 274 | memset(matrix->cursor, ' ', MatrixCols); | ||
| 275 | } | ||
| 276 | } | ||
| 277 | |||
| 278 | static void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { | ||
| 279 | matrix->dirty = true; | ||
| 280 | |||
| 281 | if (c == '\n') { | ||
| 282 | // Clear to end of line from the cursor and then move to the | ||
| 283 | // start of the next line | ||
| 284 | uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; | ||
| 285 | |||
| 286 | while (cursor_col++ < MatrixCols) { | ||
| 287 | matrix_write_char_inner(matrix, ' '); | ||
| 288 | } | ||
| 289 | return; | ||
| 290 | } | ||
| 291 | |||
| 292 | matrix_write_char_inner(matrix, c); | ||
| 293 | } | ||
| 294 | |||
| 295 | void iota_gfx_write_char(uint8_t c) { | ||
| 296 | matrix_write_char(&display, c); | ||
| 297 | } | ||
| 298 | |||
| 299 | static void matrix_write(struct CharacterMatrix *matrix, const char *data) { | ||
| 300 | const char *end = data + strlen(data); | ||
| 301 | while (data < end) { | ||
| 302 | matrix_write_char(matrix, *data); | ||
| 303 | ++data; | ||
| 304 | } | ||
| 305 | } | ||
| 306 | |||
| 307 | void iota_gfx_write(const char *data) { | ||
| 308 | matrix_write(&display, data); | ||
| 309 | } | ||
| 310 | |||
| 311 | static void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { | ||
| 312 | while (true) { | ||
| 313 | uint8_t c = pgm_read_byte(data); | ||
| 314 | if (c == 0) { | ||
| 315 | return; | ||
| 316 | } | ||
| 317 | matrix_write_char(matrix, c); | ||
| 318 | ++data; | ||
| 319 | } | ||
| 320 | } | ||
| 321 | |||
| 322 | void iota_gfx_write_P(const char *data) { | ||
| 323 | matrix_write_P(&display, data); | ||
| 324 | } | ||
| 325 | |||
| 326 | static void matrix_clear(struct CharacterMatrix *matrix) { | ||
| 327 | memset(matrix->display, ' ', sizeof(matrix->display)); | ||
| 328 | matrix->cursor = &matrix->display[0][0]; | ||
| 329 | matrix->dirty = true; | ||
| 330 | } | ||
| 331 | |||
| 332 | void iota_gfx_clear_screen(void) { | ||
| 333 | matrix_clear(&display); | ||
| 334 | } | ||
| 335 | |||
| 336 | static void matrix_render(struct CharacterMatrix *matrix) { | ||
| 337 | last_flush = timer_read(); | ||
| 338 | iota_gfx_on(); | ||
| 339 | #if DEBUG_TO_SCREEN | ||
| 340 | ++displaying; | ||
| 341 | #endif | ||
| 342 | |||
| 343 | // Move to the home position | ||
| 344 | send_cmd3(PageAddr, 0, MatrixRows - 1); | ||
| 345 | send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); | ||
| 346 | |||
| 347 | if (i2c_start_write(i2cAddress)) { | ||
| 348 | goto done; | ||
| 349 | } | ||
| 350 | if (i2c_master_write(0x40)) { | ||
| 351 | // Data mode | ||
| 352 | goto done; | ||
| 353 | } | ||
| 354 | |||
| 355 | for (uint8_t row = 0; row < MatrixRows; ++row) { | ||
| 356 | for (uint8_t col = 0; col < MatrixCols; ++col) { | ||
| 357 | const uint8_t *glyph = font + (matrix->display[row][col] * (FontWidth - 1)); | ||
| 358 | |||
| 359 | for (uint8_t glyphCol = 0; glyphCol < FontWidth - 1; ++glyphCol) { | ||
| 360 | uint8_t colBits = pgm_read_byte(glyph + glyphCol); | ||
| 361 | i2c_master_write(colBits); | ||
| 362 | } | ||
| 363 | |||
| 364 | // 1 column of space between chars (it's not included in the glyph) | ||
| 365 | i2c_master_write(0); | ||
| 366 | } | ||
| 367 | } | ||
| 368 | |||
| 369 | matrix->dirty = false; | ||
| 370 | |||
| 371 | done: | ||
| 372 | i2c_master_stop(); | ||
| 373 | #if DEBUG_TO_SCREEN | ||
| 374 | --displaying; | ||
| 375 | #endif | ||
| 376 | } | ||
| 377 | |||
| 378 | void iota_gfx_flush(void) { | ||
| 379 | matrix_render(&display); | ||
| 380 | } | ||
| 381 | |||
| 382 | static void matrix_update(struct CharacterMatrix *dest, | ||
| 383 | const struct CharacterMatrix *source) { | ||
| 384 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
| 385 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
| 386 | dest->dirty = true; | ||
| 387 | } | ||
| 388 | } | ||
| 389 | |||
| 390 | static void render_status_info(void) { | ||
| 391 | #if DEBUG_TO_SCREEN | ||
| 392 | if (debug_enable) { | ||
| 393 | return; | ||
| 394 | } | ||
| 395 | #endif | ||
| 396 | |||
| 397 | struct CharacterMatrix matrix; | ||
| 398 | |||
| 399 | matrix_clear(&matrix); | ||
| 400 | matrix_write_P(&matrix, PSTR("USB: ")); | ||
| 401 | #ifdef PROTOCOL_LUFA | ||
| 402 | switch (USB_DeviceState) { | ||
| 403 | case DEVICE_STATE_Unattached: | ||
| 404 | matrix_write_P(&matrix, PSTR("Unattached")); | ||
| 405 | break; | ||
| 406 | case DEVICE_STATE_Suspended: | ||
| 407 | matrix_write_P(&matrix, PSTR("Suspended")); | ||
| 408 | break; | ||
| 409 | case DEVICE_STATE_Configured: | ||
| 410 | matrix_write_P(&matrix, PSTR("Connected")); | ||
| 411 | break; | ||
| 412 | case DEVICE_STATE_Powered: | ||
| 413 | matrix_write_P(&matrix, PSTR("Powered")); | ||
| 414 | break; | ||
| 415 | case DEVICE_STATE_Default: | ||
| 416 | matrix_write_P(&matrix, PSTR("Default")); | ||
| 417 | break; | ||
| 418 | case DEVICE_STATE_Addressed: | ||
| 419 | matrix_write_P(&matrix, PSTR("Addressed")); | ||
| 420 | break; | ||
| 421 | default: | ||
| 422 | matrix_write_P(&matrix, PSTR("Invalid")); | ||
| 423 | } | ||
| 424 | #endif | ||
| 425 | |||
| 426 | // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below | ||
| 427 | |||
| 428 | char buf[40]; | ||
| 429 | snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); | ||
| 430 | matrix_write_P(&matrix, PSTR("\n\nLayer: ")); | ||
| 431 | switch (layer_state) { | ||
| 432 | case _BASE: | ||
| 433 | matrix_write_P(&matrix, PSTR("Default")); | ||
| 434 | break; | ||
| 435 | case _RAISE: | ||
| 436 | matrix_write_P(&matrix, PSTR("Raise")); | ||
| 437 | break; | ||
| 438 | case _LOWER: | ||
| 439 | matrix_write_P(&matrix, PSTR("Lower")); | ||
| 440 | break; | ||
| 441 | case _ADJUST: | ||
| 442 | matrix_write_P(&matrix, PSTR("ADJUST")); | ||
| 443 | break; | ||
| 444 | default: | ||
| 445 | matrix_write(&matrix, buf); | ||
| 446 | } | ||
| 447 | |||
| 448 | // Host Keyboard LED Status | ||
| 449 | char led[40]; | ||
| 450 | snprintf(led, sizeof(led), "\n%s %s %s", | ||
| 451 | (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", | ||
| 452 | (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ", | ||
| 453 | (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); | ||
| 454 | matrix_write(&matrix, led); | ||
| 455 | matrix_update(&display, &matrix); | ||
| 456 | } | ||
| 457 | |||
| 458 | void iota_gfx_task(void) { | ||
| 459 | render_status_info(); | ||
| 460 | |||
| 461 | if (display.dirty) { | ||
| 462 | iota_gfx_flush(); | ||
| 463 | } | ||
| 464 | |||
| 465 | if (timer_elapsed(last_flush) > ScreenOffInterval) { | ||
| 466 | iota_gfx_off(); | ||
| 467 | } | ||
| 468 | } | ||
