Browse Source

Moved files to common, protocol and doc directory

tmk 13 years ago
parent
commit
f412570739
98 changed files with 0 additions and 210 deletions
  1. 0 27
      LICENSE.txt
  2. 0 0
      common/bootloader.c
  3. 0 0
      common/bootloader.h
  4. 0 0
      common/command.c
  5. 0 0
      common/command.h
  6. 0 0
      common/controller_teensy.h
  7. 0 0
      common/debug.h
  8. 0 0
      common/host.c
  9. 0 0
      common/host.h
  10. 0 0
      common/host_driver.h
  11. 0 0
      common/keyboard.c
  12. 0 0
      common/keyboard.h
  13. 0 0
      common/keymap.h
  14. 0 0
      common/layer.c
  15. 0 0
      common/layer.h
  16. 0 0
      common/led.h
  17. 0 0
      common/matrix.h
  18. 0 0
      common/mousekey.c
  19. 0 0
      common/mousekey.h
  20. 0 0
      common/print.c
  21. 0 0
      common/print.h
  22. 0 0
      common/report.h
  23. 0 0
      common/sendchar.h
  24. 0 0
      common/sendchar_null.c
  25. 0 0
      common/sendchar_uart.c
  26. 0 0
      common/timer.c
  27. 0 0
      common/timer.h
  28. 0 0
      common/uart.c
  29. 0 0
      common/uart.h
  30. 0 0
      common/usb_keycodes.h
  31. 0 0
      common/util.c
  32. 0 0
      common/util.h
  33. 0 0
      doc/COPYING.GPLv2
  34. 0 0
      doc/COPYING.GPLv3
  35. 0 0
      doc/FUSE.txt
  36. 0 0
      doc/POWER.txt
  37. 0 0
      doc/USB_NKRO.txt
  38. 0 183
      pjrc/host.c
  39. 0 0
      protocol/adb.c
  40. 0 0
      protocol/adb.h
  41. 0 0
      protocol/iwrap.mk
  42. 0 0
      protocol/iwrap/iWRAP.txt
  43. 0 0
      protocol/iwrap/iwrap.c
  44. 0 0
      protocol/iwrap/iwrap.h
  45. 0 0
      protocol/iwrap/main.c
  46. 0 0
      protocol/iwrap/suart.S
  47. 0 0
      protocol/iwrap/suart.h
  48. 0 0
      protocol/iwrap/wd.h
  49. 0 0
      protocol/m0110.c
  50. 0 0
      protocol/m0110.h
  51. 0 0
      protocol/pjrc.mk
  52. 0 0
      protocol/pjrc/bootloader_teensy.c
  53. 0 0
      protocol/pjrc/main.c
  54. 0 0
      protocol/pjrc/pjrc.c
  55. 0 0
      protocol/pjrc/pjrc.h
  56. 0 0
      protocol/pjrc/usb.c
  57. 0 0
      protocol/pjrc/usb.h
  58. 0 0
      protocol/pjrc/usb_debug.c
  59. 0 0
      protocol/pjrc/usb_debug.h
  60. 0 0
      protocol/pjrc/usb_extra.c
  61. 0 0
      protocol/pjrc/usb_extra.h
  62. 0 0
      protocol/pjrc/usb_keyboard.c
  63. 0 0
      protocol/pjrc/usb_keyboard.h
  64. 0 0
      protocol/pjrc/usb_mouse.c
  65. 0 0
      protocol/pjrc/usb_mouse.h
  66. 0 0
      protocol/ps2.c
  67. 0 0
      protocol/ps2.h
  68. 0 0
      protocol/ps2_mouse.c
  69. 0 0
      protocol/ps2_mouse.h
  70. 0 0
      protocol/ps2_usart.c
  71. 0 0
      protocol/vusb.mk
  72. 0 0
      protocol/vusb/bootloader_usbasp.c
  73. 0 0
      protocol/vusb/main.c
  74. 0 0
      protocol/vusb/sendchar_usart.c
  75. 0 0
      protocol/vusb/usbdrv/Changelog.txt
  76. 0 0
      protocol/vusb/usbdrv/CommercialLicense.txt
  77. 0 0
      protocol/vusb/usbdrv/License.txt
  78. 0 0
      protocol/vusb/usbdrv/Readme.txt
  79. 0 0
      protocol/vusb/usbdrv/USB-ID-FAQ.txt
  80. 0 0
      protocol/vusb/usbdrv/USB-IDs-for-free.txt
  81. 0 0
      protocol/vusb/usbdrv/asmcommon.inc
  82. 0 0
      protocol/vusb/usbdrv/oddebug.c
  83. 0 0
      protocol/vusb/usbdrv/oddebug.h
  84. 0 0
      protocol/vusb/usbdrv/usbconfig-prototype.h
  85. 0 0
      protocol/vusb/usbdrv/usbdrv.c
  86. 0 0
      protocol/vusb/usbdrv/usbdrv.h
  87. 0 0
      protocol/vusb/usbdrv/usbdrvasm.S
  88. 0 0
      protocol/vusb/usbdrv/usbdrvasm.asm
  89. 0 0
      protocol/vusb/usbdrv/usbdrvasm12.inc
  90. 0 0
      protocol/vusb/usbdrv/usbdrvasm128.inc
  91. 0 0
      protocol/vusb/usbdrv/usbdrvasm15.inc
  92. 0 0
      protocol/vusb/usbdrv/usbdrvasm16.inc
  93. 0 0
      protocol/vusb/usbdrv/usbdrvasm165.inc
  94. 0 0
      protocol/vusb/usbdrv/usbdrvasm18-crc.inc
  95. 0 0
      protocol/vusb/usbdrv/usbdrvasm20.inc
  96. 0 0
      protocol/vusb/usbdrv/usbportability.h
  97. 0 0
      protocol/vusb/vusb.c
  98. 0 0
      protocol/vusb/vusb.h

