diff options
author | mechlovin <57231893+mechlovin@users.noreply.github.com> | 2021-11-05 05:08:40 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-04 15:08:40 -0700 |
commit | 45b35e6ea13d8c184d9cbd23e4bd3868e66d2933 (patch) | |
tree | a192e8d9b8cfeca6b95db495c6fde7b064bc759c | |
parent | c8da63382c7d2cc0de13559c10b5fde0f436f9e3 (diff) |
[Keyboard] Update Infinity87 rev. 2 (#14820)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r-- | keyboards/mechlovin/infinity87/rev2/config.h | 46 | ||||
-rw-r--r-- | keyboards/mechlovin/infinity87/rev2/info.json | 4 | ||||
-rw-r--r-- | keyboards/mechlovin/infinity87/rev2/matrix.c | 344 | ||||
-rw-r--r-- | keyboards/mechlovin/infinity87/rev2/readme.md | 4 | ||||
-rw-r--r-- | keyboards/mechlovin/infinity87/rev2/rev2.c | 38 | ||||
-rw-r--r-- | keyboards/mechlovin/infinity87/rev2/rules.mk | 11 |
6 files changed, 192 insertions, 255 deletions
diff --git a/keyboards/mechlovin/infinity87/rev2/config.h b/keyboards/mechlovin/infinity87/rev2/config.h index 1be7f0a1bb..ddf9df4593 100644 --- a/keyboards/mechlovin/infinity87/rev2/config.h +++ b/keyboards/mechlovin/infinity87/rev2/config.h @@ -18,7 +18,7 @@ #define PRODUCT_ID 0x8702 #define DEVICE_VER 0x0001 -#define PRODUCT Infinity 87 rev2 +#define PRODUCT Infinity87 rev.2 /* * Keyboard Matrix Assignments @@ -30,19 +30,49 @@ * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * */ -#define MATRIX_ROW_PINS { A3, D5, C3, C2, B3, B4 } +#define MATRIX_ROW_PINS { D5, D2, D4, D3, D0, D1 } #define UNUSED_PINS /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION ROW2COL -#define BACKLIGHT_PIN D4 +#define USB_POLLING_INTERVAL_MS 1 + + +#define LED_NUM_LOCK_PIN D7 +#define LED_CAPS_LOCK_PIN D6 +#define LED_SCROLL_LOCK_PIN B4 +#define LED_PIN_ON_STATE 1 + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_BREATHING -#define LED_NUM_LOCK_PIN B1 -#define LED_CAPS_LOCK_PIN B0 -#define LED_SCROLL_LOCK_PIN B2 -#define LED_PIN_ON_STATE 0 +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN E2 +#define RGBLED_NUM 24 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE +/*== customize breathing effect ==*/ +/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +/*==== use exp() and sin() ====*/ +//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 5
\ No newline at end of file +#define DEBOUNCE 5 diff --git a/keyboards/mechlovin/infinity87/rev2/info.json b/keyboards/mechlovin/infinity87/rev2/info.json index da67c40c39..fa6073912c 100644 --- a/keyboards/mechlovin/infinity87/rev2/info.json +++ b/keyboards/mechlovin/infinity87/rev2/info.json @@ -1,7 +1,7 @@ { - "keyboard_name": "infinity87", + "keyboard_name": "infinity87 Rev.2", "url": "", - "maintainer": "Team Mechlovin'", + "maintainer": "Mechlovin' Studio", "layouts": { "LAYOUT_all": { "layout": [ diff --git a/keyboards/mechlovin/infinity87/rev2/matrix.c b/keyboards/mechlovin/infinity87/rev2/matrix.c index 6f417765aa..b1b0d20654 100644 --- a/keyboards/mechlovin/infinity87/rev2/matrix.c +++ b/keyboards/mechlovin/infinity87/rev2/matrix.c @@ -60,61 +60,12 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) return (last_row_value != current_matrix[current_row]); } -#elif (DIODE_DIRECTION == COL2ROW) - -static void select_row(uint8_t row) { - setPinOutput(row_pins[row]); - writePinLow(row_pins[row]); -} - -static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } - -static void unselect_rows(void) { - for (uint8_t x = 0; x < MATRIX_ROWS; x++) { - setPinInputHigh(row_pins[x]); - } -} - -static void init_pins(void) { - unselect_rows(); - for (uint8_t x = 0; x < MATRIX_COLS; x++) { - setPinInputHigh(col_pins[x]); - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin_state = readPin(col_pins[col_index]); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - #elif (DIODE_DIRECTION == ROW2COL) /* Cols 0 - 16 - * These columns use two 74HC138 3 to 8 bit demultiplexer. D6, D7 is the enable pin, must be set high (1) to use it. + * These columns use two 74HC138 3 to 8 bit demultiplexer. B0, F1 is the enable pin, must be set high (1) to use it. * - * col / pin: PA0 PA1 PA2 PD6 PD7 PC4 + * col / pin: PB5 PB7 PF0 PB0 PF1 PE6 * 0: 0 ── 0 ── 0 1 ── 0 0 * ──────────────────────────────────────────── * 1: 0 ── 0 ── 1 1 ── 0 0 @@ -153,103 +104,103 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) static void select_col(uint8_t col) { switch (col) { case 0: - writePinLow(A0); - writePinLow(A1); - writePinLow(A2); - writePinHigh(D6); + writePinLow(B5); + writePinLow(B7); + writePinLow(F0); + writePinHigh(B0); break; case 1: - writePinLow(A0); - writePinLow(A1); - writePinHigh(A2); - writePinHigh(D6); + writePinLow(B5); + writePinLow(B7); + writePinHigh(F0); + writePinHigh(B0); break; case 2: - writePinLow(A0); - writePinHigh(A1); - writePinLow(A2); - writePinHigh(D6); + writePinLow(B5); + writePinHigh(B7); + writePinLow(F0); + writePinHigh(B0); break; case 3: - writePinLow(A0); - writePinHigh(A1); - writePinHigh(A2); - writePinHigh(D6); + writePinLow(B5); + writePinHigh(B7); + writePinHigh(F0); + writePinHigh(B0); break; case 4: - writePinHigh(A0); - writePinLow(A1); - writePinLow(A2); - writePinHigh(D6); + writePinHigh(B5); + writePinLow(B7); + writePinLow(F0); + writePinHigh(B0); break; case 5: - writePinHigh(A0); - writePinLow(A1); - writePinHigh(A2); - writePinHigh(D6); + writePinHigh(B5); + writePinLow(B7); + writePinHigh(F0); + writePinHigh(B0); break; case 6: - writePinHigh(A0); - writePinHigh(A1); - writePinLow(A2); - writePinHigh(D6); + writePinHigh(B5); + writePinHigh(B7); + writePinLow(F0); + writePinHigh(B0); break; case 7: - writePinHigh(A0); - writePinHigh(A1); - writePinHigh(A2); - writePinHigh(D6); + writePinHigh(B5); + writePinHigh(B7); + writePinHigh(F0); + writePinHigh(B0); break; case 8: - writePinLow(A0); - writePinLow(A1); - writePinLow(A2); - writePinHigh(D7); + writePinLow(B5); + writePinLow(B7); + writePinLow(F0); + writePinHigh(F1); break; case 9: - writePinLow(A0); - writePinLow(A1); - writePinHigh(A2); - writePinHigh(D7); + writePinLow(B5); + writePinLow(B7); + writePinHigh(F0); + writePinHigh(F1); break; case 10: - writePinLow(A0); - writePinHigh(A1); - writePinLow(A2); - writePinHigh(D7); + writePinLow(B5); + writePinHigh(B7); + writePinLow(F0); + writePinHigh(F1); break; case 11: - writePinLow(A0); - writePinHigh(A1); - writePinHigh(A2); - writePinHigh(D7); + writePinLow(B5); + writePinHigh(B7); + writePinHigh(F0); + writePinHigh(F1); break; case 12: - writePinHigh(A0); - writePinLow(A1); - writePinLow(A2); - writePinHigh(D7); + writePinHigh(B5); + writePinLow(B7); + writePinLow(F0); + writePinHigh(F1); break; case 13: - writePinHigh(A0); - writePinLow(A1); - writePinHigh(A2); - writePinHigh(D7); + writePinHigh(B5); + writePinLow(B7); + writePinHigh(F0); + writePinHigh(F1); break; case 14: - writePinHigh(A0); - writePinHigh(A1); - writePinHigh(A2); - writePinHigh(D7); + writePinHigh(B5); + writePinHigh(B7); + writePinHigh(F0); + writePinHigh(F1); break; case 15: - writePinHigh(A0); - writePinHigh(A1); - writePinLow(A2); - writePinHigh(D7); + writePinHigh(B5); + writePinHigh(B7); + writePinLow(F0); + writePinHigh(F1); break; case 16: - writePinLow(C4); + writePinLow(E6); break; } } @@ -257,117 +208,117 @@ static void select_col(uint8_t col) { static void unselect_col(uint8_t col) { switch (col) { case 0: - writePinHigh(A0); - writePinHigh(A1); - writePinHigh(A2); - writePinLow(D6); + writePinHigh(B5); + writePinHigh(B7); + writePinHigh(F0); + writePinLow(B0); break; case 1: - writePinHigh(A0); - writePinHigh(A1); - writePinLow(A2); - writePinLow(D6); + writePinHigh(B5); + writePinHigh(B7); + writePinLow(F0); + writePinLow(B0); break; case 2: - writePinHigh(A0); - writePinLow(A1); - writePinHigh(A2); - writePinLow(D6); + writePinHigh(B5); + writePinLow(B7); + writePinHigh(F0); + writePinLow(B0); break; case 3: - writePinHigh(A0); - writePinLow(A1); - writePinLow(A2); - writePinLow(D6); + writePinHigh(B5); + writePinLow(B7); + writePinLow(F0); + writePinLow(B0); break; case 4: - writePinLow(A0); - writePinHigh(A1); - writePinHigh(A2); - writePinLow(D6); + writePinLow(B5); + writePinHigh(B7); + writePinHigh(F0); + writePinLow(B0); break; case 5: - writePinLow(A0); - writePinHigh(A1); - writePinLow(A2); - writePinLow(D6); + writePinLow(B5); + writePinHigh(B7); + writePinLow(F0); + writePinLow(B0); break; case 6: - writePinLow(A0); - writePinLow(A1); - writePinHigh(A2); - writePinLow(D6); + writePinLow(B5); + writePinLow(B7); + writePinHigh(F0); + writePinLow(B0); break; case 7: - writePinLow(A0); - writePinLow(A1); - writePinLow(A2); - writePinLow(D6); + writePinLow(B5); + writePinLow(B7); + writePinLow(F0); + writePinLow(B0); break; case 8: - writePinHigh(A0); - writePinHigh(A1); - writePinHigh(A2); - writePinLow(D7); + writePinHigh(B5); + writePinHigh(B7); + writePinHigh(F0); + writePinLow(F1); break; case 9: - writePinHigh(A0); - writePinHigh(A1); - writePinLow(A2); - writePinLow(D7); + writePinHigh(B5); + writePinHigh(B7); + writePinLow(F0); + writePinLow(F1); break; case 10: - writePinHigh(A0); - writePinLow(A1); - writePinHigh(A2); - writePinLow(D7); + writePinHigh(B5); + writePinLow(B7); + writePinHigh(F0); + writePinLow(F1); break; case 11: - writePinHigh(A0); - writePinLow(A1); - writePinLow(A2); - writePinLow(D7); + writePinHigh(B5); + writePinLow(B7); + writePinLow(F0); + writePinLow(F1); break; case 12: - writePinLow(A0); - writePinHigh(A1); - writePinHigh(A2); - writePinLow(D7); + writePinLow(B5); + writePinHigh(B7); + writePinHigh(F0); + writePinLow(F1); break; case 13: - writePinLow(A0); - writePinHigh(A1); - writePinLow(A2); - writePinLow(D7); + writePinLow(B5); + writePinHigh(B7); + writePinLow(F0); + writePinLow(F1); break; case 14: - writePinLow(A0); - writePinLow(A1); - writePinLow(A2); - writePinLow(D7); + writePinLow(B5); + writePinLow(B7); + writePinLow(F0); + writePinLow(F1); break; case 15: - writePinLow(A0); - writePinLow(A1); - writePinHigh(A2); - writePinLow(D7); + writePinLow(B5); + writePinLow(B7); + writePinHigh(F0); + writePinLow(F1); break; case 16: - writePinHigh(C4); + writePinHigh(E6); break; } } static void unselect_cols(void) { //Native - writePinHigh(C4); + writePinHigh(E6); //Demultiplexer - writePinLow(D6); - writePinLow(D7); - writePinHigh(A0); - writePinHigh(A1); - writePinHigh(A2); + writePinLow(B0); + writePinLow(F1); + writePinHigh(B5); + writePinHigh(B7); + writePinHigh(F0); } static void init_pins(void) { @@ -375,12 +326,12 @@ static void init_pins(void) { for (uint8_t x = 0; x < MATRIX_ROWS; x++) { setPinInputHigh(row_pins[x]); } - setPinOutput(A0); - setPinOutput(A1); - setPinOutput(A2); - setPinOutput(D6); - setPinOutput(D7); - setPinOutput(C4); + setPinOutput(B5); + setPinOutput(B7); + setPinOutput(F0); + setPinOutput(B0); + setPinOutput(F1); + setPinOutput(E6); } static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { @@ -426,12 +377,7 @@ void matrix_init_custom(void) { bool matrix_scan_custom(matrix_row_t current_matrix[]) { bool changed = false; -#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { - changed |= read_cols_on_row(current_matrix, current_row); - } -#elif (DIODE_DIRECTION == ROW2COL) +#if defined(DIRECT_PINS) || (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { changed |= read_rows_on_col(current_matrix, current_col); diff --git a/keyboards/mechlovin/infinity87/rev2/readme.md b/keyboards/mechlovin/infinity87/rev2/readme.md index 4c7ea29291..a5be85f0bb 100644 --- a/keyboards/mechlovin/infinity87/rev2/readme.md +++ b/keyboards/mechlovin/infinity87/rev2/readme.md @@ -2,8 +2,7 @@ ![infinity87](https://i.imgur.com/pgtvUTrl.png) -A replacement PCB for TKL keyboard. south-facing stabilisers, .STEP file in our github - +A PCB for TKL keyboards. * Keyboard Maintainer: [Team Mechlovin'](https://github.com/mechlovin) * Hardware Supported: Infinity87 rev.2, AVR. * Hardware Availability: [Mechlovin.studio](https://mechlovin.studio) @@ -20,4 +19,3 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to **Reset Key:** To put the IF87_rev2 into bootloader, push reset swith on the bottom of the PCB. -IF87_rev2 used USBasploader from [Erovia tutorial](https://erovia.github.io/posts/thk/#bootloader), thank you [Erovia](https://github.com/Erovia). diff --git a/keyboards/mechlovin/infinity87/rev2/rev2.c b/keyboards/mechlovin/infinity87/rev2/rev2.c index dfaa27d036..ab9ecbf6fc 100644 --- a/keyboards/mechlovin/infinity87/rev2/rev2.c +++ b/keyboards/mechlovin/infinity87/rev2/rev2.c @@ -14,40 +14,4 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "rev2.h" - -void led_init_ports(void) { - setPinOutput(A5); - setPinOutput(A6); - setPinOutput(A7); - setPinOutput(C7); - setPinOutput(C6); - -} - -layer_state_t layer_state_set_kb(layer_state_t state) { - state = layer_state_set_user(state); - writePinHigh(C6); - writePinHigh(C7); - writePinHigh(A7); - writePinHigh(A6); - writePinHigh(A5); - switch (get_highest_layer(state)) { - case 0: - writePinLow(C6); - break; - case 1: - writePinLow(C7); - break; - case 2: - writePinLow(A7); - break; - case 3: - writePinLow(A6); - break; - case 4: - writePinLow(A5); - break; - } - return state; -} +#include "rev2.h"
\ No newline at end of file diff --git a/keyboards/mechlovin/infinity87/rev2/rules.mk b/keyboards/mechlovin/infinity87/rev2/rules.mk index 3b15413362..f30ef9c493 100644 --- a/keyboards/mechlovin/infinity87/rev2/rules.mk +++ b/keyboards/mechlovin/infinity87/rev2/rules.mk @@ -1,19 +1,18 @@ # MCU name -MCU = atmega32a - -# Processor frequency -F_CPU = 16000000 +MCU = atmega32u4 # Bootloader selection -BOOTLOADER = usbasploader +BOOTLOADER = atmel-dfu + # Build Options # change yes to no to disable # CONSOLE_ENABLE = no COMMAND_ENABLE = no -NKRO_ENABLE = no +NKRO_ENABLE = yes BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes CUSTOM_MATRIX = lite SRC += matrix.c |