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