py32f002b_hal_conf.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /**
  2. ******************************************************************************
  3. * @file py32f002b_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 __PY32F002B_HAL_CONF_H
  32. #define __PY32F002B_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_TIM_MODULE_ENABLED */
  51. /* #define HAL_LPTIM_MODULE_ENABLED */
  52. // #define HAL_PWR_MODULE_ENABLED
  53. /* #define HAL_I2C_MODULE_ENABLED */
  54. // #define HAL_UART_MODULE_ENABLED
  55. /* #define HAL_USART_MODULE_ENABLED */
  56. /* #define HAL_SPI_MODULE_ENABLED */
  57. /* #define HAL_EXTI_MODULE_ENABLED */
  58. #define HAL_CORTEX_MODULE_ENABLED
  59. /* ########################## Oscillator Values adaptation ####################*/
  60. #if !defined (HSI_VALUE)
  61. #define HSI_VALUE ((uint32_t)24000000) /*!< Value of the Internal oscillator in Hz */
  62. #endif /* HSI_VALUE */
  63. /**
  64. * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
  65. * This value is used by the RCC HAL module to compute the system frequency
  66. */
  67. #if !defined (HSE_VALUE)
  68. #define HSE_VALUE ((uint32_t)24000000) /*!< Value of the External oscillator in Hz */
  69. #endif /* HSE_VALUE */
  70. #if !defined (HSE_STARTUP_TIMEOUT)
  71. #define HSE_STARTUP_TIMEOUT ((uint32_t)200) /*!< Time out for HSE start up, in ms */
  72. #endif /* HSE_STARTUP_TIMEOUT */
  73. /**
  74. * @brief Internal Low Speed Internal oscillator (LSI) value.
  75. */
  76. #if !defined (LSI_VALUE)
  77. #define LSI_VALUE ((uint32_t)32768) /*!< LSI Typical Value in Hz */
  78. #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
  79. The real value may vary depending on the variations
  80. in voltage and temperature. */
  81. /**
  82. * @brief Adjust the value of External Low Speed oscillator (LSE) used in your application.
  83. * This value is used by the RCC HAL module to compute the system frequency
  84. */
  85. #if !defined (LSE_VALUE)
  86. #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/
  87. #endif /* LSE_VALUE */
  88. #if !defined (LSE_STARTUP_TIMEOUT)
  89. #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */
  90. #endif /* LSE_STARTUP_TIMEOUT */
  91. /* Tip: To avoid modifying this file each time you need to use different HSE,
  92. === you can define the HSE value in your toolchain compiler preprocessor. */
  93. /* ########################### System Configuration ######################### */
  94. /**
  95. * @brief This is the HAL system configuration section
  96. */
  97. #define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
  98. #define PRIORITY_HIGHEST 0
  99. #define PRIORITY_HIGH 1
  100. #define PRIORITY_LOW 2
  101. #define PRIORITY_LOWEST 3
  102. #define TICK_INT_PRIORITY ((uint32_t)PRIORITY_LOWEST) /*!< tick interrupt priority (lowest by default) */
  103. #define USE_RTOS 0
  104. #define PREFETCH_ENABLE 0
  105. /* ########################## Assert Selection ############################## */
  106. /**
  107. * @brief Uncomment the line below to expanse the "assert_param" macro in the
  108. * HAL drivers code
  109. */
  110. /* #define USE_FULL_ASSERT 1U */
  111. /* Includes ------------------------------------------------------------------*/
  112. /**
  113. * @brief Include module's header file
  114. */
  115. #ifdef HAL_MODULE_ENABLED
  116. #include "py32f0xx_hal.h"
  117. #endif /* HAL_MODULE_ENABLED */
  118. #ifdef HAL_RCC_MODULE_ENABLED
  119. #include "py32f002b_hal_rcc.h"
  120. #endif /* HAL_RCC_MODULE_ENABLED */
  121. #ifdef HAL_EXTI_MODULE_ENABLED
  122. #include "py32f002b_hal_exti.h"
  123. #endif /* HAL_EXTI_MODULE_ENABLED */
  124. #ifdef HAL_GPIO_MODULE_ENABLED
  125. #include "py32f002b_hal_gpio.h"
  126. #endif /* HAL_GPIO_MODULE_ENABLED */
  127. #ifdef HAL_CORTEX_MODULE_ENABLED
  128. #include "py32f002b_hal_cortex.h"
  129. #endif /* HAL_CORTEX_MODULE_ENABLED */
  130. #ifdef HAL_ADC_MODULE_ENABLED
  131. #include "py32f002b_hal_adc.h"
  132. #endif /* HAL_ADC_MODULE_ENABLED */
  133. #ifdef HAL_CRC_MODULE_ENABLED
  134. #include "py32f002b_hal_crc.h"
  135. #endif /* HAL_CRC_MODULE_ENABLED */
  136. #ifdef HAL_COMP_MODULE_ENABLED
  137. #include "py32f002b_hal_comp.h"
  138. #endif /* HAL_COMP_MODULE_ENABLED */
  139. #ifdef HAL_FLASH_MODULE_ENABLED
  140. #include "py32f002b_hal_flash.h"
  141. #endif /* HAL_FLASH_MODULE_ENABLED */
  142. #ifdef HAL_I2C_MODULE_ENABLED
  143. #include "py32f002b_hal_i2c.h"
  144. #endif /* HAL_I2C_MODULE_ENABLED */
  145. #ifdef HAL_IWDG_MODULE_ENABLED
  146. #include "py32f002b_hal_iwdg.h"
  147. #endif /* HAL_IWDG_MODULE_ENABLED */
  148. #ifdef HAL_PWR_MODULE_ENABLED
  149. #include "py32f002b_hal_pwr.h"
  150. #endif /* HAL_PWR_MODULE_ENABLED */
  151. #ifdef HAL_SPI_MODULE_ENABLED
  152. #include "py32f002b_hal_spi.h"
  153. #endif /* HAL_SPI_MODULE_ENABLED */
  154. #ifdef HAL_TIM_MODULE_ENABLED
  155. #include "py32f002b_hal_tim.h"
  156. #endif /* HAL_TIM_MODULE_ENABLED */
  157. #ifdef HAL_LPTIM_MODULE_ENABLED
  158. #include "py32f002b_hal_lptim.h"
  159. #endif /* HAL_LPTIM_MODULE_ENABLED */
  160. #ifdef HAL_UART_MODULE_ENABLED
  161. #include "py32f002b_hal_uart.h"
  162. #endif /* HAL_UART_MODULE_ENABLED */
  163. #ifdef HAL_USART_MODULE_ENABLED
  164. #include "py32f002b_hal_usart.h"
  165. #endif /* HAL_USART_MODULE_ENABLED */
  166. /* Exported macro ------------------------------------------------------------*/
  167. #ifdef USE_FULL_ASSERT
  168. /**
  169. * @brief The assert_param macro is used for function's parameters check.
  170. * @param expr: If expr is false, it calls assert_failed function
  171. * which reports the name of the source file and the source
  172. * line number of the call that failed.
  173. * If expr is true, it returns no value.
  174. * @retval None
  175. */
  176. #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
  177. /* Exported functions ------------------------------------------------------- */
  178. void assert_failed(uint8_t* file, uint32_t line);
  179. #else
  180. #define assert_param(expr) ((void)0U)
  181. #endif /* USE_FULL_ASSERT */
  182. #ifdef __cplusplus
  183. }
  184. #endif
  185. #endif /* __PY32F002B_HAL_CONF_H */
  186. /************************ (C) COPYRIGHT Puya *****END OF FILE******************/