Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

config.h 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. Copyright 2012 Jun Wako <[email protected]>
  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. #ifndef CONFIG_H
  15. #define CONFIG_H
  16. #define VENDOR_ID 0xFEED
  17. #define PRODUCT_ID 0x3333
  18. #define DEVICE_VER 0x0100
  19. #define MANUFACTURER t.m.k.
  20. #define PRODUCT Sun keyboard converter
  21. #define DESCRIPTION converts Sun keyboard protocol into USB
  22. /* matrix size */
  23. #define MATRIX_ROWS 16
  24. #define MATRIX_COLS 8
  25. /* key combination for command */
  26. #define IS_COMMAND() ( \
  27. keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \
  28. keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \
  29. keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
  30. )
  31. /* Serial(USART) configuration
  32. * asynchronous, negative logic, 1200baud, no flow control
  33. * 1-start bit, 8-data bit, non parity, 1-stop bit
  34. */
  35. #define SERIAL_NEGATIVE_LOGIC
  36. #define SERIAL_BAUD 1200
  37. #define SERIAL_RXD_DDR DDRD
  38. #define SERIAL_RXD_PORT PORTD
  39. #define SERIAL_RXD_PIN PIND
  40. #define SERIAL_RXD_BIT 2
  41. #define SERIAL_RXD_VECT INT2_vect
  42. #define SERIAL_RXD_INIT() do { \
  43. /* pin configuration: input with pull-up */ \
  44. SERIAL_RXD_DDR &= ~(1<<SERIAL_RXD_BIT); \
  45. SERIAL_RXD_PORT |= (1<<SERIAL_RXD_BIT); \
  46. /* enable interrupt: INT2(rising edge) */ \
  47. EICRA |= ((1<<ISC21)|(1<<ISC20)); \
  48. EIMSK |= (1<<INT2); \
  49. } while (0)
  50. #define SERIAL_RXD_INT_ENTER()
  51. #define SERIAL_RXD_INT_EXIT() do { \
  52. /* clear interrupt flag */ \
  53. EIFR = (1<<INTF2); \
  54. } while (0)
  55. #endif