+ 0 - 27
LICENSE.txt

@@ -1,27 +0,0 @@
-Codes are released under each license. See heading of each file for details.
-
-Modified BSD license:
-    ps2.c
-    ps2.h
-    adb.c
-    adb.h
-
-GPLv2 or later:
-    other codes
-
-PJRC's license:
-    print.c
-    print.h
-    pjrc/
-
-GPLv2 or GPLv3 or OBJECTIVE DEVELOPMENT's commercial license:
-    vusb/
-
-
-
-
-This software includes following codes from other parties.
-    - V-USB from OBJECTIVE DEVELOPMENT
-        http://www.obdev.at/products/vusb/index.html
-    - Teensy example codes from PJRC
-        http://www.pjrc.com/teensy/

+ 0 - 0
bootloader.c → common/bootloader.c


+ 0 - 0
bootloader.h → common/bootloader.h


+ 0 - 0
command.c → common/command.c


+ 0 - 0
command.h → common/command.h


+ 0 - 0
controller_teensy.h → common/controller_teensy.h


+ 0 - 0
debug.h → common/debug.h


+ 0 - 0
host.c → common/host.c


+ 0 - 0
host.h → common/host.h


+ 0 - 0
host_driver.h → common/host_driver.h


+ 0 - 0
keyboard.c → common/keyboard.c


+ 0 - 0
keyboard.h → common/keyboard.h


+ 0 - 0
keymap.h → common/keymap.h


+ 0 - 0
layer.c → common/layer.c


+ 0 - 0
layer.h → common/layer.h


+ 0 - 0
led.h → common/led.h


+ 0 - 0
matrix.h → common/matrix.h


+ 0 - 0
mousekey.c → common/mousekey.c


+ 0 - 0
mousekey.h → common/mousekey.h


+ 0 - 0
print.c → common/print.c


+ 0 - 0
print.h → common/print.h


+ 0 - 0
report.h → common/report.h


+ 0 - 0
sendchar.h → common/sendchar.h


