1 #ifndef CONFIG_DEFINITIONS_H
2 #define CONFIG_DEFINITIONS_H
58 /* USART configuration */
59 #ifdef BLUETOOTH_ENABLE
60 # ifdef __AVR_ATmega32U4__
61 # define SERIAL_UART_BAUD 9600
62 # define SERIAL_UART_DATA UDR1
63 # define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
64 # define SERIAL_UART_RXD_VECT USART1_RX_vect
65 # define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
66 # define SERIAL_UART_INIT() do { \
68 UBRR1L = SERIAL_UART_UBRR; \
70 UBRR1H = SERIAL_UART_UBRR >> 8; \
72 UCSR1B = _BV(TXEN1); \
74 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
78 # error "USART configuration is needed."
82 #ifdef PS2_USE_BUSYWAIT
83 # ifndef PS2_CLOCK_PORT
84 # error "PS2_CLOCK_PORT has to be defined"
86 # ifndef PS2_CLOCK_PIN
87 # error "PS2_CLOCK_PIN has to be defined"
89 # ifndef PS2_CLOCK_DDR
90 # error "PS2_CLOCK_DDR has to be defined"
92 # ifndef PS2_CLOCK_BIT
93 # error "PS2_CLOCK_BIT has to be defined"
95 # ifndef PS2_DATA_PORT
96 # error "PS2_DATA_PORT has to be defined"
99 # error "PS2_DATA_PIN has to be defined"
101 # ifndef PS2_DATA_DDR
102 # error "PS2_DATA_DDR has to be defined"
104 # ifndef PS2_DATA_BIT
105 # error "PS2_DATA_BIT has to be defined"
110 # ifndef PS2_CLOCK_PORT
111 # error "PS2_CLOCK_PORT has to be defined"
113 # ifndef PS2_CLOCK_PIN
114 # error "PS2_CLOCK_PIN has to be defined"
116 # ifndef PS2_CLOCK_DDR
117 # error "PS2_CLOCK_DDR has to be defined"
119 # ifndef PS2_CLOCK_BIT
120 # error "PS2_CLOCK_BIT has to be defined"
122 # ifndef PS2_DATA_PORT
123 # error "PS2_DATA_PORT has to be defined"
125 # ifndef PS2_DATA_PIN
126 # error "PS2_DATA_PIN has to be defined"
128 # ifndef PS2_DATA_DDR
129 # error "PS2_DATA_DDR has to be defined"
131 # ifndef PS2_DATA_BIT
132 # error "PS2_DATA_BIT has to be defined"
134 # ifndef PS2_INT_INIT
135 # error "PS2_INT_INIT has to be defined"
138 # error "PS2_INT_ON has to be defined"
141 # error "PS2_INT_OFF has to be defined"
143 # ifndef PS2_INT_VECT
144 # error "PS2_INT_VECT has to be defined"
149 # ifndef PS2_CLOCK_PORT
150 # error "PS2_CLOCK_PORT has to be defined"
152 # ifndef PS2_CLOCK_PIN
153 # error "PS2_CLOCK_PIN has to be defined"
155 # ifndef PS2_CLOCK_DDR
156 # error "PS2_CLOCK_DDR has to be defined"
158 # ifndef PS2_CLOCK_BIT
159 # error "PS2_CLOCK_BIT has to be defined"
161 # ifndef PS2_DATA_PORT
162 # error "PS2_DATA_PORT has to be defined"
164 # ifndef PS2_DATA_PIN
165 # error "PS2_DATA_PIN has to be defined"
167 # ifndef PS2_DATA_DDR
168 # error "PS2_DATA_DDR has to be defined"
170 # ifndef PS2_DATA_BIT
171 # error "PS2_DATA_BIT has to be defined"
173 # ifndef PS2_USART_INIT
174 # error "PS2_USART_INIT has to be defined"
176 # ifndef PS2_USART_RX_INT_ON
177 # error "PS2_USART_RX_INT_ON has to be defined"
179 # ifndef PS2_USART_RX_POLL_ON
180 # error "PS2_USART_RX_POLL_ON has to be defined"
182 # ifndef PS2_USART_OFF
183 # error "PS2_USART_OFF has to be defined"
185 # ifndef PS2_USART_RX_READY
186 # error "PS2_USART_RX_READY has to be defined"
188 # ifndef PS2_USART_RX_DATA
189 # error "PS2_USART_RX_DATA has to be defined"
191 # ifndef PS2_USART_ERROR
192 # error "PS2_USART_ERROR has to be defined"
194 # ifndef PS2_USART_RX_VECT
195 # error "PS2_USART_RX_VECT has to be defined"