config.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright 2017 Mattia Dal Ben
  2. *
  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. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #include "config_common.h"
  18. /* USB Device descriptor parameter */
  19. #define VENDOR_ID 0xFEED
  20. #define PRODUCT_ID 0x6060
  21. #define DEVICE_VER 0x0001
  22. #define MANUFACTURER Mattia Dal Ben
  23. #define PRODUCT Redox_wireless
  24. #define DESCRIPTION q.m.k. keyboard firmware for Redox-w
  25. /* key matrix size */
  26. #define MATRIX_ROWS 5
  27. #define MATRIX_COLS 14
  28. /* define if matrix has ghost */
  29. //#define MATRIX_HAS_GHOST
  30. /* number of backlight levels */
  31. //#define BACKLIGHT_LEVELS 3
  32. #define ONESHOT_TIMEOUT 500
  33. /*
  34. * Feature disable options
  35. * These options are also useful to firmware size reduction.
  36. */
  37. /* disable debug print */
  38. //#define NO_DEBUG
  39. /* disable print */
  40. //#define NO_PRINT
  41. /* disable action features */
  42. //#define NO_ACTION_LAYER
  43. //#define NO_ACTION_TAPPING
  44. //#define NO_ACTION_ONESHOT
  45. //#define NO_ACTION_MACRO
  46. //#define NO_ACTION_FUNCTION
  47. //UART settings for communication with the RF microcontroller
  48. #define SERIAL_UART_BAUD 1000000
  49. #define SERIAL_UART_DATA UDR1
  50. #define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
  51. #define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
  52. #define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
  53. #define SERIAL_UART_INIT() do { \
  54. /* baud rate */ \
  55. UBRR1L = SERIAL_UART_UBRR; \
  56. /* baud rate */ \
  57. UBRR1H = SERIAL_UART_UBRR >> 8; \
  58. /* enable TX and RX */ \
  59. UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
  60. /* 8-bit data */ \
  61. UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
  62. } while(0)