+ 0 - 0
sendchar_null.c → common/sendchar_null.c


+ 0 - 0
sendchar_uart.c → common/sendchar_uart.c


+ 0 - 0
timer.c → common/timer.c


+ 0 - 0
timer.h → common/timer.h


+ 0 - 0
uart.c → common/uart.c


+ 0 - 0
uart.h → common/uart.h


+ 0 - 0
usb_keycodes.h → common/usb_keycodes.h


+ 0 - 0
util.c → common/util.c


+ 0 - 0
util.h → common/util.h


+ 0 - 0
COPYING.GPLv2 → doc/COPYING.GPLv2


+ 0 - 0
COPYING.GPLv3 → doc/COPYING.GPLv3


+ 0 - 0
hhkb/FUSE.txt → doc/FUSE.txt


+ 0 - 0
POWER.txt → doc/POWER.txt


+ 0 - 0
USB_NKRO.txt → doc/USB_NKRO.txt


+ 0 - 183
pjrc/host.c

@@ -1,183 +0,0 @@
-/*
-Copyright 2011 Jun Wako <wakojun@gmail.com>
-
-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 <avr/interrupt.h>
-#include "usb_keycodes.h"
-#include "usb_keyboard.h"
-#if defined(MOUSEKEY_ENABLE) || defined(PS2_MOUSE_ENABLE)
-#include "usb_mouse.h"
-#endif
-#ifdef EXTRAKEY_ENABLE
-#include "usb_extra.h"
-#endif
-#include "debug.h"
-#include "host.h"
-#include "util.h"
-
-
-#ifdef NKRO_ENABLE
-bool keyboard_nkro = false;
-#endif
-
-static report_keyboard_t report0;
-static report_keyboard_t report1;
-report_keyboard_t *keyboard_report = &report0;
-report_keyboard_t *keyboard_report_prev = &report1;
-
-static inline void add_key_byte(uint8_t code);
-static inline void add_key_bit(uint8_t code);
-
-
-uint8_t host_keyboard_leds(void)
-{
-    return usb_keyboard_leds;
-}
-
-/* keyboard report operations */
-void host_add_key(uint8_t key)
-{
-#ifdef NKRO_ENABLE
-    if (keyboard_nkro) {
-        add_key_bit(key);
-        return;
-    }
-#endif
-    add_key_byte(key);
-}
-
-void host_add_mod_bit(uint8_t mod)
-{
-    keyboard_report->mods |= mod;
-}
-
-void host_set_mods(uint8_t mods)
-{
-    keyboard_report->mods = mods;
-}
-
-void host_add_code(uint8_t code)
-{
-    if (IS_MOD(code)) {
-        host_add_mod_bit(MOD_BIT(code));
-    } else {
-        host_add_key(code);
-    }
-}
-
-void host_swap_keyboard_report(void)
-{
-    uint8_t sreg = SREG;
-    cli();
-    report_keyboard_t *tmp = keyboard_report_prev;
-    keyboard_report_prev = keyboard_report;
-    keyboard_report = tmp;
-    SREG = sreg;
-}
-
-void host_clear_keyboard_report(void)
-{
-    keyboard_report->mods = 0;
-    for (int8_t i = 0; i < REPORT_KEYS; i++) {
-        keyboard_report->keys[i] = 0;
-    }
-}
-
-uint8_t host_has_anykey(void)
-{
-    uint8_t cnt = 0;
-    for (int i = 0; i < REPORT_KEYS; i++) {
-        if (keyboard_report->keys[i])
-            cnt++;
-    }
-    return cnt;
-}
-
-uint8_t host_get_first_key(void)
-{
-#ifdef NKRO_ENABLE
-    if (keyboard_nkro) {
-        uint8_t i = 0;
-        for (; i < REPORT_KEYS && !keyboard_report->keys[i]; i++)
-            ;
-        return i<<3 | biton(keyboard_report->keys[i]);
-    }
-#endif
-    return keyboard_report->keys[0];
-}
-
-
-void host_send_keyboard_report(void)
-{
-    usb_keyboard_send_report(keyboard_report);
-}
-
-#if defined(MOUSEKEY_ENABLE) || defined(PS2_MOUSE_ENABLE)
-void host_mouse_send(report_mouse_t *report)
-{
-    usb_mouse_send(report->x, report->y, report->v, report->h, report->buttons);
-}
-#endif
-
-#ifdef EXTRAKEY_ENABLE
-void host_system_send(uint16_t data)
-{
-    usb_extra_system_send(data);
-}
-
-void host_consumer_send(uint16_t data)
-{
-    static uint16_t last_data = 0;
-    if (data == last_data) return;
-    last_data = data;
-
-    usb_extra_consumer_send(data);
-}
-#endif
-
-
-static inline void add_key_byte(uint8_t code)
-{
-    // TODO: fix ugly code
-    int8_t i = 0;
-    int8_t empty = -1;
-    for (; i < REPORT_KEYS; i++) {
-        if (keyboard_report_prev->keys[i] == code) {
-            keyboard_report->keys[i] = code;
-            break;
-        }
-        if (empty == -1 &&
-                keyboard_report_prev->keys[i] == 0 &&
-                keyboard_report->keys[i] == 0) {
-            empty = i;
-        }
-    }
-    if (i == REPORT_KEYS) {
-        if (empty != -1) {
-            keyboard_report->keys[empty] = code;
-        }
-    }
-}
-
-static inline void add_key_bit(uint8_t code)
-{
-    if ((code>>3) < REPORT_KEYS) {
-        keyboard_report->keys[code>>3] |= 1<<(code&7);
-    } else {
-        debug("add_key_bit: can't add: "); phex(code); debug("\n");
-    }
-}

