mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-28 19:58:48 +06:00
[Keyboard] Add mexsistor/ludmila (#10506)
* Add files via upload * Update keyboards/mexsistor/ludmila/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mexsistor/ludmila/ludmila.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update ludmila.h * Update keymap.c Disable unnecessary code * Update rules.mk * Update matrix.c * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keymap.c * Update keymap.c * Update ludmila.h * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/keymaps/default/keymap.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mexsistor/ludmila/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Add files via upload * Add files via upload * Delete config.h * Delete * Update readme.md * Update readme.md * Delete tapdance timing * Delete matrix.c * Create matrix.c * Deleted ludmila, add ludmila_v1 * Update readme.md * add ludmila * delete ludmila_v1, create ludmila * Create matrix.c * Change in matrix.c code and sustitute yes/lite custom_matrix in rules.mk * Update keymap.c * Add description; Change on RGB PIN * Revert "Add description; Change on RGB PIN" This reverts commit cfbe5349259446f49e8885e995d9cac1b77dac01. * config.h and rules.mk update * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/info.json Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mexsistor/ludmila/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: U-MEXSISTOR\Macropads <Kevin M> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
This commit is contained in:
parent
e468380be6
commit
0728a6b753
58
keyboards/mexsistor/ludmila/config.h
Normal file
58
keyboards/mexsistor/ludmila/config.h
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 Kevin M.
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0x69CC
|
||||||
|
#define PRODUCT_ID 0x6BF6
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Kevin M.
|
||||||
|
#define PRODUCT Ludmila Macropad
|
||||||
|
#define DESCRIPTION Ludmila 4 switch + encoder macropad
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 3
|
||||||
|
#define MATRIX_COLS 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 { F0, C7, F7 }
|
||||||
|
#define MATRIX_COL_PINS { F4, F1 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
#define RGB_DI_PIN D1
|
||||||
|
#define RGBLED_NUM 4
|
||||||
|
#define RGBLIGHT_SLEEP
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
|
||||||
|
// Encoder
|
||||||
|
#define ENCODERS_PAD_A { F6 }
|
||||||
|
#define ENCODERS_PAD_B { F5 }
|
19
keyboards/mexsistor/ludmila/info.json
Normal file
19
keyboards/mexsistor/ludmila/info.json
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"keyboard_name": "ludmila",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "Kevin M.",
|
||||||
|
"width": 4,
|
||||||
|
"height": 2,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"label": "SW1", "x": 0, "y": 0},
|
||||||
|
{"label": "SW3", "x": 1, "y": 0},
|
||||||
|
{"label": "Encoder", "x": 3, "y": 0},
|
||||||
|
|
||||||
|
{"label": "SW2", "x": 0, "y": 1},
|
||||||
|
{"label": "SW4", "x": 1, "y": 1}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
41
keyboards/mexsistor/ludmila/keymaps/default/keymap.c
Normal file
41
keyboards/mexsistor/ludmila/keymaps/default/keymap.c
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/* Copyright 2020 Kevin M.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
// Defines names for use in layer keycodes and the keymap
|
||||||
|
enum keyboard_layers{
|
||||||
|
_BASE = 0,
|
||||||
|
_CONTROL
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_BASE] = LAYOUT( /* Base */
|
||||||
|
KC_COPY, KC_PSCREEN, KC_MUTE,
|
||||||
|
KC_PASTE, KC_ENTER
|
||||||
|
|
||||||
|
),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
if (index == 0) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_VOLU);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_VOLD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
keyboards/mexsistor/ludmila/keymaps/default/readme.md
Normal file
1
keyboards/mexsistor/ludmila/keymaps/default/readme.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# The default keymap for ludmila
|
17
keyboards/mexsistor/ludmila/ludmila.c
Normal file
17
keyboards/mexsistor/ludmila/ludmila.c
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
/* Copyright 2020 Kevin M.
|
||||||
|
*
|
||||||
|
* 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 "ludmila.h"
|
36
keyboards/mexsistor/ludmila/ludmila.h
Normal file
36
keyboards/mexsistor/ludmila/ludmila.h
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
/* Copyright 2020 Kevin M.
|
||||||
|
*
|
||||||
|
* 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"
|
||||||
|
|
||||||
|
/* This is a shortcut to help you visually see your layout.
|
||||||
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
#define LAYOUT( \
|
||||||
|
k00, k01, k20, \
|
||||||
|
k10, k11 \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, }, \
|
||||||
|
{ k10, k11, }, \
|
||||||
|
{ k20 } \
|
||||||
|
}
|
121
keyboards/mexsistor/ludmila/matrix.c
Normal file
121
keyboards/mexsistor/ludmila/matrix.c
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
/*
|
||||||
|
Copyright 2012-2018 Jun Wako, Jack Humbert, 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 <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "wait.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
// Encoder things
|
||||||
|
#define ENC_SW F7
|
||||||
|
static bool read_encoder_switches(matrix_row_t current_matrix[], uint8_t current_row);
|
||||||
|
|
||||||
|
static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
|
static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||||
|
|
||||||
|
/* matrix state(1:on, 0:off) */
|
||||||
|
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
|
||||||
|
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
|
||||||
|
|
||||||
|
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_custom(void) {
|
||||||
|
// initialize key pins
|
||||||
|
setPinInput(ENC_SW);
|
||||||
|
init_pins();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool matrix_scan_custom(void) {
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
// Set row, read cols
|
||||||
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
|
changed |= read_cols_on_row(raw_matrix, current_row);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read encoder switches, already debounced
|
||||||
|
changed |= read_encoder_switches(matrix, 2);
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_encoder_switches(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;
|
||||||
|
|
||||||
|
// Debounce the encoder buttons using a shift register
|
||||||
|
static uint8_t btn_1_array;
|
||||||
|
bool btn_1_pressed = 0;
|
||||||
|
btn_1_array <<= 1;
|
||||||
|
btn_1_array |= readPin(ENC_SW);
|
||||||
|
(btn_1_array == 0b11111111) ? (btn_1_pressed = 1) : (btn_1_pressed = 0);
|
||||||
|
|
||||||
|
// Populate the matrix row with the state of the encoder
|
||||||
|
current_matrix[current_row] |= btn_1_pressed ? (1 << 0) : 0;
|
||||||
|
|
||||||
|
return (last_row_value != current_matrix[current_row]);
|
||||||
|
}
|
19
keyboards/mexsistor/ludmila/readme.md
Normal file
19
keyboards/mexsistor/ludmila/readme.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# ludmila
|
||||||
|
|
||||||
|
![ludmila](https://mexsistor.com/wp-content/uploads/2020/09/IMG_2249-scaled.jpg)
|
||||||
|
|
||||||
|
Ludmila v1 is a 4 Key Macropad with one rotary encoder.
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [Kevin M.](https://github.com/mexsistor)
|
||||||
|
* Hardware Supported: Ludmila PCB (atmega32u4)
|
||||||
|
* Hardware Availability: [Kevin M.](https://mexsistor.com/producto/ludmilapad/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make mexsistor/ludmila:default
|
||||||
|
|
||||||
|
Flashing example for this keyboard:
|
||||||
|
|
||||||
|
make mexsistor/ludmila:default:flash
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
25
keyboards/mexsistor/ludmila/rules.mk
Normal file
25
keyboards/mexsistor/ludmila/rules.mk
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
CUSTOM_MATRIX = lite
|
||||||
|
SRC = matrix.c
|
||||||
|
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||||
|
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
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
|
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||||
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
ENCODER_ENABLE = yes
|
Loading…
Reference in New Issue
Block a user