diff options
Diffstat (limited to 'keyboards/kbdmania')
-rw-r--r-- | keyboards/kbdmania/kmac/keyboard.json (renamed from keyboards/kbdmania/kmac/info.json) | 8 | ||||
-rw-r--r-- | keyboards/kbdmania/kmac/kmac.c | 30 | ||||
-rw-r--r-- | keyboards/kbdmania/kmac/matrix.c | 27 | ||||
-rw-r--r-- | keyboards/kbdmania/kmac/rules.mk | 11 | ||||
-rw-r--r-- | keyboards/kbdmania/kmac_pad/keyboard.json (renamed from keyboards/kbdmania/kmac_pad/info.json) | 6 | ||||
-rw-r--r-- | keyboards/kbdmania/kmac_pad/kmac_pad.c | 4 | ||||
-rw-r--r-- | keyboards/kbdmania/kmac_pad/matrix.c | 13 | ||||
-rw-r--r-- | keyboards/kbdmania/kmac_pad/rules.mk | 12 |
8 files changed, 49 insertions, 62 deletions
diff --git a/keyboards/kbdmania/kmac/info.json b/keyboards/kbdmania/kmac/keyboard.json index 0ec6f0b2a9..c372cb1fc8 100644 --- a/keyboards/kbdmania/kmac/info.json +++ b/keyboards/kbdmania/kmac/keyboard.json @@ -17,6 +17,14 @@ }, "processor": "atmega32u4", "bootloader": "atmel-dfu", + "features": { + "bootmagic": true, + "mousekey": true, + "extrakey": true, + "command": true, + "nkro": true, + "backlight": true + }, "community_layouts": ["tkl_ansi"], "layouts": { "LAYOUT_tkl_ansi": { diff --git a/keyboards/kbdmania/kmac/kmac.c b/keyboards/kbdmania/kmac/kmac.c index 29f7091084..c3f06349d8 100644 --- a/keyboards/kbdmania/kmac/kmac.c +++ b/keyboards/kbdmania/kmac/kmac.c @@ -19,11 +19,11 @@ #define WASD_MASK 0b10 void backlight_init_ports(void) { - setPinOutput(B1); - setPinOutput(B2); - setPinOutput(B3); - setPinOutput(B4); - setPinOutput(D7); + gpio_set_pin_output(B1); + gpio_set_pin_output(B2); + gpio_set_pin_output(B3); + gpio_set_pin_output(B4); + gpio_set_pin_output(D7); } /* Backlight pin configuration @@ -36,21 +36,21 @@ void backlight_init_ports(void) { void backlight_set(uint8_t level) { // F-row if (level & F_ROW_MASK) { - writePinHigh(B1); + gpio_write_pin_high(B1); } else { - writePinLow(B1); + gpio_write_pin_low(B1); } // WASD if (level & WASD_MASK) { - writePinLow(B2); - writePinLow(B3); - writePinLow(B4); - writePinLow(D7); + gpio_write_pin_low(B2); + gpio_write_pin_low(B3); + gpio_write_pin_low(B4); + gpio_write_pin_low(D7); } else { - writePinHigh(B2); - writePinHigh(B3); - writePinHigh(B4); - writePinHigh(D7); + gpio_write_pin_high(B2); + gpio_write_pin_high(B3); + gpio_write_pin_high(B4); + gpio_write_pin_high(D7); } } diff --git a/keyboards/kbdmania/kmac/matrix.c b/keyboards/kbdmania/kmac/matrix.c index 6569867032..ea149c49ad 100644 --- a/keyboards/kbdmania/kmac/matrix.c +++ b/keyboards/kbdmania/kmac/matrix.c @@ -14,15 +14,12 @@ 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> #include "wait.h" #include "print.h" #include "debug.h" #include "util.h" #include "matrix.h" #include "debounce.h" -#include "quantum.h" #if (MATRIX_COLS <= 8) # define print_matrix_header() print("\nr/c 01234567\n") @@ -97,8 +94,8 @@ void matrix_print(void) { */ static void unselect_cols(void) { for (uint8_t x = 0; x < 6; x++) { - setPinOutput(col_pins[x]); - writePinLow(col_pins[x]); + gpio_set_pin_output(col_pins[x]); + gpio_write_pin_low(col_pins[x]); } } @@ -106,13 +103,13 @@ static void select_col(uint8_t col) { if (col < 16) { uint8_t c = col + 8; - writePin(B6, c & 0b10000); - writePin(C6, c & 0b01000); - writePin(C7, c & 0b00100); - writePin(F1, c & 0b00010); - writePin(F0, c & 0b00001); + gpio_write_pin(B6, c & 0b10000); + gpio_write_pin(C6, c & 0b01000); + gpio_write_pin(C7, c & 0b00100); + gpio_write_pin(F1, c & 0b00010); + gpio_write_pin(F0, c & 0b00001); } else { - writePinHigh(B5); + gpio_write_pin_high(B5); } } @@ -125,10 +122,10 @@ static void select_col(uint8_t col) { static void init_pins(void) { unselect_cols(); for (uint8_t x = 0; x < MATRIX_ROWS; x++) { - setPinInputHigh(row_pins[x]); + gpio_set_pin_input_high(row_pins[x]); } - setPinInputHigh(E2); + gpio_set_pin_input_high(E2); } static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { @@ -146,7 +143,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) // Check row pin state // Use the otherwise unused row: 3, col: 0 for caps lock if (row_index == 3 && current_col == 0) { - if (readPin(E2) == 0) { + if (gpio_read_pin(E2) == 0) { // Pin LO, set col bit current_matrix[row_index] |= (ROW_SHIFTER << current_col); } else { @@ -154,7 +151,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); } } else { - if (readPin(row_pins[row_index]) == 0) { + if (gpio_read_pin(row_pins[row_index]) == 0) { // Pin HI, clear col bit current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); } else { diff --git a/keyboards/kbdmania/kmac/rules.mk b/keyboards/kbdmania/kmac/rules.mk index d9aa87a7dc..b35b955f69 100644 --- a/keyboards/kbdmania/kmac/rules.mk +++ b/keyboards/kbdmania/kmac/rules.mk @@ -1,18 +1,7 @@ # Processor frequency F_CPU = 8000000 -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration CUSTOM_MATRIX = yes # Custom matrix file -NKRO_ENABLE = yes # Enable N-Key Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -AUDIO_ENABLE = no # Audio output # Project specific files SRC += matrix.c diff --git a/keyboards/kbdmania/kmac_pad/info.json b/keyboards/kbdmania/kmac_pad/keyboard.json index f41da8a452..8dbb196f3e 100644 --- a/keyboards/kbdmania/kmac_pad/info.json +++ b/keyboards/kbdmania/kmac_pad/keyboard.json @@ -9,6 +9,12 @@ }, "processor": "atmega32u4", "bootloader": "atmel-dfu", + "features": { + "bootmagic": true, + "mousekey": true, + "extrakey": true, + "nkro": true + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/kbdmania/kmac_pad/kmac_pad.c b/keyboards/kbdmania/kmac_pad/kmac_pad.c index 3de2cb711e..064502710f 100644 --- a/keyboards/kbdmania/kmac_pad/kmac_pad.c +++ b/keyboards/kbdmania/kmac_pad/kmac_pad.c @@ -23,7 +23,7 @@ void keyboard_pre_init_kb(void) { * FN Pin PB3 * PAD Pin PB1 */ - setPinOutput(B3); - setPinOutput(B1); + gpio_set_pin_output(B3); + gpio_set_pin_output(B1); keyboard_pre_init_user(); } diff --git a/keyboards/kbdmania/kmac_pad/matrix.c b/keyboards/kbdmania/kmac_pad/matrix.c index 476e40f514..1fe0502311 100644 --- a/keyboards/kbdmania/kmac_pad/matrix.c +++ b/keyboards/kbdmania/kmac_pad/matrix.c @@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "wait.h" #include "matrix.h" -#include "quantum.h" static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; @@ -31,13 +30,13 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; */ static void unselect_cols(void) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { - setPinOutput(col_pins[col]); - writePinLow(col_pins[col]); + gpio_set_pin_output(col_pins[col]); + gpio_write_pin_low(col_pins[col]); } } static void select_col(uint8_t col) { - writePinHigh(col_pins[col]); + gpio_write_pin_high(col_pins[col]); } static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { @@ -51,7 +50,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) if (current_col == 0) { matrix_row_t last_row_value = current_matrix[0]; - if (readPin(row_pins[0]) == 0) { + if (gpio_read_pin(row_pins[0]) == 0) { // Pin LO, set col bit current_matrix[0] |= (1 << current_col); } else { @@ -69,7 +68,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) for (uint8_t row_index = 1; row_index < MATRIX_ROWS; row_index++) { matrix_row_t last_row_value = current_matrix[row_index]; - if (readPin(row_pins[row_index]) == 0) { + if (gpio_read_pin(row_pins[row_index]) == 0) { // Pin HI, clear col bit current_matrix[row_index] &= ~(1 << current_col); } else { @@ -96,7 +95,7 @@ void matrix_init_custom(void) { // initialize key pins for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) { - setPinInputHigh(row_pins[row_index]); + gpio_set_pin_input_high(row_pins[row_index]); } } diff --git a/keyboards/kbdmania/kmac_pad/rules.mk b/keyboards/kbdmania/kmac_pad/rules.mk index 1c42620aca..2ec2337384 100644 --- a/keyboards/kbdmania/kmac_pad/rules.mk +++ b/keyboards/kbdmania/kmac_pad/rules.mk @@ -1,18 +1,6 @@ # Processor frequency F_CPU = 8000000 -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output CUSTOM_MATRIX = lite # Custom matrix file # Project specific files |