Keyboard firmwares for Atmel AVR and Cortex-M
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. Keymap Editor for TMK firmware
  2. ==============================
  3. Limitation
  4. ----------
  5. TODO & MEMO
  6. ------------
  7. ### Edit action for FN key
  8. ### Better source output
  9. - KEYMAP macro
  10. ### Actionmap support
  11. ### Macro editor
  12. ### Layer operation
  13. - copy, swap, set all, clear...
  14. ### Compress share URL
  15. - lz-string.js(Done)
  16. ### Bootloader jump doesn't work
  17. ### Better Keyobard graphic
  18. ### Keyobard layout screenshot
  19. - HTML5 canvas
  20. - png image file output
  21. ldscript and Flash Memory
  22. -------------------------
  23. [`ldscript_keymap_avr5.x`](https://github.com/tmk/tmk_keyboard/blob/master/ldscript_keymap_avr5.x) is custom ldscript to place keymap at fixed address(0x6800 in this case).
  24. Flash Memroy Map of ATMega32U4(32KB):
  25. +--------------------+ 0x0000
  26. | .vectors | 0xac (43vectors * 4bytes)
  27. | .progmem | PROGMEM variables and PSTR
  28. | .init0-9 |
  29. | .text | code
  30. | .fini9-0 |
  31. | | > text region
  32. |--------------------| _etext
  33. | .data |
  34. | .bss |
  35. | .noinit |
  36. | | > data region
  37. |--------------------| 0x6800
  38. | .keymap.fn_actions |
  39. | .keymap.keymaps | > keymap region(2KB)
  40. |--------------------| 0x7000
  41. | bootloader | 4KB
  42. +--------------------+ 0x7FFF
  43. Keymap(8bit code)
  44. -----------------
  45. This is a format of keymap used in TMK Keymap Editor. This is comprised of two arrays. `fn_actions` is a 64 byte fixed size array of 32 action codes(16bit). `keymaps` is a three dimensional array of key code(8bit) and contains 8 layers of keymap whose size(ROW x COL) is vary on each keyboard matrices.
  46. Signature of the arrays:
  47. - `const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions")))`
  48. - `const uint8_t keymaps[8][ROW][COL] __attribute__ ((section (".keymap.keymaps")))`
  49. These arrays are placed at fixed address in .keymap section:
  50. actions[] -> +-------------+
  51. | action x 32 |
  52. keymaps[] -> |-------------|
  53. | keymap 0 |
  54. |-------------|
  55. | keymap 1 |
  56. |-------------|
  57. | keymap 2 |
  58. |-------------|
  59. | keymap 3 |
  60. |-------------|
  61. | : : |
  62. Actionmap(16bit code)
  63. ---------------------
  64. `actionmaps` is a three dimensional array of actionmap which is matrix(ROW x COL) of action codes(16bit), but this is not actually used in firmware yet at this time. All key action can be represented in 16bit code. Flash Memory usage will be about doubled size compared to keymap(8bit code).
  65. Signature of the arrays:
  66. - `const uint16_t actionmaps[LAYER][ROW][COL] __attribute__ ((section (".keymap.actionmaps")))`
  67. actionmaps[] -> +-------------+
  68. | actionmap 0 |
  69. |-------------|
  70. | actionmap 1 |
  71. |-------------|
  72. | actionmap 2 |
  73. |-------------|
  74. | actionmap 3 |
  75. |-------------|
  76. | : : |
  77. Flash usage cosidaration
  78. ------------------------
  79. As for example of biggest ever keymap, PS/2 and ADB converter have 256 keys in a layer, so use 256 bytes each layer in keymap and 512 bytes in actionmap.
  80. In most cases map size of keyboard will be far smaller than that.
  81. ### ATmega32U4
  82. Firmware -24KB(with full option)
  83. Keymapping 4KB-
  84. Bootloader 4KB(Atmel stock) or 512B(Teensy)
  85. ### ATmega16U4(Not suppoeted yet)
  86. Firmware -10KB
  87. Keymapping 2KB-
  88. Bootloader 4KB(Atmel stock) or 512B(Teensy)
  89. Hex file format
  90. ---------------
  91. [Intel Hex(wikipedia)](http://en.wikipedia.org/wiki/Intel_HEX)
  92. ### 1.Start code
  93. ':'
  94. ### 2.Byte Count
  95. 2 x hex(0-FF)
  96. ### 3.Address
  97. 4 x hex(0-FFFF)
  98. ### 4.Record Type
  99. 2 x hex(00-05)
  100. #### Record Type code
  101. 00: Data record. which contains 16bit address and data.
  102. 01: End of File record. It must appear in the last line.(usually :00000001FF)
  103. 02: Extended Segment Address Record.
  104. 03: Start Segment Address Record.
  105. 04: Extended Linear Address Record. Upper two bytes of 32 bit address.
  106. 05: Start Linear Address Record.
  107. ### 5.Data
  108. byte_count * hex(00-FF)
  109. a sequence of data bytes
  110. ### 6.Checksum
  111. 2 x hex(00-FF)
  112. LSB of 2's complement of the sum of fields[ 'Byte Count', 'Address', 'Record Type' and 'Data' ]
  113. `checksum = ~(the sum of bytes)&0xff + 1 = (the sum)&0xff^0xff + 1`