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.

82 lines
2.2 KiB

Add a new keyboard "Unicorne" (#12993) * Add keyboards/yanghu/unicorne initial files. * add default keymap to yanghu/unicorne * use slow i2c and enable internal pullup resistor * add oled to default keymaps * fix unicorne default keymap * fix encoder pad direction * fix marauder * add led matrix configs. * add encoder code to default keymap. * fix encoder direction * add readme, info.json and update copyright for c files. * fix build error by clean up include in unicorne.c * fix images in readme files * Fix various issues in PR #12993 feedback. * Added copyright in glcdfont, fix include in that file. * Removed `_kc` layout and renamed layout with generic style. * Moved capslock oled update to oled.c inside `oled_task_user()`. * Update keyboards/yanghu/unicorne/keymaps/default/rules.mk Always include oled.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/oled.c Wrap `oled.c` with ifdef. Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/oled.c Co-authored-by: Drashna Jaelre <drashna@live.com> * move oled code to unicorne.c, and set weakly. * Update keyboards/yanghu/unicorne/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/unicorne.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/keymaps/default/oled.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/f411/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * remove oled.h * remove include of oled.h after the file is deleted. * Apply suggestions from code review: remove redundant macros and reformat. Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review: change OLED driver macro. Use `OLED_ENABLE` instead of `OLED_DRIVER_ENABLE`. Co-authored-by: Jonathan Rascher <jon@bcat.name> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Jonathan Rascher <jon@bcat.name>
2 years ago
Add a new keyboard "Unicorne" (#12993) * Add keyboards/yanghu/unicorne initial files. * add default keymap to yanghu/unicorne * use slow i2c and enable internal pullup resistor * add oled to default keymaps * fix unicorne default keymap * fix encoder pad direction * fix marauder * add led matrix configs. * add encoder code to default keymap. * fix encoder direction * add readme, info.json and update copyright for c files. * fix build error by clean up include in unicorne.c * fix images in readme files * Fix various issues in PR #12993 feedback. * Added copyright in glcdfont, fix include in that file. * Removed `_kc` layout and renamed layout with generic style. * Moved capslock oled update to oled.c inside `oled_task_user()`. * Update keyboards/yanghu/unicorne/keymaps/default/rules.mk Always include oled.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/oled.c Wrap `oled.c` with ifdef. Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/oled.c Co-authored-by: Drashna Jaelre <drashna@live.com> * move oled code to unicorne.c, and set weakly. * Update keyboards/yanghu/unicorne/config.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/unicorne.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/yanghu/unicorne/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/keymaps/default/oled.c Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/f411/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/yanghu/unicorne/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * remove oled.h * remove include of oled.h after the file is deleted. * Apply suggestions from code review: remove redundant macros and reformat. Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review: change OLED driver macro. Use `OLED_ENABLE` instead of `OLED_DRIVER_ENABLE`. Co-authored-by: Jonathan Rascher <jon@bcat.name> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Jonathan Rascher <jon@bcat.name>
2 years ago
  1. /* Copyright 2021 Yang Hu
  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. #include "config_common.h"
  18. /* USB Device descriptor parameter */
  19. #define VENDOR_ID 0xFEED
  20. #define PRODUCT_ID 0x0204
  21. #define DEVICE_VER 0x0001
  22. #define MANUFACTURER yanghu
  23. #define PRODUCT unicorne
  24. /* key matrix size */
  25. #define MATRIX_ROWS 4
  26. #define MATRIX_COLS 12
  27. #define MATRIX_COL_PINS \
  28. { A14, A15, B13, B14, B15, A13, A0, A1, A2, A3, A6, A7 }
  29. #define MATRIX_ROW_PINS \
  30. { B9, B8, A10, A9 }
  31. /* COL2ROW, ROW2COL*/
  32. #define DIODE_DIRECTION COL2ROW
  33. #define ENCODERS_PAD_A \
  34. { B10, B2 }
  35. #define ENCODERS_PAD_B \
  36. { B12, B0 }
  37. /* I2C - required for custom i2c_init */
  38. #define I2C1_SCL_PIN B6
  39. #define I2C1_SDA_PIN B7
  40. #define I2C1_SCL_PAL_MODE 4
  41. #define I2C1_SDA_PAL_MODE 4
  42. /* Audio */
  43. #define AUDIO_PIN A8
  44. #define AUDIO_PWM_PAL_MODE 1
  45. #define AUDIO_PWM_DRIVER PWMD1
  46. #define AUDIO_PWM_CHANNEL 1
  47. #define AUDIO_STATE_TIMER GPTD4
  48. /* RGB LED */
  49. #define RGB_DI_PIN B1
  50. #define RGBLED_NUM 8
  51. #define DRIVER_LED_TOTAL RGBLED_NUM
  52. #define RGBLIGHT_EFFECT_BREATHING
  53. #define RGBLIGHT_EFFECT_RAINBOW_MOOD
  54. #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
  55. #define RGBLIGHT_EFFECT_SNAKE
  56. #define RGBLIGHT_EFFECT_KNIGHT
  57. #define RGBLIGHT_EFFECT_CHRISTMAS
  58. #define RGBLIGHT_EFFECT_STATIC_GRADIENT
  59. #define RGBLIGHT_EFFECT_RGB_TEST
  60. #define RGBLIGHT_EFFECT_ALTERNATING
  61. #define RGBLIGHT_EFFECT_TWINKLE
  62. #define WS2812_PWM_DRIVER PWMD3
  63. #define WS2812_PWM_CHANNEL 4
  64. #define WS2812_PWM_PAL_MODE 2
  65. #define WS2812_DMA_STREAM STM32_DMA1_STREAM2
  66. #define WS2812_DMA_CHANNEL 5
  67. #define WS2812_EXTERNAL_PULLUP
  68. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  69. #define DEBOUNCE 5