py32f0xx_hal_conf.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /**
  2. ******************************************************************************
  3. * @file py32f0xx_hal_conf.h
  4. * @author MCU Application Team
  5. * @brief HAL configuration file.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by Puya under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. * @attention
  19. *
  20. * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
  21. * All rights reserved.</center></h2>
  22. *
  23. * This software component is licensed by ST under BSD 3-Clause license,
  24. * the "License"; You may not use this file except in compliance with the
  25. * License. You may obtain a copy of the License at:
  26. * opensource.org/licenses/BSD-3-Clause
  27. *
  28. ******************************************************************************
  29. */
  30. /* Define to prevent recursive inclusion -------------------------------------*/
  31. #ifndef __PY32F0xx_HAL_CONF_H
  32. #define __PY32F0xx_HAL_CONF_H
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /* Exported types ------------------------------------------------------------*/
  37. /* Exported constants --------------------------------------------------------*/
  38. /* ########################## Module Selection ############################## */
  39. /**
  40. * @brief This is the list of modules to be used in the HAL driver
  41. */
  42. #define HAL_MODULE_ENABLED
  43. #define HAL_RCC_MODULE_ENABLED
  44. /* #define HAL_ADC_MODULE_ENABLED */
  45. /* #define HAL_CRC_MODULE_ENABLED */
  46. /* #define HAL_COMP_MODULE_ENABLED */
  47. #define HAL_FLASH_MODULE_ENABLED
  48. #define HAL_GPIO_MODULE_ENABLED
  49. /* #define HAL_IWDG_MODULE_ENABLED */
  50. /* #define HAL_WWDG_MODULE_ENABLED */
  51. #define HAL_TIM_MODULE_ENABLED
  52. #define HAL_DMA_MODULE_ENABLED
  53. /* #define HAL_LPTIM_MODULE_ENABLED */
  54. #define HAL_PWR_MODULE_ENABLED
  55. /* #define HAL_I2C_MODULE_ENABLED */
  56. #define HAL_UART_MODULE_ENABLED
  57. /* #define HAL_SPI_MODULE_ENABLED */
  58. /* #define HAL_RTC_MODULE_ENABLED */
  59. /* #define HAL_LED_MODULE_ENABLED */
  60. /* #define HAL_EXTI_MODULE_ENABLED */
  61. #define HAL_CORTEX_MODULE_ENABLED
  62. /* ########################## Oscillator Values adaptation ####################*/
  63. #if !defined (HSI_VALUE)
  64. #define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz */
  65. #endif /* HSI_VALUE */
  66. /**
  67. * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
  68. * This value is used by the RCC HAL module to compute the system frequency
  69. */
  70. #if !defined (HSE_VALUE)
  71. #define HSE_VALUE ((uint32_t)24000000) /*!< Value of the External oscillator in Hz */
  72. #endif /* HSE_VALUE */
  73. #if !defined (HSE_STARTUP_TIMEOUT)
  74. #define HSE_STARTUP_TIMEOUT ((uint32_t)200) /*!< Time out for HSE start up, in ms */
  75. #endif /* HSE_STARTUP_TIMEOUT */
  76. /**
  77. * @brief Internal Low Speed Internal oscillator (LSI) value.
  78. */
  79. #if !defined (LSI_VALUE)
  80. #define LSI_VALUE ((uint32_t)32768) /*!< LSI Typical Value in Hz */
  81. #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
  82. The real value may vary depending on the variations
  83. in voltage and temperature. */
  84. /**
  85. * @brief Adjust the value of External Low Speed oscillator (LSE) used in your application.
  86. * This value is used by the RCC HAL module to compute the system frequency
  87. */
  88. #if !defined (LSE_VALUE)
  89. #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/
  90. #endif /* LSE_VALUE */
  91. #if !defined (LSE_STARTUP_TIMEOUT)
  92. #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */
  93. #endif /* LSE_STARTUP_TIMEOUT */
  94. /* Tip: To avoid modifying this file each time you need to use different HSE,
  95. === you can define the HSE value in your toolchain compiler preprocessor. */
  96. /* ########################### System Configuration ######################### */
  97. /**
  98. * @brief This is the HAL system configuration section
  99. */
  100. #define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
  101. #define PRIORITY_HIGHEST 0
  102. #define PRIORITY_HIGH 1
  103. #define PRIORITY_LOW 2
  104. #define PRIORITY_LOWEST 3
  105. #define TICK_INT_PRIORITY ((uint32_t)PRIORITY_LOWEST) /*!< tick interrupt priority (lowest by default) */
  106. #define USE_RTOS 0
  107. #define PREFETCH_ENABLE 0
  108. /* ########################## Assert Selection ############################## */
  109. /**
  110. * @brief Uncomment the line below to expanse the "assert_param" macro in the
  111. * HAL drivers code
  112. */
  113. /* #define USE_FULL_ASSERT 1U */
  114. /* Includes ------------------------------------------------------------------*/
  115. /**
  116. * @brief Include module's header file
  117. */
  118. #ifdef HAL_MODULE_ENABLED
  119. #include "py32f0xx_hal.h"
  120. #endif /* HAL_MODULE_ENABLED */
  121. #ifdef HAL_RCC_MODULE_ENABLED
  122. #include "py32f0xx_hal_rcc.h"
  123. #endif /* HAL_RCC_MODULE_ENABLED */
  124. #ifdef HAL_EXTI_MODULE_ENABLED
  125. #include "py32f0xx_hal_exti.h"
  126. #endif /* HAL_EXTI_MODULE_ENABLED */
  127. #ifdef HAL_GPIO_MODULE_ENABLED
  128. #include "py32f0xx_hal_gpio.h"
  129. #endif /* HAL_GPIO_MODULE_ENABLED */
  130. #ifdef HAL_CORTEX_MODULE_ENABLED
  131. #include "py32f0xx_hal_cortex.h"
  132. #endif /* HAL_CORTEX_MODULE_ENABLED */
  133. #ifdef HAL_DMA_MODULE_ENABLED
  134. #include "py32f0xx_hal_dma.h"
  135. #endif /* HAL_DMA_MODULE_ENABLED */
  136. #ifdef HAL_ADC_MODULE_ENABLED
  137. #include "py32f0xx_hal_adc.h"
  138. #endif /* HAL_ADC_MODULE_ENABLED */
  139. #ifdef HAL_CRC_MODULE_ENABLED
  140. #include "py32f0xx_hal_crc.h"
  141. #endif /* HAL_CRC_MODULE_ENABLED */
  142. #ifdef HAL_COMP_MODULE_ENABLED
  143. #include "py32f0xx_hal_comp.h"
  144. #endif /* HAL_COMP_MODULE_ENABLED */
  145. #ifdef HAL_FLASH_MODULE_ENABLED
  146. #include "py32f0xx_hal_flash.h"
  147. #endif /* HAL_FLASH_MODULE_ENABLED */
  148. #ifdef HAL_I2C_MODULE_ENABLED
  149. #include "py32f0xx_hal_i2c.h"
  150. #endif /* HAL_I2C_MODULE_ENABLED */
  151. #ifdef HAL_IWDG_MODULE_ENABLED
  152. #include "py32f0xx_hal_iwdg.h"
  153. #endif /* HAL_IWDG_MODULE_ENABLED */
  154. #ifdef HAL_PWR_MODULE_ENABLED
  155. #include "py32f0xx_hal_pwr.h"
  156. #endif /* HAL_PWR_MODULE_ENABLED */
  157. #ifdef HAL_RTC_MODULE_ENABLED
  158. #include "py32f0xx_hal_rtc.h"
  159. #endif /* HAL_RTC_MODULE_ENABLED */
  160. #ifdef HAL_SPI_MODULE_ENABLED
  161. #include "py32f0xx_hal_spi.h"
  162. #endif /* HAL_SPI_MODULE_ENABLED */
  163. #ifdef HAL_TIM_MODULE_ENABLED
  164. #include "py32f0xx_hal_tim.h"
  165. #endif /* HAL_TIM_MODULE_ENABLED */
  166. #ifdef HAL_LPTIM_MODULE_ENABLED
  167. #include "py32f0xx_hal_lptim.h"
  168. #endif /* HAL_LPTIM_MODULE_ENABLED */
  169. #ifdef HAL_UART_MODULE_ENABLED
  170. #include "py32f0xx_hal_uart.h"
  171. #endif /* HAL_UART_MODULE_ENABLED */
  172. #ifdef HAL_WWDG_MODULE_ENABLED
  173. #include "py32f0xx_hal_wwdg.h"
  174. #endif /* HAL_WWDG_MODULE_ENABLED */
  175. #ifdef HAL_LED_MODULE_ENABLED
  176. #include "py32f0xx_hal_led.h"
  177. #endif /* HAL_LED_MODULE_ENABLED */
  178. #ifdef HAL_USART_MODULE_ENABLED
  179. #include "py32f0xx_hal_usart.h"
  180. #endif /* HAL_USART_MODULE_ENABLED */
  181. /* Exported macro ------------------------------------------------------------*/
  182. #ifdef USE_FULL_ASSERT
  183. /**
  184. * @brief The assert_param macro is used for function's parameters check.
  185. * @param expr: If expr is false, it calls assert_failed function
  186. * which reports the name of the source file and the source
  187. * line number of the call that failed.
  188. * If expr is true, it returns no value.
  189. * @retval None
  190. */
  191. #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
  192. /* Exported functions ------------------------------------------------------- */
  193. void assert_failed(uint8_t* file, uint32_t line);
  194. #else
  195. #define assert_param(expr) ((void)0U)
  196. #endif /* USE_FULL_ASSERT */
  197. #ifdef __cplusplus
  198. }
  199. #endif
  200. #endif /* __PY32F0xx_HAL_CONF_H */
  201. /************************ (C) COPYRIGHT Puya *****END OF FILE******************/