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.

105 lines
2.7 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. /* Copyright 2015-2017 Jack Humbert
  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. #ifndef CONFIG_DEFINITIONS_H
  17. #define CONFIG_DEFINITIONS_H
  18. /* diode directions */
  19. #define COL2ROW 0
  20. #define ROW2COL 1
  21. #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */
  22. /* I/O pins */
  23. #ifndef F0
  24. #define B0 0x30
  25. #define B1 0x31
  26. #define B2 0x32
  27. #define B3 0x33
  28. #define B4 0x34
  29. #define B5 0x35
  30. #define B6 0x36
  31. #define B7 0x37
  32. #define C0 0x60
  33. #define C1 0x61
  34. #define C2 0x62
  35. #define C3 0x63
  36. #define C4 0x64
  37. #define C5 0x65
  38. #define C6 0x66
  39. #define C7 0x67
  40. #define D0 0x90
  41. #define D1 0x91
  42. #define D2 0x92
  43. #define D3 0x93
  44. #define D4 0x94
  45. #define D5 0x95
  46. #define D6 0x96
  47. #define D7 0x97
  48. #define E0 0xC0
  49. #define E1 0xC1
  50. #define E2 0xC2
  51. #define E3 0xC3
  52. #define E4 0xC4
  53. #define E5 0xC5
  54. #define E6 0xC6
  55. #define E7 0xC7
  56. #define F0 0xF0
  57. #define F1 0xF1
  58. #define F2 0xF2
  59. #define F3 0xF3
  60. #define F4 0xF4
  61. #define F5 0xF5
  62. #define F6 0xF6
  63. #define F7 0xF7
  64. #define A0 0x00
  65. #define A1 0x01
  66. #define A2 0x02
  67. #define A3 0x03
  68. #define A4 0x04
  69. #define A5 0x05
  70. #define A6 0x06
  71. #define A7 0x07
  72. #endif
  73. /* USART configuration */
  74. #ifdef BLUETOOTH_ENABLE
  75. # ifdef __AVR_ATmega32U4__
  76. # define SERIAL_UART_BAUD 9600
  77. # define SERIAL_UART_DATA UDR1
  78. # define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
  79. # define SERIAL_UART_RXD_VECT USART1_RX_vect
  80. # define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
  81. # define SERIAL_UART_INIT() do { \
  82. /* baud rate */ \
  83. UBRR1L = SERIAL_UART_UBRR; \
  84. /* baud rate */ \
  85. UBRR1H = SERIAL_UART_UBRR >> 8; \
  86. /* enable TX */ \
  87. UCSR1B = _BV(TXEN1); \
  88. /* 8-bit data */ \
  89. UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
  90. sei(); \
  91. } while(0)
  92. # else
  93. # error "USART configuration is needed."
  94. # endif
  95. #endif
  96. #define API_SYSEX_MAX_SIZE 32
  97. #include "song_list.h"
  98. #endif