Kiibohd Controller
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. The Kiibohd Controller
  2. ----------------------
  3. TODO, write some insightful/informative :P
  4. Please give authors credit for modules used if you use in a distributed product :D
  5. ----------------------
  6. Dependencies
  7. ----------------------
  8. Below listed are the Arch Linux pacman names, AUR packages may be required.
  9. These depend a bit on which targets you are trying to build, but the general one:
  10. - cmake (2.8 and higher)
  11. - Teensy Loader (http://pjrc.com/teensy/loader.html)
  12. AVR Specific (Teensy 1.0/++,2.0/++) (try to use something recent, suggested versions below)
  13. - avr-gcc (4.8.0)
  14. - avr-binutils (2.23.2)
  15. - avr-libc (1.8.0)
  16. ARM Specific (Teensy 3.0/3.1) (Sourcery CodeBench Lite for ARM EABI
  17. (http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/)
  18. - arm-none-eabi
  19. OR
  20. - arm-none-eabi-gcc
  21. - arm-none-eaby-binutils
  22. ----------------------
  23. Selecting Architecture
  24. ----------------------
  25. This is where you choose which architecture you want to build for.
  26. The options are:
  27. - Teensy 1.0 (Not tested)
  28. - Teensy 1.0++ (Not tested)
  29. - Teensy 2.0
  30. - Teensy 2.0++
  31. - Teensy 3.0
  32. - Teensy 3.1
  33. Open up CMakeLists.txt in your favourite text editor.
  34. You are looking for:
  35. ###
  36. Compiler Family
  37. #
  38. #| Specify the compiler family to use
  39. #| Currently only supports AVR and ARM
  40. #| "avr" # Teensy 1.0
  41. #| "avr" # Teensy 2.0
  42. #| "avr" # Teensy++ 1.0
  43. #| "avr" # Teensy++ 2.0
  44. #| "arm" # Teensy 3.0
  45. #| "arm" # Teensy 3.1
  46. set( COMPILER_FAMILY "avr" )
  47. Just change the COMPILER_FAMILY variable to whatever you are trying to build for.
  48. NOTE: If you change this option, you will *may* to delete the build directory that is created in the Building sections below.
  49. ----------------------
  50. Selecting Microcontroller
  51. ----------------------
  52. Even if you selected the "avr" family of microcontroller architectures, you will still need to specify a target microcontroller (or once more ARM microcontrollers are supported).
  53. Open up avr.cmake (or arm.cmake) in your favourite text editor.
  54. You are looking for:
  55. ###
  56. # Atmel Defines and Linker Options
  57. #
  58. #| MCU Name
  59. #| You _MUST_ set this to match the board you are using
  60. #| type "make clean" after changing this, so all files will be rebuilt
  61. #|
  62. #| "at90usb162" # Teensy 1.0
  63. #| "atmega32u4" # Teensy 2.0
  64. #| "at90usb646" # Teensy++ 1.0
  65. #| "at90usb1286" # Teensy++ 2.0
  66. set( MCU "at90usb1286" )
  67. *OR*
  68. ###
  69. # ARM Defines and Linker Options
  70. #
  71. #| Chip Name (Linker)
  72. #| You _MUST_ set this to match the board you are using
  73. #| type "make clean" after changing this, so all files will be rebuilt
  74. #|
  75. #| "mk20dx128" # Teensy 3.0
  76. #| "mk20dx256" # Teensy 3.1
  77. set( CHIP "mk20dx128" )
  78. Just change the CHIP variable to the microcontroller you are trying to build for.
  79. NOTE: If you change this option, you will *need* to delete the build directory that is created in the Building sections below.
  80. ----------------------
  81. Selecting Modules
  82. ----------------------
  83. WARNING: Not all modules are compatible, and some modules may have dependencies on other modules.
  84. This is where the options start getting interesting.
  85. The Kiibohd Controller is designed around a set of 4 types of modules that correspond to different functionality:
  86. - Scan Module
  87. - Macro Module
  88. - Output Module
  89. - Debug Module
  90. The Scan Module is where the most interesting stuff happens. These modules take in "keypress data".
  91. A converter Scan Module will interpret a protocol into key press/releases.
  92. A matrix Scan Module may inherit from the matrix module to scan keypress from a matrix
  93. This module just has to give press/release codes, but does have some callback control to other modules depending on the lifecycle for press/release codes (this can be very complicated depending on the protocol).
  94. Each Scan Module has it's own default keymap/modifier map. (TODO recommend keymap changing in the Macro Module).
  95. Some scan modules have very specialized hardware requirements, each module directory should have at least a link to the needed parts and/or schematics (TODO!).
  96. The Macro Module takes care of the mapping of the key press/release code into an Output (USB) scan code.
  97. Any layering, macros, keypress intelligence/reaction is done here.
  98. The Output Module is the module dealing with output from the microcontroller. Currently USB is the only output protocol.
  99. Different USB output implementations are available, pjrc being the safest/least featureful one.
  100. Debug capabilities may depend on the module selected.
  101. The Debug Module enables various things like the Teensy LED on errors, debug terminal output.
  102. (TODO get true UART working in avr, not just arm)
  103. Open up setup.cmake in your favourite text editor.
  104. Look for:
  105. ###
  106. # Project Modules
  107. #
  108. #| Note: This is the only section you probably want to modify
  109. #| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
  110. #| All of the modules must be specified, as they generate the sources list of files to compile
  111. #| Any modifications to this file will cause a complete rebuild of the project
  112. #| Please look at the {Scan,Macro,Output,Debug}/module.txt for information on the modules and how to create new ones
  113. ##| Deals with acquiring the keypress information and turning it into a key index
  114. set( ScanModule "avr-capsense" )
  115. ##| Uses the key index and potentially applies special conditions to it, mapping it to a usb key code
  116. set( MacroModule "buffer" )
  117. ##| Sends the current list of usb key codes through USB HID
  118. set( OutputModule "pjrc" )
  119. ##| Debugging source to use, each module has it's own set of defines that it sets
  120. set( DebugModule "full" )
  121. Look at each module individually for it's requirements. There is chip/architecture dependency checking but some permutations of modules may not be tested/compile.
  122. There are also CMake options for temporarily selecting modules. But it's easier to just edit the file.
  123. e.g. cmake -DScanModuleOverride=<module name>
  124. ----------------------
  125. Linux Building
  126. ----------------------
  127. From this directory.
  128. mkdir build
  129. cd build
  130. cmake ..
  131. make
  132. Example output:
  133. [master]: cmake .. [...sy/avr-capsense-haata/build](hyatt@901Mas:pts/4)
  134. -- Compiler Family:
  135. avr
  136. -- MCU Selected:
  137. at90usb1286
  138. -- Detected Scan Module Source Files:
  139. Scan/avr-capsense/scan_loop.c
  140. -- Detected Macro Module Source Files:
  141. Macro/buffer/macro.c
  142. -- Detected Output Module Source Files:
  143. Output/pjrc/usb_com.c;Output/pjrc/avr/usb_keyboard_debug.c
  144. -- Detected Debug Module Source Files:
  145. Debug/full/../led/led.c;Debug/full/../print/print.c
  146. -- Configuring done
  147. -- Generating done
  148. -- Build files have been written to: /home/hyatt/Source/Teensy/avr-capsense-haata/build
  149. [master]: make [...sy/avr-capsense-haata/build](hyatt@901Mas:pts/4)
  150. Scanning dependencies of target kiibohd.elf
  151. [ 12%] Building C object CMakeFiles/kiibohd.elf.dir/main.c.o
  152. [ 25%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/avr-capsense/scan_loop.c.o
  153. [ 37%] Building C object CMakeFiles/kiibohd.elf.dir/Macro/buffer/macro.c.o
  154. [ 50%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrc/usb_com.c.o
  155. [ 62%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrc/avr/usb_keyboard_debug.c.o
  156. [ 75%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/led/led.c.o
  157. [ 87%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/print/print.c.o
  158. Linking C executable kiibohd.elf
  159. Creating load file for Flash: kiibohd.hex
  160. Creating Extended Listing: kiibohd.lss
  161. Creating Symbol Table: kiibohd.sym
  162. [ 87%] Built target kiibohd.elf
  163. Scanning dependencies of target SizeAfter
  164. [100%] Size after generation:
  165. text data bss dec hex filename
  166. 0 6112 0 6112 17e0 kiibohd.hex
  167. 5792 320 852 6964 1b34 kiibohd.elf
  168. [100%] Built target SizeAfter
  169. ----------------------
  170. Linux Loading Firmware
  171. ----------------------
  172. The 'load' script that is created during the build can load the firmware over USB.
  173. It uses sudo, so make sure you have the priviledges.
  174. (TODO, not complete, avr and arm are different currently, need to be unified)
  175. ./load
  176. ----------------------
  177. Windows Building
  178. ----------------------
  179. TODO
  180. ----------------------
  181. Windows Loading Firmware
  182. ----------------------
  183. TODO
  184. ----------------------
  185. Mac OS X Building
  186. ----------------------
  187. TODO
  188. ----------------------
  189. Mac OS X Loading Firmware
  190. ----------------------
  191. TODO
  192. ----------------------
  193. Debugging
  194. ----------------------
  195. TODO