Keyboard firmwares for Atmel AVR and Cortex-M
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.

config.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef CONFIG_H
  2. #define CONFIG_H
  3. #define VENDOR_ID 0xFEED
  4. #define PRODUCT_ID 0x6512
  5. #define MANUFACTURER t.m.k.
  6. #define PRODUCT PS/2 keyboard converter
  7. #define DESCRIPTION convert PS/2 keyboard to USB
  8. /* matrix size */
  9. #define MATRIX_ROWS 32 // keycode bit: 3-0
  10. #define MATRIX_COLS 8 // keycode bit: 6-4
  11. /* key combination for command */
  12. #define IS_COMMAND() ( \
  13. keyboard_report->mods == (BIT_LSHIFT | BIT_RSHIFT) || \
  14. keyboard_report->mods == (BIT_LCTRL | BIT_RSHIFT) \
  15. )
  16. /* USB NKey Rollover */
  17. #ifdef USB_NKRO_ENABLE
  18. #endif
  19. /* mouse keys */
  20. #ifdef MOUSEKEY_ENABLE
  21. # define MOUSEKEY_DELAY_TIME 255
  22. #endif
  23. /* PS/2 lines */
  24. #define PS2_CLOCK_PORT PORTD
  25. #define PS2_CLOCK_PIN PIND
  26. #define PS2_CLOCK_DDR DDRD
  27. #define PS2_CLOCK_BIT 3
  28. #define PS2_DATA_PORT PORTD
  29. #define PS2_DATA_PIN PIND
  30. #define PS2_DATA_DDR DDRD
  31. #define PS2_DATA_BIT 7
  32. /* External interrupt for PS/2 clock line (optional) */
  33. #define PS2_INT_ENABLE() do { \
  34. EIMSK |= (1<<INT1); \
  35. EICRA |= ((1<<ISC11) | (0<<ISC10)); \
  36. EIFR |= (1<<INTF1); \
  37. } while (0)
  38. #define PS2_INT_DISABLE() do { \
  39. EIMSK &= ~(1<<INT1); \
  40. } while (0)
  41. #define PS2_INT_VECT INT1_vect
  42. /* Pin Change interrupt for PS/2 clock line (optional)
  43. #define PS2_INT_ENABLE() do { \
  44. PCMSK2 |= (1<<PCINT22); \
  45. PCICR |= (1<<PCIE2); \
  46. PCIFR |= (1<<PCIF2); \
  47. } while (0)
  48. #define PS2_INT_DISABLE() do { \
  49. PCMSK2 &= ~(1<<PCINT22); \
  50. PCICR &= ~(1<<PCIE); \
  51. } while (0)
  52. #define PS2_INT_VECT PCINT2_vect
  53. */
  54. #endif