diff options
| author | Danny Nguyen <danny@80pct.com> | 2017-06-01 01:26:06 -0400 |
|---|---|---|
| committer | Danny Nguyen <danny@80pct.com> | 2017-06-01 01:26:06 -0400 |
| commit | db82b17d6ec988c7f7c9d0dc1c067d441524b979 (patch) | |
| tree | 4772f73c135ae53fc183f3b398bbe7074618b4ec /keyboards/nyquist | |
| parent | 7a433a7f3deea8e4d04a469e31e8b47047eacc99 (diff) | |
| download | qmk_firmware-db82b17d6ec988c7f7c9d0dc1c067d441524b979.tar.gz qmk_firmware-db82b17d6ec988c7f7c9d0dc1c067d441524b979.zip | |
Remove OLED code and set I2C rate back to 100kHz
Diffstat (limited to 'keyboards/nyquist')
| -rw-r--r-- | keyboards/nyquist/common/glcdfont.c | 276 | ||||
| -rw-r--r-- | keyboards/nyquist/i2c.h | 2 | ||||
| -rw-r--r-- | keyboards/nyquist/rules.mk | 3 | ||||
| -rw-r--r-- | keyboards/nyquist/ssd1306.c | 470 | ||||
| -rw-r--r-- | keyboards/nyquist/ssd1306.h | 17 |
5 files changed, 2 insertions, 766 deletions
diff --git a/keyboards/nyquist/common/glcdfont.c b/keyboards/nyquist/common/glcdfont.c deleted file mode 100644 index 6f88bd23a..000000000 --- a/keyboards/nyquist/common/glcdfont.c +++ /dev/null | |||
| @@ -1,276 +0,0 @@ | |||
| 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/nyquist/i2c.h b/keyboards/nyquist/i2c.h index c15b6bc50..43e596988 100644 --- a/keyboards/nyquist/i2c.h +++ b/keyboards/nyquist/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 400000L | 19 | #define SCL_CLOCK 100000L |
| 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 | ||
diff --git a/keyboards/nyquist/rules.mk b/keyboards/nyquist/rules.mk index 79860ea35..0efa78550 100644 --- a/keyboards/nyquist/rules.mk +++ b/keyboards/nyquist/rules.mk | |||
| @@ -1,8 +1,7 @@ | |||
| 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 | ||
| 6 | 5 | ||
| 7 | # MCU name | 6 | # MCU name |
| 8 | #MCU = at90usb1287 | 7 | #MCU = at90usb1287 |
diff --git a/keyboards/nyquist/ssd1306.c b/keyboards/nyquist/ssd1306.c deleted file mode 100644 index 5c6dff27f..000000000 --- a/keyboards/nyquist/ssd1306.c +++ /dev/null | |||
| @@ -1,470 +0,0 @@ | |||
| 1 | #ifdef SSD1306OLED | ||
| 2 | |||
| 3 | #include "ssd1306.h" | ||
| 4 | #include "config.h" | ||
| 5 | #include "i2c.h" | ||
| 6 | #include <string.h> | ||
| 7 | #include "print.h" | ||
| 8 | #include "lets_split.h" | ||
| 9 | #include "common/glcdfont.c" | ||
| 10 | #ifdef ADAFRUIT_BLE_ENABLE | ||
| 11 | #include "adafruit_ble.h" | ||
| 12 | #endif | ||
| 13 | #ifdef PROTOCOL_LUFA | ||
| 14 | #include "lufa.h" | ||
| 15 | #endif | ||
| 16 | #include "sendchar.h" | ||
| 17 | #include "pincontrol.h" | ||
| 18 | |||
| 19 | //assign the right code to your layers | ||
| 20 | #define _BASE 0 | ||
| 21 | #define _LOWER 8 | ||
| 22 | #define _RAISE 16 | ||
| 23 | #define _FNLAYER 64 | ||
| 24 | #define _NUMLAY 128 | ||
| 25 | #define _NLOWER 136 | ||
| 26 | #define _NFNLAYER 192 | ||
| 27 | #define _MOUSECURSOR 256 | ||
| 28 | #define _ADJUST 65560 | ||
| 29 | |||
| 30 | // Set this to 1 to help diagnose early startup problems | ||
| 31 | // when testing power-on with ble. Turn it off otherwise, | ||
| 32 | // as the latency of printing most of the debug info messes | ||
| 33 | // with the matrix scan, causing keys to drop. | ||
| 34 | #define DEBUG_TO_SCREEN 0 | ||
| 35 | |||
| 36 | // Controls the SSD1306 128x32 OLED display via i2c | ||
| 37 | |||
| 38 | #define i2cAddress 0x3C | ||
| 39 | |||
| 40 | #define DisplayHeight 32 | ||
| 41 | #define DisplayWidth 128 | ||
| 42 | |||
| 43 | #define FontHeight 8 | ||
| 44 | #define FontWidth 6 | ||
| 45 | |||
| 46 | #define MatrixRows (DisplayHeight / FontHeight) | ||
| 47 | #define MatrixCols (DisplayWidth / FontWidth) | ||
| 48 | |||
| 49 | struct CharacterMatrix { | ||
| 50 | uint8_t display[MatrixRows][MatrixCols]; | ||
| 51 | uint8_t *cursor; | ||
| 52 | bool dirty; | ||
| 53 | }; | ||
| 54 | |||
| 55 | static struct CharacterMatrix display; | ||
| 56 | //static uint16_t last_battery_update; | ||
| 57 | //static uint32_t vbat; | ||
| 58 | //#define BatteryUpdateInterval 10000 /* milliseconds */ | ||
| 59 | #define ScreenOffInterval 300000 /* milliseconds */ | ||
| 60 | #if DEBUG_TO_SCREEN | ||
| 61 | static uint8_t displaying; | ||
| 62 | #endif | ||
| 63 | static uint16_t last_flush; | ||
| 64 | |||
| 65 | enum ssd1306_cmds { | ||
| 66 | DisplayOff = 0xAE, | ||
| 67 | DisplayOn = 0xAF, | ||
| 68 | |||
| 69 | SetContrast = 0x81, | ||
| 70 | DisplayAllOnResume = 0xA4, | ||
| 71 | |||
| 72 | DisplayAllOn = 0xA5, | ||
| 73 | NormalDisplay = 0xA6, | ||
| 74 | InvertDisplay = 0xA7, | ||
| 75 | SetDisplayOffset = 0xD3, | ||
| 76 | SetComPins = 0xda, | ||
| 77 | SetVComDetect = 0xdb, | ||
| 78 | SetDisplayClockDiv = 0xD5, | ||
| 79 | SetPreCharge = 0xd9, | ||
| 80 | SetMultiPlex = 0xa8, | ||
| 81 | SetLowColumn = 0x00, | ||
| 82 | SetHighColumn = 0x10, | ||
| 83 | SetStartLine = 0x40, | ||
| 84 | |||
| 85 | SetMemoryMode = 0x20, | ||
| 86 | ColumnAddr = 0x21, | ||
| 87 | PageAddr = 0x22, | ||
| 88 | |||
| 89 | ComScanInc = 0xc0, | ||
| 90 | ComScanDec = 0xc8, | ||
| 91 | SegRemap = 0xa0, | ||
| 92 | SetChargePump = 0x8d, | ||
| 93 | ExternalVcc = 0x01, | ||
| 94 | SwitchCapVcc = 0x02, | ||
| 95 | |||
| 96 | ActivateScroll = 0x2f, | ||
| 97 | DeActivateScroll = 0x2e, | ||
| 98 | SetVerticalScrollArea = 0xa3, | ||
| 99 | RightHorizontalScroll = 0x26, | ||
| 100 | LeftHorizontalScroll = 0x27, | ||
| 101 | VerticalAndRightHorizontalScroll = 0x29, | ||
| 102 | VerticalAndLeftHorizontalScroll = 0x2a, | ||
| 103 | }; | ||
| 104 | |||
| 105 | |||
| 106 | // Write command sequence. | ||
| 107 | // Returns true on success. | ||
| 108 | static inline bool _send_cmd1(uint8_t cmd) { | ||
| 109 | bool res = false; | ||
| 110 | |||
| 111 | if (i2c_start_write(i2cAddress)) { | ||
| 112 | xprintf("failed to start write to %d\n", i2cAddress); | ||
| 113 | goto done; | ||
| 114 | } | ||
| 115 | |||
| 116 | if (i2c_master_write(0x0 /* command byte follows */)) { | ||
| 117 | print("failed to write control byte\n"); | ||
| 118 | |||
| 119 | goto done; | ||
| 120 | } | ||
| 121 | |||
| 122 | if (i2c_master_write(cmd)) { | ||
| 123 | xprintf("failed to write command %d\n", cmd); | ||
| 124 | goto done; | ||
| 125 | } | ||
| 126 | res = true; | ||
| 127 | done: | ||
| 128 | i2c_master_stop(); | ||
| 129 | return res; | ||
| 130 | } | ||
| 131 | |||
| 132 | // Write 2-byte command sequence. | ||
| 133 | // Returns true on success | ||
| 134 | static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { | ||
| 135 | if (!_send_cmd1(cmd)) { | ||
| 136 | return false; | ||
| 137 | } | ||
| 138 | return _send_cmd1(opr); | ||
| 139 | } | ||
| 140 | |||
| 141 | // Write 3-byte command sequence. | ||
| 142 | // Returns true on success | ||
| 143 | static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { | ||
| 144 | if (!_send_cmd1(cmd)) { | ||
| 145 | return false; | ||
| 146 | } | ||
| 147 | if (!_send_cmd1(opr1)) { | ||
| 148 | return false; | ||
| 149 | } | ||
| 150 | return _send_cmd1(opr2); | ||
| 151 | } | ||
| 152 | |||
| 153 | #define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} | ||
| 154 | #define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} | ||
| 155 | #define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} | ||
| 156 | |||
| 157 | static void matrix_clear(struct CharacterMatrix *matrix); | ||
| 158 | |||
| 159 | static void clear_display(void) { | ||
| 160 | matrix_clear(&display); | ||
| 161 | |||
| 162 | // Clear all of the display bits (there can be random noise | ||
| 163 | // in the RAM on startup) | ||
| 164 | send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); | ||
| 165 | send_cmd3(ColumnAddr, 0, DisplayWidth - 1); | ||
| 166 | |||
| 167 | if (i2c_start_write(i2cAddress)) { | ||
| 168 | goto done; | ||
| 169 | } | ||
| 170 | if (i2c_master_write(0x40)) { | ||
| 171 | // Data mode | ||
| 172 | goto done; | ||
| 173 | } | ||
| 174 | for (uint8_t row = 0; row < MatrixRows; ++row) { | ||
| 175 | for (uint8_t col = 0; col < DisplayWidth; ++col) { | ||
| 176 | i2c_master_write(0); | ||
| 177 | } | ||
| 178 | } | ||
| 179 | |||
| 180 | display.dirty = false; | ||
| 181 | |||
| 182 | done: | ||
| 183 | i2c_master_stop(); | ||
| 184 | } | ||
| 185 | |||
| 186 | #if DEBUG_TO_SCREEN | ||
| 187 | #undef sendchar | ||
| 188 | static int8_t capture_sendchar(uint8_t c) { | ||
| 189 | sendchar(c); | ||
| 190 | iota_gfx_write_char(c); | ||
| 191 | |||
| 192 | if (!displaying) { | ||
| 193 | iota_gfx_flush(); | ||
| 194 | } | ||
| 195 | return 0; | ||
| 196 | } | ||
| 197 | #endif | ||
| 198 | |||
| 199 | bool iota_gfx_init(void) { | ||
| 200 | bool success = false; | ||
| 201 | |||
| 202 | send_cmd1(DisplayOff); | ||
| 203 | send_cmd2(SetDisplayClockDiv, 0x80); | ||
| 204 | send_cmd2(SetMultiPlex, DisplayHeight - 1); | ||
| 205 | |||
| 206 | send_cmd2(SetDisplayOffset, 0); | ||
| 207 | |||
| 208 | |||
| 209 | send_cmd1(SetStartLine | 0x0); | ||
| 210 | send_cmd2(SetChargePump, 0x14 /* Enable */); | ||
| 211 | send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); | ||
| 212 | |||
| 213 | /// Flips the display orientation 0 degrees | ||
| 214 | send_cmd1(SegRemap | 0x1); | ||
| 215 | send_cmd1(ComScanDec); | ||
| 216 | /* | ||
| 217 | // the following Flip the display orientation 180 degrees | ||
| 218 | send_cmd1(SegRemap); | ||
| 219 | send_cmd1(ComScanInc); | ||
| 220 | // end flip */ | ||
| 221 | send_cmd2(SetComPins, 0x2); | ||
| 222 | send_cmd2(SetContrast, 0x8f); | ||
| 223 | send_cmd2(SetPreCharge, 0xf1); | ||
| 224 | send_cmd2(SetVComDetect, 0x40); | ||
| 225 | send_cmd1(DisplayAllOnResume); | ||
| 226 | send_cmd1(NormalDisplay); | ||
| 227 | send_cmd1(DeActivateScroll); | ||
| 228 | send_cmd1(DisplayOn); | ||
| 229 | |||
| 230 | send_cmd2(SetContrast, 0); // Dim | ||
| 231 | |||
| 232 | clear_display(); | ||
| 233 | |||
| 234 | success = true; | ||
| 235 | |||
| 236 | iota_gfx_flush(); | ||
| 237 | |||
| 238 | #if DEBUG_TO_SCREEN | ||
| 239 | print_set_sendchar(capture_sendchar); | ||
| 240 | #endif | ||
| 241 | |||
| 242 | done: | ||
| 243 | return success; | ||
| 244 | } | ||
| 245 | |||
| 246 | bool iota_gfx_off(void) { | ||
| 247 | bool success = false; | ||
| 248 | |||
| 249 | send_cmd1(DisplayOff); | ||
| 250 | success = true; | ||
| 251 | |||
| 252 | done: | ||
| 253 | return success; | ||
| 254 | } | ||
| 255 | |||
| 256 | bool iota_gfx_on(void) { | ||
| 257 | bool success = false; | ||
| 258 | |||
| 259 | send_cmd1(DisplayOn); | ||
| 260 | success = true; | ||
| 261 | |||
| 262 | done: | ||
| 263 | return success; | ||
| 264 | } | ||
| 265 | |||
| 266 | static void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { | ||
| 267 | *matrix->cursor = c; | ||
| 268 | ++matrix->cursor; | ||
| 269 | |||
| 270 | if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { | ||
| 271 | // We went off the end; scroll the display upwards by one line | ||
| 272 | memmove(&matrix->display[0], &matrix->display[1], | ||
| 273 | MatrixCols * (MatrixRows - 1)); | ||
| 274 | matrix->cursor = &matrix->display[MatrixRows - 1][0]; | ||
| 275 | memset(matrix->cursor, ' ', MatrixCols); | ||
| 276 | } | ||
| 277 | } | ||
| 278 | |||
| 279 | static void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { | ||
| 280 | matrix->dirty = true; | ||
| 281 | |||
| 282 | if (c == '\n') { | ||
| 283 | // Clear to end of line from the cursor and then move to the | ||
| 284 | // start of the next line | ||
| 285 | uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; | ||
| 286 | |||
| 287 | while (cursor_col++ < MatrixCols) { | ||
| 288 | matrix_write_char_inner(matrix, ' '); | ||
| 289 | } | ||
| 290 | return; | ||
| 291 | } | ||
| 292 | |||
| 293 | matrix_write_char_inner(matrix, c); | ||
| 294 | } | ||
| 295 | |||
| 296 | void iota_gfx_write_char(uint8_t c) { | ||
| 297 | matrix_write_char(&display, c); | ||
| 298 | } | ||
| 299 | |||
| 300 | static void matrix_write(struct CharacterMatrix *matrix, const char *data) { | ||
| 301 | const char *end = data + strlen(data); | ||
| 302 | while (data < end) { | ||
| 303 | matrix_write_char(matrix, *data); | ||
| 304 | ++data; | ||
| 305 | } | ||
| 306 | } | ||
| 307 | |||
| 308 | void iota_gfx_write(const char *data) { | ||
| 309 | matrix_write(&display, data); | ||
| 310 | } | ||
| 311 | |||
| 312 | static void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { | ||
| 313 | while (true) { | ||
| 314 | uint8_t c = pgm_read_byte(data); | ||
| 315 | if (c == 0) { | ||
| 316 | return; | ||
| 317 | } | ||
| 318 | matrix_write_char(matrix, c); | ||
| 319 | ++data; | ||
| 320 | } | ||
| 321 | } | ||
| 322 | |||
| 323 | void iota_gfx_write_P(const char *data) { | ||
| 324 | matrix_write_P(&display, data); | ||
| 325 | } | ||
| 326 | |||
| 327 | static void matrix_clear(struct CharacterMatrix *matrix) { | ||
| 328 | memset(matrix->display, ' ', sizeof(matrix->display)); | ||
| 329 | matrix->cursor = &matrix->display[0][0]; | ||
| 330 | matrix->dirty = true; | ||
| 331 | } | ||
| 332 | |||
| 333 | void iota_gfx_clear_screen(void) { | ||
| 334 | matrix_clear(&display); | ||
| 335 | } | ||
| 336 | |||
| 337 | static void matrix_render(struct CharacterMatrix *matrix) { | ||
| 338 | last_flush = timer_read(); | ||
| 339 | iota_gfx_on(); | ||
| 340 | #if DEBUG_TO_SCREEN | ||
| 341 | ++displaying; | ||
| 342 | #endif | ||
| 343 | |||
| 344 | // Move to the home position | ||
| 345 | send_cmd3(PageAddr, 0, MatrixRows - 1); | ||
| 346 | send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); | ||
| 347 | |||
| 348 | if (i2c_start_write(i2cAddress)) { | ||
| 349 | goto done; | ||
| 350 | } | ||
| 351 | if (i2c_master_write(0x40)) { | ||
| 352 | // Data mode | ||
| 353 | goto done; | ||
| 354 | } | ||
| 355 | |||
| 356 | for (uint8_t row = 0; row < MatrixRows; ++row) { | ||
| 357 | for (uint8_t col = 0; col < MatrixCols; ++col) { | ||
| 358 | const uint8_t *glyph = font + (matrix->display[row][col] * (FontWidth - 1)); | ||
| 359 | |||
| 360 | for (uint8_t glyphCol = 0; glyphCol < FontWidth - 1; ++glyphCol) { | ||
| 361 | uint8_t colBits = pgm_read_byte(glyph + glyphCol); | ||
| 362 | i2c_master_write(colBits); | ||
| 363 | } | ||
| 364 | |||
| 365 | // 1 column of space between chars (it's not included in the glyph) | ||
| 366 | i2c_master_write(0); | ||
| 367 | } | ||
| 368 | } | ||
| 369 | |||
| 370 | matrix->dirty = false; | ||
| 371 | |||
| 372 | done: | ||
| 373 | i2c_master_stop(); | ||
| 374 | #if DEBUG_TO_SCREEN | ||
| 375 | --displaying; | ||
| 376 | #endif | ||
| 377 | } | ||
| 378 | |||
| 379 | void iota_gfx_flush(void) { | ||
| 380 | matrix_render(&display); | ||
| 381 | } | ||
| 382 | |||
| 383 | static void matrix_update(struct CharacterMatrix *dest, | ||
| 384 | const struct CharacterMatrix *source) { | ||
| 385 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
| 386 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
| 387 | dest->dirty = true; | ||
| 388 | } | ||
| 389 | } | ||
| 390 | |||
| 391 | static void render_status_info(void) { | ||
| 392 | #if DEBUG_TO_SCREEN | ||
| 393 | if (debug_enable) { | ||
| 394 | return; | ||
| 395 | } | ||
| 396 | #endif | ||
| 397 | |||
| 398 | struct CharacterMatrix matrix; | ||
| 399 | |||
| 400 | matrix_clear(&matrix); | ||
| 401 | matrix_write_P(&matrix, PSTR("USB: ")); | ||
| 402 | #ifdef PROTOCOL_LUFA | ||
| 403 | switch (USB_DeviceState) { | ||
| 404 | case DEVICE_STATE_Unattached: | ||
| 405 | matrix_write_P(&matrix, PSTR("Unattached")); | ||
| 406 | break; | ||
| 407 | case DEVICE_STATE_Suspended: | ||
| 408 | matrix_write_P(&matrix, PSTR("Suspended")); | ||
| 409 | break; | ||
| 410 | case DEVICE_STATE_Configured: | ||
| 411 | matrix_write_P(&matrix, PSTR("Connected")); | ||
| 412 | break; | ||
| 413 | case DEVICE_STATE_Powered: | ||
| 414 | matrix_write_P(&matrix, PSTR("Powered")); | ||
| 415 | break; | ||
| 416 | case DEVICE_STATE_Default: | ||
| 417 | matrix_write_P(&matrix, PSTR("Default")); | ||
| 418 | break; | ||
| 419 | case DEVICE_STATE_Addressed: | ||
| 420 | matrix_write_P(&matrix, PSTR("Addressed")); | ||
| 421 | break; | ||
| 422 | default: | ||
| 423 | matrix_write_P(&matrix, PSTR("Invalid")); | ||
| 424 | } | ||
| 425 | #endif | ||
| 426 | |||
| 427 | // 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 | ||
| 428 | |||
| 429 | char buf[40]; | ||
| 430 | snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); | ||
| 431 | matrix_write_P(&matrix, PSTR("\n\nLayer: ")); | ||
| 432 | switch (layer_state) { | ||
| 433 | case _BASE: | ||
| 434 | matrix_write_P(&matrix, PSTR("Default")); | ||
| 435 | break; | ||
| 436 | case _RAISE: | ||
| 437 | matrix_write_P(&matrix, PSTR("Raise")); | ||
| 438 | break; | ||
| 439 | case _LOWER: | ||
| 440 | matrix_write_P(&matrix, PSTR("Lower")); | ||
| 441 | break; | ||
| 442 | case _ADJUST: | ||
| 443 | matrix_write_P(&matrix, PSTR("ADJUST")); | ||
| 444 | break; | ||
| 445 | default: | ||
| 446 | matrix_write(&matrix, buf); | ||
| 447 | } | ||
| 448 | |||
| 449 | // Host Keyboard LED Status | ||
| 450 | char led[40]; | ||
| 451 | snprintf(led, sizeof(led), "\n%s %s %s", | ||
| 452 | (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", | ||
| 453 | (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ", | ||
| 454 | (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); | ||
| 455 | matrix_write(&matrix, led); | ||
| 456 | matrix_update(&display, &matrix); | ||
| 457 | } | ||
| 458 | |||
| 459 | void iota_gfx_task(void) { | ||
| 460 | render_status_info(); | ||
| 461 | |||
| 462 | if (display.dirty) { | ||
| 463 | iota_gfx_flush(); | ||
| 464 | } | ||
| 465 | |||
| 466 | if (timer_elapsed(last_flush) > ScreenOffInterval) { | ||
| 467 | iota_gfx_off(); | ||
| 468 | } | ||
| 469 | } | ||
| 470 | #endif | ||
diff --git a/keyboards/nyquist/ssd1306.h b/keyboards/nyquist/ssd1306.h deleted file mode 100644 index b0c74f987..000000000 --- a/keyboards/nyquist/ssd1306.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #ifndef SSD1306_H | ||
| 2 | #define SSD1306_H | ||
| 3 | |||
| 4 | #include <stdbool.h> | ||
| 5 | #include <stdio.h> | ||
| 6 | |||
| 7 | bool iota_gfx_init(void); | ||
| 8 | void iota_gfx_task(void); | ||
| 9 | bool iota_gfx_off(void); | ||
| 10 | bool iota_gfx_on(void); | ||
| 11 | void iota_gfx_flush(void); | ||
| 12 | void iota_gfx_write_char(uint8_t c); | ||
| 13 | void iota_gfx_write(const char *data); | ||
| 14 | void iota_gfx_write_P(const char *data); | ||
| 15 | void iota_gfx_clear_screen(void); | ||
| 16 | |||
| 17 | #endif | ||
