diff options
author | xyverz <xyverz@gmail.com> | 2016-12-06 17:36:19 -0800 |
---|---|---|
committer | xyverz <xyverz@gmail.com> | 2016-12-06 17:36:19 -0800 |
commit | 9216bc73778ef0fe5830b91511f37dd90fb0f0a1 (patch) | |
tree | 6c9f343c2485150c1912b7b68ade364a232015bd /keyboards/planck/keymaps/thermal_printer/config.h | |
parent | f9cf4f75aec8cb24f054f243b985d9e5c18a2a80 (diff) | |
parent | 985a091a739c99736d5b17de5161831488dbc219 (diff) | |
download | qmk_firmware-9216bc73778ef0fe5830b91511f37dd90fb0f0a1.tar.gz qmk_firmware-9216bc73778ef0fe5830b91511f37dd90fb0f0a1.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'keyboards/planck/keymaps/thermal_printer/config.h')
-rw-r--r-- | keyboards/planck/keymaps/thermal_printer/config.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/thermal_printer/config.h b/keyboards/planck/keymaps/thermal_printer/config.h new file mode 100644 index 0000000000..430b6493cf --- /dev/null +++ b/keyboards/planck/keymaps/thermal_printer/config.h @@ -0,0 +1,23 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +# define SERIAL_UART_BAUD 19200 +# define SERIAL_UART_DATA UDR1 +# define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) +# define SERIAL_UART_RXD_VECT USART1_RX_vect +# define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) +# define SERIAL_UART_INIT() do { \ + /* baud rate */ \ + UBRR1L = SERIAL_UART_UBRR; \ + /* baud rate */ \ + UBRR1H = SERIAL_UART_UBRR >> 8; \ + /* enable TX */ \ + UCSR1B = _BV(TXEN1); \ + /* 8-bit data */ \ + UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ + sei(); \ + } while(0) + + #endif
\ No newline at end of file |