summaryrefslogtreecommitdiffstats
path: root/keyboards/dc01
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/dc01')
-rw-r--r--keyboards/dc01/arrow/arrow.c16
-rw-r--r--keyboards/dc01/arrow/arrow.h34
-rw-r--r--keyboards/dc01/arrow/config.h79
-rw-r--r--keyboards/dc01/arrow/info.json16
-rw-r--r--keyboards/dc01/arrow/keymaps/default/keymap.c25
-rw-r--r--keyboards/dc01/arrow/keymaps/default/readme.md3
-rw-r--r--keyboards/dc01/arrow/keymaps/via/keymap.c46
-rw-r--r--keyboards/dc01/arrow/keymaps/via/readme.md3
-rwxr-xr-xkeyboards/dc01/arrow/keymaps/via/rules.mk1
-rw-r--r--keyboards/dc01/arrow/matrix.c377
-rw-r--r--keyboards/dc01/arrow/readme.md15
-rw-r--r--keyboards/dc01/arrow/rules.mk21
-rw-r--r--keyboards/dc01/left/config.h114
-rw-r--r--keyboards/dc01/left/info.json19
-rw-r--r--keyboards/dc01/left/keymaps/default/keymap.c25
-rw-r--r--keyboards/dc01/left/keymaps/default/readme.md9
-rw-r--r--keyboards/dc01/left/keymaps/via/keymap.c46
-rw-r--r--keyboards/dc01/left/keymaps/via/readme.md11
-rwxr-xr-xkeyboards/dc01/left/keymaps/via/rules.mk1
-rw-r--r--keyboards/dc01/left/left.c16
-rw-r--r--keyboards/dc01/left/left.h48
-rw-r--r--keyboards/dc01/left/matrix.c433
-rw-r--r--keyboards/dc01/left/readme.md15
-rw-r--r--keyboards/dc01/left/rules.mk21
-rw-r--r--keyboards/dc01/numpad/config.h79
-rw-r--r--keyboards/dc01/numpad/info.json19
-rw-r--r--keyboards/dc01/numpad/keymaps/default/keymap.c32
-rw-r--r--keyboards/dc01/numpad/keymaps/default/readme.md3
-rw-r--r--keyboards/dc01/numpad/keymaps/ortho_5x4/keymap.c48
-rw-r--r--keyboards/dc01/numpad/keymaps/ortho_5x4/readme.md3
-rw-r--r--keyboards/dc01/numpad/keymaps/via/keymap.c46
-rw-r--r--keyboards/dc01/numpad/keymaps/via/readme.md3
-rwxr-xr-xkeyboards/dc01/numpad/keymaps/via/rules.mk1
-rw-r--r--keyboards/dc01/numpad/matrix.c377
-rw-r--r--keyboards/dc01/numpad/numpad.c16
-rw-r--r--keyboards/dc01/numpad/numpad.h48
-rw-r--r--keyboards/dc01/numpad/readme.md15
-rw-r--r--keyboards/dc01/numpad/rules.mk24
-rw-r--r--keyboards/dc01/right/config.h79
-rw-r--r--keyboards/dc01/right/info.json19
-rw-r--r--keyboards/dc01/right/keymaps/default/keymap.c32
-rw-r--r--keyboards/dc01/right/keymaps/default/readme.md3
-rw-r--r--keyboards/dc01/right/keymaps/via/keymap.c46
-rw-r--r--keyboards/dc01/right/keymaps/via/readme.md11
-rwxr-xr-xkeyboards/dc01/right/keymaps/via/rules.mk1
-rw-r--r--keyboards/dc01/right/matrix.c378
-rw-r--r--keyboards/dc01/right/readme.md15
-rw-r--r--keyboards/dc01/right/right.c16
-rw-r--r--keyboards/dc01/right/right.h48
-rw-r--r--keyboards/dc01/right/rules.mk21
50 files changed, 0 insertions, 2777 deletions
diff --git a/keyboards/dc01/arrow/arrow.c b/keyboards/dc01/arrow/arrow.c
deleted file mode 100644
index b3ed4ede76..0000000000
--- a/keyboards/dc01/arrow/arrow.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Copyright 2018 Yiancar
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#include "arrow.h"
diff --git a/keyboards/dc01/arrow/arrow.h b/keyboards/dc01/arrow/arrow.h
deleted file mode 100644
index b293f60b4e..0000000000
--- a/keyboards/dc01/arrow/arrow.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2018 Yiancar
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#pragma once
-
-#include "quantum.h"
-
-#define XXX KC_NO
-
-#define LAYOUT_all( \
- K00, K01, K02, \
- K10, K11, K12, \
- \
- K31, \
- K40, K41, K42 \
-) { \
- { K00, K01, K02 }, \
- { K10, K11, K12 }, \
- { XXX, XXX, XXX }, \
- { XXX, K31, XXX }, \
- { K40, K41, K42 } \
-}
diff --git a/keyboards/dc01/arrow/config.h b/keyboards/dc01/arrow/config.h
deleted file mode 100644
index 1318ec77d7..0000000000
--- a/keyboards/dc01/arrow/config.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-Copyright 2018 Yiancar
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#pragma once
-
-#include "config_common.h"
-
-/* key matrix size */
-#define MATRIX_ROWS 5
-#define MATRIX_COLS 3
-
-/*
- * Keyboard Matrix Assignments
- *
- * Change this to how you wired your keyboard
- * COLS: AVR pins used for columns, left to right
- * ROWS: AVR pins used for rows, top to bottom
- * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
- * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
- *
-*/
-#define MATRIX_ROW_PINS { B0, C7, C6, B6, B4 }
-#define MATRIX_COL_PINS { F0, B7, D2 }
-
-/* COL2ROW, ROW2COL*/
-#define DIODE_DIRECTION COL2ROW
-
-/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
-#define DEBOUNCE 5
-
-/* define if matrix has ghost (lacks anti-ghosting diodes) */
-//#define MATRIX_HAS_GHOST
-
-/* number of backlight levels */
-
-/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
-#define LOCKING_SUPPORT_ENABLE
-/* Locking resynchronize hack */
-#define LOCKING_RESYNC_ENABLE
-
-/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
- * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
- */
-// #define GRAVE_ESC_CTRL_OVERRIDE
-
-/*
- * Force NKRO
- *
- * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
- * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
- * makefile for this to work.)
- *
- * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
- * until the next keyboard reset.
- *
- * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
- * fully operational during normal computer usage.
- *
- * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
- * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
- * bootmagic, NKRO mode will always be enabled until it is toggled again during a
- * power-up.
- *
- */
-//#define FORCE_NKRO
diff --git a/keyboards/dc01/arrow/info.json b/keyboards/dc01/arrow/info.json
deleted file mode 100644
index 007e83d5cf..0000000000
--- a/keyboards/dc01/arrow/info.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "keyboard_name": "DC01 Arrow",
- "manufacturer": "Mechboards",
- "url": "",
- "maintainer": "Yiancar-Designs",
- "usb": {
- "vid": "0x8968",
- "pid": "0x1012",
- "device_version": "0.0.1"
- },
- "layouts": {
- "LAYOUT_all": {
- "layout": [{"label":"Insert", "x":0, "y":0}, {"label":"Home", "x":1, "y":0}, {"label":"PgUp", "x":2, "y":0}, {"label":"Delete", "x":0, "y":1}, {"label":"End", "x":1, "y":1}, {"label":"PgDn", "x":2, "y":1}, {"label":"\u2191", "x":1, "y":3}, {"label":"\u2190", "x":0, "y":4}, {"label":"\u2193", "x":1, "y":4}, {"label":"\u2192", "x":2, "y":4}]
- }
- }
-}
diff --git a/keyboards/dc01/arrow/keymaps/default/keymap.c b/keyboards/dc01/arrow/keymaps/default/keymap.c
deleted file mode 100644
index b7f539e85c..0000000000
--- a/keyboards/dc01/arrow/keymaps/default/keymap.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright 2018 REPLACE_WITH_YOUR_NAME
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#include QMK_KEYBOARD_H
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-[0] = LAYOUT_all( /* Base */
- KC_INS, KC_HOME, KC_PGUP,
- KC_DEL, KC_END, KC_PGDN,
-
- KC_UP,
- KC_LEFT, KC_DOWN, KC_RIGHT)
-};
diff --git a/keyboards/dc01/arrow/keymaps/default/readme.md b/keyboards/dc01/arrow/keymaps/default/readme.md
deleted file mode 100644
index bc2431bc15..0000000000
--- a/keyboards/dc01/arrow/keymaps/default/readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# The default ANSI keymap for DC01 Arrow cluster
-
-When using the arrow module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module. \ No newline at end of file
diff --git a/keyboards/dc01/arrow/keymaps/via/keymap.c b/keyboards/dc01/arrow/keymaps/via/keymap.c
deleted file mode 100644
index a086ffc074..0000000000
--- a/keyboards/dc01/arrow/keymaps/via/keymap.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 2018 Yiancar
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#include QMK_KEYBOARD_H
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-[0] = LAYOUT_all( /* Base */
- KC_INS, KC_HOME, KC_PGUP,
- KC_DEL, KC_END, KC_PGDN,
-
- KC_UP,
- KC_LEFT, KC_DOWN, KC_RIGHT),
-
-[1] = LAYOUT_all( /* Empty for Dynamic keymap */
- KC_TRNS, KC_TRNS, KC_TRNS,
- KC_TRNS, KC_TRNS, KC_TRNS,
-
- KC_TRNS,
- KC_TRNS, KC_TRNS, KC_TRNS),
-
-[2] = LAYOUT_all( /* Empty for Dynamic keymap */
- KC_TRNS, KC_TRNS, KC_TRNS,
- KC_TRNS, KC_TRNS, KC_TRNS,
-
- KC_TRNS,
- KC_TRNS, KC_TRNS, KC_TRNS),
-
-[3] = LAYOUT_all( /* Empty for Dynamic keymap */
- KC_TRNS, KC_TRNS, KC_TRNS,
- KC_TRNS, KC_TRNS, KC_TRNS,
-
- KC_TRNS,
- KC_TRNS, KC_TRNS, KC_TRNS)
-};
diff --git a/keyboards/dc01/arrow/keymaps/via/readme.md b/keyboards/dc01/arrow/keymaps/via/readme.md
deleted file mode 100644
index b2d32d9d27..0000000000
--- a/keyboards/dc01/arrow/keymaps/via/readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# The default VIA keymap for DC01 Arrow cluster
-
-When using the arrow module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
diff --git a/keyboards/dc01/arrow/keymaps/via/rules.mk b/keyboards/dc01/arrow/keymaps/via/rules.mk
deleted file mode 100755
index 1e5b99807c..0000000000
--- a/keyboards/dc01/arrow/keymaps/via/rules.mk
+++ /dev/null
@@ -1 +0,0 @@
-VIA_ENABLE = yes
diff --git a/keyboards/dc01/arrow/matrix.c b/keyboards/dc01/arrow/matrix.c
deleted file mode 100644
index e7c3bec2b5..0000000000
--- a/keyboards/dc01/arrow/matrix.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
-Copyright 2012 Jun Wako
-Copyright 2014 Jack Humbert
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-#include <stdint.h>
-#include <stdbool.h>
-#if defined(__AVR__)
-#include <avr/io.h>
-#include <avr/wdt.h>
-#include <avr/interrupt.h>
-#include <util/delay.h>
-#endif
-#include "wait.h"
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "matrix.h"
-#include "timer.h"
-#include "i2c_slave.h"
-#include "lufa.h"
-
-#define SLAVE_I2C_ADDRESS 0x40
-
-/* Set 0 if debouncing isn't needed */
-
-#ifndef DEBOUNCE
-# define DEBOUNCE 5
-#endif
-
-#if (DEBOUNCE > 0)
- static uint16_t debouncing_time;
- static bool debouncing = false;
-#endif
-
-#if (MATRIX_COLS <= 8)
-# define print_matrix_header() print("\nr/c 01234567\n")
-# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
-# define ROW_SHIFTER ((uint8_t)1)
-#elif (MATRIX_COLS <= 16)
-# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
-# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
-# define ROW_SHIFTER ((uint16_t)1)
-#elif (MATRIX_COLS <= 32)
-# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
-# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
-# define ROW_SHIFTER ((uint32_t)1)
-#endif
-
-#ifdef MATRIX_MASKED
- extern const matrix_row_t matrix_mask[];
-#endif
-
-#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
-static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
-static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
-#endif
-
-/* matrix state(1:on, 0:off) */
-static matrix_row_t matrix[MATRIX_ROWS];
-
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-
-
-#if (DIODE_DIRECTION == COL2ROW)
- static void init_cols(void);
- static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
- static void unselect_rows(void);
- static void select_row(uint8_t row);
- static void unselect_row(uint8_t row);
-#elif (DIODE_DIRECTION == ROW2COL)
- static void init_rows(void);
- static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
- static void unselect_cols(void);
- static void unselect_col(uint8_t col);
- static void select_col(uint8_t col);
-#endif
-
-__attribute__ ((weak))
-void matrix_init_quantum(void) {
- matrix_init_kb();
-}
-
-__attribute__ ((weak))
-void matrix_scan_quantum(void) {
- matrix_scan_kb();
-}
-
-__attribute__ ((weak))
-void matrix_init_kb(void) {
- matrix_init_user();
-}
-
-__attribute__ ((weak))
-void matrix_scan_kb(void) {
- matrix_scan_user();
-}
-
-__attribute__ ((weak))
-void matrix_init_user(void) {
-}
-
-__attribute__ ((weak))
-void matrix_scan_user(void) {
-}
-
-inline
-uint8_t matrix_rows(void) {
- return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void) {
- return MATRIX_COLS;
-}
-
-void matrix_init(void) {
-
- // initialize row and col
-#if (DIODE_DIRECTION == COL2ROW)
- unselect_rows();
- init_cols();
-#elif (DIODE_DIRECTION == ROW2COL)
- unselect_cols();
- init_rows();
-#endif
-
- // initialize matrix state: all keys off
- for (uint8_t i=0; i < MATRIX_ROWS; i++) {
- matrix[i] = 0;
- matrix_debouncing[i] = 0;
- }
-
- matrix_init_quantum();
-}
-
-uint8_t matrix_scan(void)
-{
-#if (DIODE_DIRECTION == COL2ROW)
-
- // Set row, read cols
- for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
-# if (DEBOUNCE > 0)
- bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
-
- if (matrix_changed) {
- debouncing = true;
- debouncing_time = timer_read();
- }
-
-# else
- read_cols_on_row(matrix, current_row);
-# endif
-
- }
-
-#elif (DIODE_DIRECTION == ROW2COL)
-
- // Set col, read rows
- for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
-# if (DEBOUNCE > 0)
- bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col);
- if (matrix_changed) {
- debouncing = true;
- debouncing_time = timer_read();
- }
-# else
- read_rows_on_col(matrix, current_col);
-# endif
-
- }
-
-#endif
-
-# if (DEBOUNCE > 0)
- if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCE)) {
- for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
- matrix[i] = matrix_debouncing[i];
- }
- debouncing = false;
- }
-# endif
-
- i2c_slave_reg[1] = 0x55;
- for (uint8_t i = 0; i < MATRIX_ROWS; i++){
- i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c
- }
-
- matrix_scan_quantum();
- return 1;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
- return (matrix[row] & ((matrix_row_t)1<<col));
-}
-
-inline
-matrix_row_t matrix_get_row(uint8_t row)
-{
- // Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
- // switch blocker installed and the switch is always pressed.
-#ifdef MATRIX_MASKED
- return matrix[row] & matrix_mask[row];
-#else
- return matrix[row];
-#endif
-}
-
-void matrix_print(void)
-{
- print_matrix_header();
-
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- print_hex8(row); print(": ");
- print_matrix_row(row);
- print("\n");
- }
-}
-
-#if (DIODE_DIRECTION == COL2ROW)
-
-static void init_cols(void)
-{
- for(uint8_t x = 0; x < MATRIX_COLS; x++) {
- uint8_t pin = col_pins[x];
- _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
- _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
- }
-}
-
-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 = col_pins[col_index];
- uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
-
- // Populate the matrix row with the state of the col pin
- current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
- }
-
- // Unselect row
- unselect_row(current_row);
-
- return (last_row_value != current_matrix[current_row]);
-}
-
-static void select_row(uint8_t row)
-{
- uint8_t pin = row_pins[row];
- _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
- _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
-}
-
-static void unselect_row(uint8_t row)
-{
- uint8_t pin = row_pins[row];
- _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
- _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
-}
-
-static void unselect_rows(void)
-{
- for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
- uint8_t pin = row_pins[x];
- _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
- _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
- }
-}
-
-#elif (DIODE_DIRECTION == ROW2COL)
-
-static void init_rows(void)
-{
- for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
- uint8_t pin = row_pins[x];
- _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
- _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
- }
-}
-
-static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
-{
- bool matrix_changed = false;
-
- // Select col and wait for col selecton to stabilize
- select_col(current_col);
- wait_us(30);
-
- // For each row...
- for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
- {
-
- // Store last value of row prior to reading
- matrix_row_t last_row_value = current_matrix[row_index];
-
- // Check row pin state
- if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
- {
- // Pin LO, set col bit
- current_matrix[row_index] |= (ROW_SHIFTER << current_col);
- }
- else
- {
- // Pin HI, clear col bit
- current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
- }
-
- // Determine if the matrix changed state
- if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
- {
- matrix_changed = true;
- }
- }
-
- // Unselect col
- unselect_col(current_col);
-
- return matrix_changed;
-}
-
-static void select_col(uint8_t col)
-{
- uint8_t pin = col_pins[col];
- _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
- _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
-}
-
-static void unselect_col(uint8_t col)
-{
- uint8_t pin = col_pins[col];
- _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
- _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
-}
-
-static void unselect_cols(void)
-{
- for(uint8_t x = 0; x < MATRIX_COLS; x++) {
- uint8_t pin = col_pins[x];
- _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
- _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
- }
-}
-
-#endif
-
-//this replases tmk code
-void matrix_setup(void){
- i2c_slave_init(SLAVE_