+ 0 - 0
adb.c → protocol/adb.c


+ 0 - 0
adb.h → protocol/adb.h


+ 0 - 0
iwrap.mk → protocol/iwrap.mk


+ 0 - 0
iwrap/iWRAP.txt → protocol/iwrap/iWRAP.txt


+ 0 - 0
iwrap/iwrap.c → protocol/iwrap/iwrap.c


+ 0 - 0
iwrap/iwrap.h → protocol/iwrap/iwrap.h


+ 0 - 0
iwrap/main.c → protocol/iwrap/main.c


+ 0 - 0
iwrap/suart.S → protocol/iwrap/suart.S


+ 0 - 0
iwrap/suart.h → protocol/iwrap/suart.h


+ 0 - 0
iwrap/wd.h → protocol/iwrap/wd.h


+ 0 - 0
m0110.c → protocol/m0110.c


+ 0 - 0
m0110.h → protocol/m0110.h


+ 0 - 0
pjrc.mk → protocol/pjrc.mk


+ 0 - 0
pjrc/bootloader_teensy.c → protocol/pjrc/bootloader_teensy.c


+ 0 - 0
pjrc/main.c → protocol/pjrc/main.c


+ 0 - 0
pjrc/pjrc.c → protocol/pjrc/pjrc.c


+ 0 - 0
pjrc/pjrc.h → protocol/pjrc/pjrc.h


+ 0 - 0
pjrc/usb.c → protocol/pjrc/usb.c


+ 0 - 0
pjrc/usb.h → protocol/pjrc/usb.h


+ 0 - 0
pjrc/usb_debug.c → protocol/pjrc/usb_debug.c


+ 0 - 0
pjrc/usb_debug.h → protocol/pjrc/usb_debug.h


+ 0 - 0
pjrc/usb_extra.c → protocol/pjrc/usb_extra.c


+ 0 - 0
pjrc/usb_extra.h → protocol/pjrc/usb_extra.h


+ 0 - 0
pjrc/usb_keyboard.c → protocol/pjrc/usb_keyboard.c


+ 0 - 0
pjrc/usb_keyboard.h → protocol/pjrc/usb_keyboard.h


+ 0 - 0
pjrc/usb_mouse.c → protocol/pjrc/usb_mouse.c


