Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Numeric Keypad //e converter #5294

Merged
merged 6 commits into from
Mar 3, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
Copyright 2019 Adam Newbold <[email protected]>

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 0xFEED
#define PRODUCT_ID 0x0000
#define DEVICE_VER 0x0001
#define MANUFACTURER Apple Inc.
#define PRODUCT Numeric Keypad IIe
#define DESCRIPTION "Numeric Keypad IIe, A2M2003"

/*

Pin Mappings
============

Dsub-15 Connection
------------------

Dsub-15 (female)
,-------------------------.
\ 08 07 06 05 04 03 02 01 /
\ 15 14 13 12 11 10 09 /
`---------------------'

Header Pins
-----------
_____________________________________
| |
| 11 10 9 8 7 6 5 4 3 2 1 |
|_____________________________________|


Header / Matrix
---------------

Pin Name Description
--------------------------------------------------------------
1,2,5,3,4,6 Y0-Y5 Y-direction key-matrix connections
7 NC
9,11,10,8 X4-X7 X-direction key-matrix connections


Microcontroller Configuration
-----------------------------

(Pins are for an Arduino Micro)

+-----------------------------------+
| Dsub-15 | Header | Matrix | Micro |
|---------+--------+--------+-------|
| 12 | 11 | X5 | B0 |
| 11 | 10 | X6 | D3 |
| 10 | 9 | X4 | B2 |
| 9 | 8 | X7 | D2 |
| NC | 7 | NC | -- |
| 7 | 6 | Y5 | E6 |
| 6 | 5 | Y2 | D4 |
| 5 | 4 | Y4 | D7 |
| 3 | 3 | Y3 | C6 |
| 2 | 2 | Y1 | D0 |
| 1 | 1 | Y0 | D1 |
+-----------------------------------+

Note: Dsub-15 pins 4, 8, 13, 14, and 15 are unused

Reference
---------

https://deskthority.net/wiki/Apple_Numeric_Keypad_IIe
https://geekhack.org/index.php?topic=78048.0
http://wiki.apple2.org/index.php?title=Pinouts#Apple_.2F.2Fe_Numeric_Keypad_connector

*/

#define MATRIX_ROWS 4
#define MATRIX_COLS 6
#define MATRIX_ROW_PINS { B0, B2, D2, D3 }
#define MATRIX_COL_PINS { D1, D0, D4, C6, D7, E6 }
#define UNUSED_PINS
#define DIODE_DIRECTION COL2ROW
#define SOFT_SERIAL_PIN D0
#define DEBOUNCING_DELAY 5
12 changes: 12 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"keyboard_name": "Numeric Keypad IIe",
"url": "",
"maintainer": "qmk",
"width": 7.5,
"height": 4,
"layouts": {
"LAYOUT": {
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"7", "x":2, "y":0}, {"label":"8", "x":3, "y":0}, {"label":"9", "x":4, "y":0}, {"label":"(", "x":5.5, "y":0}, {"label":")", "x":6.5, "y":0}, {"label":"\u2190", "x":0, "y":1}, {"label":"4", "x":2, "y":1}, {"label":"5", "x":3, "y":1}, {"label":"5", "x":4, "y":1}, {"label":"\u2212", "x":5.5, "y":1}, {"label":"\u00f7", "x":6.5, "y":1}, {"label":"\u2192", "x":0, "y":2}, {"label":"1", "x":2, "y":2}, {"label":"2", "x":3, "y":2}, {"label":"3", "x":4, "y":2}, {"label":"+", "x":5.5, "y":2}, {"label":"\u00d7", "x":6.5, "y":2}, {"label":"Space", "x":0, "y":3}, {"label":"0", "x":1.5, "y":3, "w":1.5}, {"label":",", "x":3, "y":3}, {"label":".", "x":4, "y":3}, {"label":"Ret", "x":5.5, "y":3}, {"label":"Print", "x":6.5, "y":3}]
}
}
}
19 changes: 19 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2019 Adam Newbold <[email protected]>
*
* 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

