You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.8 KiB

  1. /*
  2. Copyright 2019 Adam Newbold <adam@neatnik.net>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #pragma once
  15. #include "config_common.h"
  16. /* USB Device descriptor parameter */
  17. #define VENDOR_ID 0xFEED
  18. #define PRODUCT_ID 0x0000
  19. #define DEVICE_VER 0x0001
  20. #define MANUFACTURER Apple Inc.
  21. #define PRODUCT Numeric Keypad IIe
  22. #define DESCRIPTION "Numeric Keypad IIe, A2M2003"
  23. /*
  24. Pin Mappings
  25. ============
  26. Dsub-15 Connection
  27. ------------------
  28. Dsub-15 (female)
  29. ,-------------------------.
  30. \ 08 07 06 05 04 03 02 01 /
  31. \ 15 14 13 12 11 10 09 /
  32. `---------------------'
  33. Header Pins
  34. -----------
  35. _____________________________________
  36. | |
  37. | 11 10 9 8 7 6 5 4 3 2 1 |
  38. |_____________________________________|
  39. Header / Matrix
  40. ---------------
  41. Pin Name Description
  42. --------------------------------------------------------------
  43. 1,2,5,3,4,6 Y0-Y5 Y-direction key-matrix connections
  44. 7 NC
  45. 9,11,10,8 X4-X7 X-direction key-matrix connections
  46. Microcontroller Configuration
  47. -----------------------------
  48. (Pins are for an Arduino Micro)
  49. +-----------------------------------+
  50. | Dsub-15 | Header | Matrix | Micro |
  51. |---------+--------+--------+-------|
  52. | 12 | 11 | X5 | B0 |
  53. | 11 | 10 | X6 | D3 |
  54. | 10 | 9 | X4 | B2 |
  55. | 9 | 8 | X7 | D2 |
  56. | NC | 7 | NC | -- |
  57. | 7 | 6 | Y5 | E6 |
  58. | 6 | 5 | Y2 | D4 |
  59. | 5 | 4 | Y4 | D7 |
  60. | 3 | 3 | Y3 | C6 |
  61. | 2 | 2 | Y1 | D0 |
  62. | 1 | 1 | Y0 | D1 |
  63. +-----------------------------------+
  64. Note: Dsub-15 pins 4, 8, 13, 14, and 15 are unused
  65. Reference
  66. ---------
  67. https://deskthority.net/wiki/Apple_Numeric_Keypad_IIe
  68. https://geekhack.org/index.php?topic=78048.0
  69. http://wiki.apple2.org/index.php?title=Pinouts#Apple_.2F.2Fe_Numeric_Keypad_connector
  70. */
  71. #define MATRIX_ROWS 4
  72. #define MATRIX_COLS 6
  73. #define MATRIX_ROW_PINS { B0, B2, D2, D3 }
  74. #define MATRIX_COL_PINS { D1, D0, D4, C6, D7, E6 }
  75. #define UNUSED_PINS
  76. #define DIODE_DIRECTION COL2ROW
  77. #define SOFT_SERIAL_PIN D0
  78. #define DEBOUNCE 5