diff options
| -rw-r--r-- | keyboards/bpiphany/frosty_flake/20130602/20130602.c (renamed from keyboards/bpiphany/frosty_flake/frosty_flake.c) | 0 | ||||
| -rw-r--r-- | keyboards/bpiphany/frosty_flake/20130602/matrix.c | 86 | ||||
| -rw-r--r-- | keyboards/bpiphany/frosty_flake/20130602/rules.mk | 22 | ||||
| -rw-r--r-- | keyboards/bpiphany/frosty_flake/20140521/20140521.c | 24 | ||||
| -rw-r--r-- | keyboards/bpiphany/frosty_flake/20140521/matrix.c (renamed from keyboards/bpiphany/frosty_flake/matrix.c) | 1 | ||||
| -rw-r--r-- | keyboards/bpiphany/frosty_flake/20140521/rules.mk | 22 | ||||
| -rw-r--r-- | keyboards/bpiphany/frosty_flake/readme.md | 8 | ||||
| -rw-r--r-- | keyboards/bpiphany/frosty_flake/rules.mk | 23 |
8 files changed, 162 insertions, 24 deletions
diff --git a/keyboards/bpiphany/frosty_flake/frosty_flake.c b/keyboards/bpiphany/frosty_flake/20130602/20130602.c index be4e1a312..be4e1a312 100644 --- a/keyboards/bpiphany/frosty_flake/frosty_flake.c +++ b/keyboards/bpiphany/frosty_flake/20130602/20130602.c | |||
diff --git a/keyboards/bpiphany/frosty_flake/20130602/matrix.c b/keyboards/bpiphany/frosty_flake/20130602/matrix.c new file mode 100644 index 000000000..e0337f9ec --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/20130602/matrix.c | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2017 Gabriel Young <gabeplaysdrums@live.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 | #include <util/delay.h> | ||
| 19 | #include "matrix.h" | ||
| 20 | |||
| 21 | |||
| 22 | static matrix_row_t scan_col(void) { | ||
| 23 | // Each of the 8 columns is read off pins as below | ||
| 24 | // 7 6 5 4 3 2 1 0 | ||
| 25 | // ,--,--,--,--,--,--,--,--, | ||
| 26 | // |B0|B3|B2|B1|B6|B4|B5|C7| | ||
| 27 | // `--`--`--`--`--`--`--`--` | ||
| 28 | return ( | ||
| 29 | (PINC&(1<<2) ? 0 : ((matrix_row_t)1<<0)) | | ||
| 30 | (PIND&(1<<0) ? 0 : ((matrix_row_t)1<<1)) | | ||
| 31 | (PIND&(1<<1) ? 0 : ((matrix_row_t)1<<2)) | | ||
| 32 | (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<3)) | | ||
| 33 | (PIND&(1<<5) ? 0 : ((matrix_row_t)1<<4)) | | ||
| 34 | (PIND&(1<<4) ? 0 : ((matrix_row_t)1<<5)) | | ||
| 35 | (PIND&(1<<2) ? 0 : ((matrix_row_t)1<<6)) | | ||
| 36 | (PIND&(1<<6) ? 0 : ((matrix_row_t)1<<7)) | ||
| 37 | ); | ||
| 38 | } | ||
| 39 | |||
| 40 | static void select_row(uint8_t row) { | ||
| 41 | switch (row) { | ||
| 42 | case 0: PORTB = (PORTB & ~0b01111110) | 0b00111010; break; | ||
| 43 | case 1: PORTB = (PORTB & ~0b01111110) | 0b01011000; break; | ||
| 44 | case 2: PORTB = (PORTB & ~0b01111110) | 0b01110000; break; | ||
| 45 | case 3: PORTB = (PORTB & ~0b01111110) | 0b01101110; break; | ||
| 46 | case 4: PORTB = (PORTB & ~0b01111110) | 0b01101100; break; | ||
| 47 | case 5: PORTB = (PORTB & ~0b01111110) | 0b01101010; break; | ||
| 48 | case 6: PORTB = (PORTB & ~0b01111110) | 0b01101000; break; | ||
| 49 | case 7: PORTB = (PORTB & ~0b01111110) | 0b01100100; break; | ||
| 50 | case 8: PORTB = (PORTB & ~0b01111110) | 0b01100000; break; | ||
| 51 | case 9: PORTB = (PORTB & ~0b01111110) | 0b01100010; break; | ||
| 52 | case 10: PORTB = (PORTB & ~0b01111110) | 0b00011010; break; | ||
| 53 | case 11: PORTB = (PORTB & ~0b01111110) | 0b00011000; break; | ||
| 54 | case 12: PORTB = (PORTB & ~0b01111110) | 0b00111100; break; | ||
| 55 | case 13: PORTB = (PORTB & ~0b01111110) | 0b01100110; break; | ||
| 56 | case 14: PORTB = (PORTB & ~0b01111110) | 0b00111000; break; | ||
| 57 | case 15: PORTB = (PORTB & ~0b01111110) | 0b01110010; break; | ||
| 58 | case 16: PORTB = (PORTB & ~0b01111110) | 0b00011110; break; | ||
| 59 | case 17: PORTB = (PORTB & ~0b01111110) | 0b00111110; break; | ||
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 63 | void matrix_init_custom(void) { | ||
| 64 | /* Column output pins */ | ||
| 65 | DDRB |= 0b01111110; | ||
| 66 | /* Row input pins */ | ||
| 67 | DDRC &= ~0b10000100; | ||
| 68 | DDRD &= ~0b01110111; | ||
| 69 | PORTC |= 0b10000100; | ||
| 70 | PORTD |= 0b01110111; | ||
| 71 | } | ||
| 72 | |||
| 73 | // matrix is 18 uint8_t. | ||
| 74 | // we select the row (one of 18), then read the column | ||
| 75 | bool matrix_scan_custom(matrix_row_t current_matrix[]) { | ||
| 76 | bool has_changed = false; | ||
| 77 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
| 78 | matrix_row_t orig = current_matrix[row]; | ||
| 79 | select_row(row); | ||
| 80 | _delay_us(3); | ||
| 81 | current_matrix[row] = scan_col(); | ||
| 82 | has_changed |= (orig != current_matrix[row]); | ||
| 83 | } | ||
| 84 | |||
| 85 | return has_changed; | ||
| 86 | } | ||
diff --git a/keyboards/bpiphany/frosty_flake/20130602/rules.mk b/keyboards/bpiphany/frosty_flake/20130602/rules.mk new file mode 100644 index 000000000..dc435a332 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/20130602/rules.mk | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u2 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = atmel-dfu | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | # change yes to no to disable | ||
| 9 | # | ||
| 10 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | ||
| 11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 13 | CONSOLE_ENABLE = no # Console for debug | ||
| 14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 15 | NKRO_ENABLE = no # Enable N-Key Rollover | ||
| 16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 17 | AUDIO_ENABLE = no # Audio output | ||
| 18 | |||
| 19 | CUSTOM_MATRIX = lite | ||
| 20 | SRC += 20130602/matrix.c | ||
| 21 | |||
| 22 | LAYOUTS = tkl_ansi | ||
diff --git a/keyboards/bpiphany/frosty_flake/20140521/20140521.c b/keyboards/bpiphany/frosty_flake/20140521/20140521.c new file mode 100644 index 000000000..cd425cffa --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/20140521/20140521.c | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #include "frosty_flake.h" | ||
| 2 | |||
| 3 | void keyboard_pre_init_kb() { | ||
| 4 | setPinOutput(B7); // num lock | ||
| 5 | writePinHigh(B7); | ||
| 6 | setPinOutput(C5); // caps lock | ||
| 7 | writePinHigh(C7); | ||
| 8 | setPinOutput(C6); // scroll lock | ||
| 9 | writePinHigh(C6); | ||
| 10 | |||
| 11 | keyboard_pre_init_user(); | ||
| 12 | } | ||
| 13 | |||
| 14 | bool led_update_kb(led_t usb_led) { | ||
| 15 | // user requests no further processing | ||
| 16 | if (!led_update_user(usb_led)) | ||
| 17 | return true; | ||
| 18 | |||
| 19 | writePin(B7, !usb_led.caps_lock); | ||
| 20 | writePin(C5, !usb_led.num_lock); | ||
| 21 | writePin(C6, !usb_led.scroll_lock); | ||
| 22 | |||
| 23 | return true; | ||
| 24 | } | ||
diff --git a/keyboards/bpiphany/frosty_flake/matrix.c b/keyboards/bpiphany/frosty_flake/20140521/matrix.c index 4517c7af5..24c7617b1 100644 --- a/keyboards/bpiphany/frosty_flake/matrix.c +++ b/keyboards/bpiphany/frosty_flake/20140521/matrix.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <util/delay.h> | 18 | #include <util/delay.h> |
| 19 | #include "matrix.h" | 19 | #include "matrix.h" |
| 20 | 20 | ||
| 21 | |||
| 21 | static matrix_row_t scan_col(void) { | 22 | static matrix_row_t scan_col(void) { |
| 22 | // Each of the 8 columns is read off pins as below | 23 | // Each of the 8 columns is read off pins as below |
| 23 | // 7 6 5 4 3 2 1 0 | 24 | // 7 6 5 4 3 2 1 0 |
diff --git a/keyboards/bpiphany/frosty_flake/20140521/rules.mk b/keyboards/bpiphany/frosty_flake/20140521/rules.mk new file mode 100644 index 000000000..035e59f91 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/20140521/rules.mk | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u2 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = atmel-dfu | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | # change yes to no to disable | ||
| 9 | # | ||
| 10 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | ||
| 11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 13 | CONSOLE_ENABLE = no # Console for debug | ||
| 14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 15 | NKRO_ENABLE = no # Enable N-Key Rollover | ||
| 16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 17 | AUDIO_ENABLE = no # Audio output | ||
| 18 | |||
| 19 | CUSTOM_MATRIX = lite | ||
| 20 | SRC += 20140521/matrix.c | ||
| 21 | |||
| 22 | LAYOUTS = tkl_ansi | ||
diff --git a/keyboards/bpiphany/frosty_flake/readme.md b/keyboards/bpiphany/frosty_flake/readme.md index 5917022a8..7c6408518 100644 --- a/keyboards/bpiphany/frosty_flake/readme.md +++ b/keyboards/bpiphany/frosty_flake/readme.md | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # Frosty Flake Controller | 1 | # Frosty Flake Controller |
| 2 | 2 | ||
| 3 | This is the firmware for Rev. 20140521 of the Frosty Flake controller | 3 | This is the firmware for the Frosty Flake controller by |
| 4 | by [Bathroom Epiphanies](http://bathroomepiphanies.com/controllers/), | 4 | [Bathroom Epiphanies](http://bathroomepiphanies.com/controllers/), |
| 5 | a replacement controller for the [Cooler Master Quick Fire | 5 | a replacement controller for the [Cooler Master Quick Fire |
| 6 | Rapid](http://www.coolermaster.com/peripheral/keyboards/quickfirerapid/). | 6 | Rapid](http://www.coolermaster.com/peripheral/keyboards/quickfirerapid/). |
| 7 | 7 | ||
| @@ -11,6 +11,10 @@ but has been cleaned up to match the | |||
| 11 | [schematic](https://deskthority.net/wiki/File:Frosty_Flake_Schematics.pdf) | 11 | [schematic](https://deskthority.net/wiki/File:Frosty_Flake_Schematics.pdf) |
| 12 | and gone through some minor refactoring for QMK. | 12 | and gone through some minor refactoring for QMK. |
| 13 | 13 | ||
| 14 | ## Revision support | ||
| 15 | There are two revisions of this controller. 20140521 is built by default. | ||
| 16 | If you need to build for 20130602, it can be built with `make bpiphany/frosty_flake/20130602` | ||
| 17 | |||
| 14 | ## 104 and 87 layout support | 18 | ## 104 and 87 layout support |
| 15 | 19 | ||
| 16 | Support for both 104 key and 87 key layouts is provided. See the | 20 | Support for both 104 key and 87 key layouts is provided. See the |
diff --git a/keyboards/bpiphany/frosty_flake/rules.mk b/keyboards/bpiphany/frosty_flake/rules.mk index 38e02ec18..e5402b32f 100644 --- a/keyboards/bpiphany/frosty_flake/rules.mk +++ b/keyboards/bpiphany/frosty_flake/rules.mk | |||
| @@ -1,22 +1 @@ | |||
| 1 | # MCU name | DEFAULT_FOLDER=bpiphany/frosty_flake/20140521 | |
| 2 | MCU = atmega32u2 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = atmel-dfu | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | # change yes to no to disable | ||
| 9 | # | ||
| 10 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | ||
| 11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 13 | CONSOLE_ENABLE = no # Console for debug | ||
| 14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 15 | NKRO_ENABLE = no # Enable N-Key Rollover | ||
| 16 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 17 | AUDIO_ENABLE = no # Audio output | ||
| 18 | |||
| 19 | CUSTOM_MATRIX = lite | ||
| 20 | SRC += matrix.c | ||
| 21 | |||
| 22 | LAYOUTS = tkl_ansi | ||