// place overrides here
62 changes: 62 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* Copyright 2019 Adam Newbold <[email protected]>
*
* 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 the keycodes used by our macros in process_record_user
enum custom_keycodes {
QMKBEST = SAFE_RANGE,
QMKURL
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
+-------+ +-------+-------+-------+ +-------+-------+
| Esc | | 7 | 8 | 9 | | ( | ) |
+-------+ +-------+-------+-------+ +-------+-------+
| <-- | | 4 | 5 | 6 | | - | / |
+-------+ +-------+-------+-------+ +-------+-------+
| --> | | 1 | 2 | 3 | | + | * |
+-------+ +--+-------+-------+-------+ +-------+-------+
| Space | | 0 | , | . | | Ret | Print |
+-------+ +----------+-------+-------+ +-------+-------+
*/
[0] = LAYOUT(
KC_ESCAPE, KC_KP_7, KC_KP_8, KC_KP_9, KC_LEFT_PAREN, KC_RIGHT_PAREN, \
KC_LEFT, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_KP_SLASH, \
KC_RIGHT, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_KP_ASTERISK, \
KC_SPACE, KC_KP_0, KC_KP_COMMA, KC_KP_DOT, KC_RETURN, KC_QUESTION \
),
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void keyboard_post_init_user(void) {

}

void matrix_init_user(void) {

}

void matrix_scan_user(void) {

}

void led_set_user(uint8_t usb_led) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Numeric Keypad //e Default Keymap

All keys perform their default functions displayed on the stock keycaps. Note that the "Print" key presses a question mark (?), which was the default behavior on the Apple //e (with ? the shorthand for the AppleSoft BASIC PRINT command).
19 changes: 19 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/keymaps/newbold/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2019 Adam Newbold <[email protected]>
*
* 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

// place overrides here
68 changes: 68 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/keymaps/newbold/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* Copyright 2019 Adam Newbold <[email protected]>
*
* 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 the keycodes used by our macros in process_record_user
enum custom_keycodes {
QMKBEST = SAFE_RANGE,
QMKURL
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
+-------+ +-------+-------+-------+ +-------+-------+
| Esc | | 7 | 8 | 9 | | ( | ) |
+-------+ +-------+-------+-------+ +-------+-------+
| <-- | | 4 | 5 | 6 | | - | / |
+-------+ +-------+-------+-------+ +-------+-------+
| --> | | 1 | 2 | 3 | | + | * |
+-------+ +--+-------+-------+-------+ +-------+-------+
| Space | | 0 | , | . | | Ret | Print |
+-------+ +----------+-------+-------+ +-------+-------+
*/
[0] = LAYOUT(
KC__MUTE, KC_KP_7, KC_KP_8, KC_KP_9, KC_LEFT_PAREN, KC_RIGHT_PAREN, \
KC__VOLDOWN, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_KP_SLASH, \
KC__VOLUP, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_KP_ASTERISK, \
MO(1), KC_KP_0, KC_KP_COMMA, KC_KP_DOT, KC_RETURN, KC_QUESTION \
),
[1] = LAYOUT(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_BRMD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_BRMU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET \
),
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void keyboard_post_init_user(void) {

}

void matrix_init_user(void) {

}

void matrix_scan_user(void) {

}

void led_set_user(uint8_t usb_led) {

}
28 changes: 28 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/keymaps/newbold/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# @newbold's layout for the Numeric Keypad IIe

Includes the standard layout for all keys except for the left-most column, which is remapped to these keys:

+-----------------+
| Mute |
+-----------------+
| Volume Down |
+-----------------+
| Volume Up |
+-----------------+
| Function |
+-----------------+

With Function held down:

+-----------------+
| Mute |
+-----------------+
| Brightness Down |
+-----------------+
| Brightness Up |
+-----------------+
| Function |
+-----------------+

And also with Function held down, "Print" (the lower right key) will trigger RESET (putting the controller into bootloader mode so it can be flashed).

43 changes: 43 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/numeric_keypad_IIe.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Copyright 2019 Adam Newbold <[email protected]>
*
* 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 "numeric_keypad_IIe.h"

void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up

matrix_init_user();
}

void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)

matrix_scan_user();
}

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware

return process_record_user(keycode, record);
}

void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

led_set_user(usb_led);
}
30 changes: 30 additions & 0 deletions keyboards/converter/numeric_keypad_IIe/numeric_keypad_IIe.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Copyright Adam Newbold <[email protected]>
*
* 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 LAYOUT( \
K_ESC, K_7, K_8, K_9, K_LEFT_PARENS, K_RIGHT_PARENS, \
K_LEFT, K_4, K_5, K_6, K_MINUS, K_DIVIDE, \
K_RIGHT, K_1, K_2, K_3, K_PLUS, K_MULTIPLY, \
K_SPACE, K_0, K_COMMA, K_DOT, K_RETURN, K_PRINT \
){ \
{ K_RIGHT_PARENS, K_ESC, K_4, K_5, K_6, K_7 },\
{ K_DIVIDE, K_LEFT, K_0, K_1, K_2, K_3 },\
{ K_PRINT, K_SPACE, K_LEFT_PARENS, K_MINUS, K_RETURN, K_COMMA },\
{ K_MULTIPLY, K_RIGHT, K_8, K_9, K_DOT, K_PLUS },\
}
Loading