logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

config.h (2127B)


  1. /* Copyright 2022 durken (https://github.com/durken1/)
  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. /* key matrix size */
  18. #define MATRIX_ROWS 4
  19. #define MATRIX_COLS 10
  20. /* COL2ROW or ROW2COL */
  21. #define DIODE_DIRECTION COL2ROW
  22. #ifdef PS2_DRIVER_USART
  23. #define PS2_CLOCK_PIN D5
  24. #define PS2_DATA_PIN D2
  25. /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
  26. /* set DDR of CLOCK as input to be slave */
  27. #define PS2_USART_INIT() do { \
  28. PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
  29. PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
  30. UCSR1C = ((1 << UMSEL10) | \
  31. (3 << UPM10) | \
  32. (0 << USBS1) | \
  33. (3 << UCSZ10) | \
  34. (0 << UCPOL1)); \
  35. UCSR1A = 0; \
  36. UBRR1H = 0; \
  37. UBRR1L = 0; \
  38. } while (0)
  39. #define PS2_USART_RX_INT_ON() do { \
  40. UCSR1B = ((1 << RXCIE1) | \
  41. (1 << RXEN1)); \
  42. } while (0)
  43. #define PS2_USART_RX_POLL_ON() do { \
  44. UCSR1B = (1 << RXEN1); \
  45. } while (0)
  46. #define PS2_USART_OFF() do { \
  47. UCSR1C = 0; \
  48. UCSR1B &= ~((1 << RXEN1) | \
  49. (1 << TXEN1)); \
  50. } while (0)
  51. #define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
  52. #define PS2_USART_RX_DATA UDR1
  53. #define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
  54. #define PS2_USART_RX_VECT USART1_RX_vect
  55. #define PS2_MOUSE_ROTATE 270 /* Compensate for East-facing device orientation. */
  56. #endif