logo

qmk_firmware

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

mcuconf.h (1677B)


  1. /*
  2. ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #pragma once
  14. #include "nvic.h"
  15. #define HT32F52342_MCUCONF
  16. /*
  17. * HAL driver system settings.
  18. */
  19. /*
  20. * Clock configuration.
  21. */
  22. // This configuration:
  23. // 8 MHz HSE crystal
  24. // PLL multiplies HSE to 48 MHz core and peripheral clock
  25. // 48 MHz to UART
  26. // 48 MHz to USB
  27. #define HT32_CK_HSE_FREQUENCY 8000000UL // 8 MHz
  28. #define HT32_CKCU_SW CKCU_GCCR_SW_PLL
  29. #define HT32_PLL_USE_HSE TRUE
  30. #define HT32_PLL_FBDIV 6 // 8 MHz -> 48 MHz
  31. #define HT32_PLL_OTDIV 0
  32. #define HT32_AHB_PRESCALER 1 // 48 MHz -> 48 MHz
  33. #define HT32_USART_PRESCALER 1 // 48 MHz
  34. #define HT32_USB_PRESCALER 1 // 48 MHz -> 48 MHz
  35. // SysTick uses processor clock at 48MHz
  36. #define HT32_ST_USE_HCLK TRUE
  37. /*
  38. * Peripheral driver settings
  39. */
  40. #define HT32_SERIAL_USE_USART0 TRUE
  41. #define HT32_USART0_IRQ_PRIORITY 6
  42. #define HT32_SERIAL_USE_USART1 TRUE
  43. #define HT32_USART1_IRQ_PRIORITY 7
  44. /*
  45. * USB driver settings
  46. */
  47. #define HT32_USB_USE_USB0 TRUE
  48. #define HT32_USB_USB0_IRQ_PRIORITY 5
  49. /*
  50. * SPI driver setting
  51. */
  52. #define HT32_SPI_USE_SPI1 TRUE
  53. #define HT32_SPI1_IRQ_PRIORITY 9