]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/planck/keymaps/thermal_printer/config.h
430b6493cfc4099a773df7e5a4a6d68d5e90f792
[qmk_firmware.git] / keyboards / planck / keymaps / thermal_printer / config.h
1 #ifndef CONFIG_USER_H
2 #define CONFIG_USER_H
3
4 #include "../../config.h"
5
6 #      define SERIAL_UART_BAUD 19200
7 #      define SERIAL_UART_DATA UDR1
8 #      define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
9 #      define SERIAL_UART_RXD_VECT USART1_RX_vect
10 #      define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
11 #      define SERIAL_UART_INIT() do { \
12             /* baud rate */ \
13             UBRR1L = SERIAL_UART_UBRR; \
14             /* baud rate */ \
15             UBRR1H = SERIAL_UART_UBRR >> 8; \
16             /* enable TX */ \
17             UCSR1B = _BV(TXEN1); \
18             /* 8-bit data */ \
19             UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
20             sei(); \
21         } while(0)
22
23  #endif