+ 0 - 0
pjrc/usb_mouse.h → protocol/pjrc/usb_mouse.h


+ 0 - 0
ps2.c → protocol/ps2.c


+ 0 - 0
ps2.h → protocol/ps2.h


+ 0 - 0
ps2_mouse.c → protocol/ps2_mouse.c


+ 0 - 0
ps2_mouse.h → protocol/ps2_mouse.h


+ 0 - 0
ps2_usart.c → protocol/ps2_usart.c


+ 0 - 0
vusb.mk → protocol/vusb.mk


+ 0 - 0
vusb/bootloader_usbasp.c → protocol/vusb/bootloader_usbasp.c


+ 0 - 0
vusb/main.c → protocol/vusb/main.c


+ 0 - 0
vusb/sendchar_usart.c → protocol/vusb/sendchar_usart.c


+ 0 - 0
vusb/usbdrv/Changelog.txt → protocol/vusb/usbdrv/Changelog.txt


+ 0 - 0
vusb/usbdrv/CommercialLicense.txt → protocol/vusb/usbdrv/CommercialLicense.txt


+ 0 - 0
vusb/usbdrv/License.txt → protocol/vusb/usbdrv/License.txt


+ 0 - 0
vusb/usbdrv/Readme.txt → protocol/vusb/usbdrv/Readme.txt


+ 0 - 0
vusb/usbdrv/USB-ID-FAQ.txt → protocol/vusb/usbdrv/USB-ID-FAQ.txt


+ 0 - 0
vusb/usbdrv/USB-IDs-for-free.txt → protocol/vusb/usbdrv/USB-IDs-for-free.txt


+ 0 - 0
vusb/usbdrv/asmcommon.inc → protocol/vusb/usbdrv/asmcommon.inc


+ 0 - 0
vusb/usbdrv/oddebug.c → protocol/vusb/usbdrv/oddebug.c


+ 0 - 0
vusb/usbdrv/oddebug.h → protocol/vusb/usbdrv/oddebug.h


+ 0 - 0
vusb/usbdrv/usbconfig-prototype.h → protocol/vusb/usbdrv/usbconfig-prototype.h


+ 0 - 0
vusb/usbdrv/usbdrv.c → protocol/vusb/usbdrv/usbdrv.c


+ 0 - 0
vusb/usbdrv/usbdrv.h → protocol/vusb/usbdrv/usbdrv.h


+ 0 - 0
vusb/usbdrv/usbdrvasm.S → protocol/vusb/usbdrv/usbdrvasm.S


+ 0 - 0
vusb/usbdrv/usbdrvasm.asm → protocol/vusb/usbdrv/usbdrvasm.asm


+ 0 - 0
vusb/usbdrv/usbdrvasm12.inc → protocol/vusb/usbdrv/usbdrvasm12.inc


+ 0 - 0
vusb/usbdrv/usbdrvasm128.inc → protocol/vusb/usbdrv/usbdrvasm128.inc


+ 0 - 0
vusb/usbdrv/usbdrvasm15.inc → protocol/vusb/usbdrv/usbdrvasm15.inc


+ 0 - 0
vusb/usbdrv/usbdrvasm16.inc → protocol/vusb/usbdrv/usbdrvasm16.inc


+ 0 - 0
vusb/usbdrv/usbdrvasm165.inc → protocol/vusb/usbdrv/usbdrvasm165.inc


+ 0 - 0
vusb/usbdrv/usbdrvasm18-crc.inc → protocol/vusb/usbdrv/usbdrvasm18-crc.inc


+ 0 - 0
vusb/usbdrv/usbdrvasm20.inc → protocol/vusb/usbdrv/usbdrvasm20.inc


+ 0 - 0
vusb/usbdrv/usbportability.h → protocol/vusb/usbdrv/usbportability.h


+ 0 - 0
vusb/vusb.c → protocol/vusb/vusb.c


+ 0 - 0
vusb/vusb.h → protocol/vusb/vusb.h