|
| 1 | +/** |
| 2 | + ****************************************************************************** |
| 3 | + * @file stm32_external_env.h |
| 4 | + * @brief External environments values (external oscillators values). |
| 5 | + * This file should be copied to the application folder. |
| 6 | + ****************************************************************************** |
| 7 | + * @attention |
| 8 | + * |
| 9 | + * Copyright (c) 2026 STMicroelectronics. |
| 10 | + * All rights reserved. |
| 11 | + * |
| 12 | + * This software is licensed under terms that can be found in the LICENSE file |
| 13 | + * in the root directory of this software component. |
| 14 | + * If no LICENSE file comes with this software, it is provided AS-IS. |
| 15 | + * |
| 16 | + ****************************************************************************** |
| 17 | + */ |
| 18 | + |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ |
| 20 | +#ifndef STM32_EXTERNAL_ENV_H |
| 21 | +#define STM32_EXTERNAL_ENV_H |
| 22 | + |
| 23 | +#ifdef __cplusplus |
| 24 | +extern "C" { |
| 25 | +#endif |
| 26 | + |
| 27 | +/* Exported types ------------------------------------------------------------*/ |
| 28 | +/* Exported constants --------------------------------------------------------*/ |
| 29 | + |
| 30 | +/* ########################## VDD Value #######################################*/ |
| 31 | +/** |
| 32 | + * @brief VDD Value. |
| 33 | + */ |
| 34 | +#if !defined (VDD_VALUE) |
| 35 | +#define VDD_VALUE 3300UL /*!< Value of VDD in mv */ |
| 36 | +#endif /* VDD_VALUE */ |
| 37 | + |
| 38 | +/* ########################## Oscillator Values adaptation ####################*/ |
| 39 | +/** |
| 40 | + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. |
| 41 | + * This value is used by the RCC HAL module to compute the system frequency |
| 42 | + * (when HSE is used as system clock source, directly or through the PSI). |
| 43 | + */ |
| 44 | +#if !defined (HSE_VALUE) |
| 45 | +#if defined(RCC_CR1_HSIDIV4ON) |
| 46 | +#define HSE_VALUE 16000000UL /*!< Value of the External oscillator in Hz */ |
| 47 | +#else |
| 48 | +#if defined(AHB4PERIPH_BASE) |
| 49 | +#define HSE_VALUE 48000000UL /*!< Value of the External oscillator in Hz */ |
| 50 | +#else |
| 51 | +#define HSE_VALUE 24000000UL /*!< Value of the External oscillator in Hz */ |
| 52 | +#endif /* AHB4PERIPH_BASE */ |
| 53 | +#endif /* RCC_CR1_HSIDIV4ON */ |
| 54 | +#endif /* HSE_VALUE */ |
| 55 | + |
| 56 | +#if !defined (HSE_STARTUP_TIMEOUT) |
| 57 | +#define HSE_STARTUP_TIMEOUT 100UL /*!< Time out for HSE start up, in ms */ |
| 58 | +#endif /* HSE_STARTUP_TIMEOUT */ |
| 59 | + |
| 60 | +/** |
| 61 | + * @brief External Low Speed oscillator (LSE) value. |
| 62 | + * This value is used by the UART, RTC HAL module to compute the system frequency |
| 63 | + */ |
| 64 | +#if !defined (LSE_VALUE) |
| 65 | +#define LSE_VALUE 32768UL /*!< Value of the External oscillator in Hz*/ |
| 66 | +#endif /* LSE_VALUE */ |
| 67 | + |
| 68 | +#if !defined (LSE_STARTUP_TIMEOUT) |
| 69 | +#define LSE_STARTUP_TIMEOUT 5000UL /*!< Time out for LSE start up, in ms */ |
| 70 | +#endif /* HSE_STARTUP_TIMEOUT */ |
| 71 | + |
| 72 | +/* Tip: To avoid modifying this file each time you need to use different HSE, |
| 73 | + === you can define the HSE value in your toolchain compiler preprocessor. */ |
| 74 | + |
| 75 | +#ifdef __cplusplus |
| 76 | +} |
| 77 | +#endif |
| 78 | + |
| 79 | +#endif /* STM32_EXTERNAL_ENV_H */ |
0 commit comments