Fahad Mirza
/
Nucleo_HXC900
A demo application for HXC900 LoRaWAN module using Nucleo-L053R8.
Driver/stm32l0xx_hal_conf.h@39:cb0e5a76ab15, 2019-01-24 (annotated)
- Committer:
- fahadmirza
- Date:
- Thu Jan 24 23:45:12 2019 +0000
- Revision:
- 39:cb0e5a76ab15
- Parent:
- 5:53302861bfea
Doxygen style header
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fahadmirza | 0:a0c5877bd360 | 1 | /** |
fahadmirza | 0:a0c5877bd360 | 2 | ****************************************************************************** |
fahadmirza | 0:a0c5877bd360 | 3 | * @file stm32l0xx_hal_conf.h |
fahadmirza | 0:a0c5877bd360 | 4 | * @brief HAL configuration file. |
fahadmirza | 0:a0c5877bd360 | 5 | ****************************************************************************** |
fahadmirza | 0:a0c5877bd360 | 6 | * @attention |
fahadmirza | 0:a0c5877bd360 | 7 | * |
fahadmirza | 0:a0c5877bd360 | 8 | * <h2><center>© COPYRIGHT(c) 2018 STMicroelectronics</center></h2> |
fahadmirza | 0:a0c5877bd360 | 9 | * |
fahadmirza | 0:a0c5877bd360 | 10 | * Redistribution and use in source and binary forms, with or without modification, |
fahadmirza | 0:a0c5877bd360 | 11 | * are permitted provided that the following conditions are met: |
fahadmirza | 0:a0c5877bd360 | 12 | * 1. Redistributions of source code must retain the above copyright notice, |
fahadmirza | 0:a0c5877bd360 | 13 | * this list of conditions and the following disclaimer. |
fahadmirza | 0:a0c5877bd360 | 14 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
fahadmirza | 0:a0c5877bd360 | 15 | * this list of conditions and the following disclaimer in the documentation |
fahadmirza | 0:a0c5877bd360 | 16 | * and/or other materials provided with the distribution. |
fahadmirza | 0:a0c5877bd360 | 17 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
fahadmirza | 0:a0c5877bd360 | 18 | * may be used to endorse or promote products derived from this software |
fahadmirza | 0:a0c5877bd360 | 19 | * without specific prior written permission. |
fahadmirza | 0:a0c5877bd360 | 20 | * |
fahadmirza | 0:a0c5877bd360 | 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
fahadmirza | 0:a0c5877bd360 | 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
fahadmirza | 0:a0c5877bd360 | 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
fahadmirza | 0:a0c5877bd360 | 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
fahadmirza | 0:a0c5877bd360 | 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
fahadmirza | 0:a0c5877bd360 | 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
fahadmirza | 0:a0c5877bd360 | 27 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
fahadmirza | 0:a0c5877bd360 | 28 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
fahadmirza | 0:a0c5877bd360 | 29 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
fahadmirza | 0:a0c5877bd360 | 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
fahadmirza | 0:a0c5877bd360 | 31 | * |
fahadmirza | 0:a0c5877bd360 | 32 | ****************************************************************************** |
fahadmirza | 0:a0c5877bd360 | 33 | */ |
fahadmirza | 0:a0c5877bd360 | 34 | |
fahadmirza | 0:a0c5877bd360 | 35 | /* Define to prevent recursive inclusion -------------------------------------*/ |
fahadmirza | 0:a0c5877bd360 | 36 | #ifndef __STM32L0xx_HAL_CONF_H |
fahadmirza | 0:a0c5877bd360 | 37 | #define __STM32L0xx_HAL_CONF_H |
fahadmirza | 0:a0c5877bd360 | 38 | |
fahadmirza | 0:a0c5877bd360 | 39 | #ifdef __cplusplus |
fahadmirza | 0:a0c5877bd360 | 40 | extern "C" { |
fahadmirza | 0:a0c5877bd360 | 41 | #endif |
fahadmirza | 0:a0c5877bd360 | 42 | |
fahadmirza | 0:a0c5877bd360 | 43 | /* Exported types ------------------------------------------------------------*/ |
fahadmirza | 0:a0c5877bd360 | 44 | /* Exported constants --------------------------------------------------------*/ |
fahadmirza | 0:a0c5877bd360 | 45 | #define HAL_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 46 | #define HAL_RTC_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 47 | #define HAL_UART_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 48 | #define HAL_GPIO_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 49 | #define HAL_DMA_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 50 | #define HAL_RCC_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 51 | #define HAL_RNG_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 52 | #define HAL_FLASH_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 53 | #define HAL_PWR_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 54 | #define HAL_CORTEX_MODULE_ENABLED |
fahadmirza | 0:a0c5877bd360 | 55 | |
fahadmirza | 0:a0c5877bd360 | 56 | /* ########################## Oscillator Values adaptation ####################*/ |
fahadmirza | 0:a0c5877bd360 | 57 | /** |
fahadmirza | 0:a0c5877bd360 | 58 | * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. |
fahadmirza | 0:a0c5877bd360 | 59 | * This value is used by the RCC HAL module to compute the system frequency |
fahadmirza | 0:a0c5877bd360 | 60 | * (when HSE is used as system clock source, directly or through the PLL). |
fahadmirza | 0:a0c5877bd360 | 61 | */ |
fahadmirza | 0:a0c5877bd360 | 62 | #if !defined (HSE_VALUE) |
fahadmirza | 0:a0c5877bd360 | 63 | #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ |
fahadmirza | 0:a0c5877bd360 | 64 | #endif /* HSE_VALUE */ |
fahadmirza | 0:a0c5877bd360 | 65 | |
fahadmirza | 0:a0c5877bd360 | 66 | #if !defined (HSE_STARTUP_TIMEOUT) |
fahadmirza | 0:a0c5877bd360 | 67 | #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ |
fahadmirza | 0:a0c5877bd360 | 68 | #endif /* HSE_STARTUP_TIMEOUT */ |
fahadmirza | 0:a0c5877bd360 | 69 | |
fahadmirza | 0:a0c5877bd360 | 70 | /** |
fahadmirza | 0:a0c5877bd360 | 71 | * @brief Internal Multiple Speed oscillator (MSI) default value. |
fahadmirza | 0:a0c5877bd360 | 72 | * This value is the default MSI range value after Reset. |
fahadmirza | 0:a0c5877bd360 | 73 | */ |
fahadmirza | 0:a0c5877bd360 | 74 | #if !defined (MSI_VALUE) |
fahadmirza | 0:a0c5877bd360 | 75 | #define MSI_VALUE ((uint32_t)2097000U) /*!< Value of the Internal oscillator in Hz*/ |
fahadmirza | 0:a0c5877bd360 | 76 | #endif /* MSI_VALUE */ |
fahadmirza | 0:a0c5877bd360 | 77 | |
fahadmirza | 0:a0c5877bd360 | 78 | /** |
fahadmirza | 0:a0c5877bd360 | 79 | * @brief Internal High Speed oscillator (HSI) value. |
fahadmirza | 0:a0c5877bd360 | 80 | * This value is used by the RCC HAL module to compute the system frequency |
fahadmirza | 0:a0c5877bd360 | 81 | * (when HSI is used as system clock source, directly or through the PLL). |
fahadmirza | 0:a0c5877bd360 | 82 | */ |
fahadmirza | 0:a0c5877bd360 | 83 | #if !defined (HSI_VALUE) |
fahadmirza | 0:a0c5877bd360 | 84 | #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ |
fahadmirza | 0:a0c5877bd360 | 85 | #endif /* HSI_VALUE */ |
fahadmirza | 0:a0c5877bd360 | 86 | |
fahadmirza | 0:a0c5877bd360 | 87 | /** |
fahadmirza | 0:a0c5877bd360 | 88 | * @brief Internal High Speed oscillator for USB (HSI48) value. |
fahadmirza | 0:a0c5877bd360 | 89 | */ |
fahadmirza | 0:a0c5877bd360 | 90 | #if !defined (HSI48_VALUE) |
fahadmirza | 0:a0c5877bd360 | 91 | #define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. |
fahadmirza | 0:a0c5877bd360 | 92 | The real value may vary depending on the variations |
fahadmirza | 0:a0c5877bd360 | 93 | in voltage and temperature. */ |
fahadmirza | 0:a0c5877bd360 | 94 | #endif /* HSI48_VALUE */ |
fahadmirza | 0:a0c5877bd360 | 95 | |
fahadmirza | 0:a0c5877bd360 | 96 | /** |
fahadmirza | 0:a0c5877bd360 | 97 | * @brief Internal Low Speed oscillator (LSI) value. |
fahadmirza | 0:a0c5877bd360 | 98 | */ |
fahadmirza | 0:a0c5877bd360 | 99 | #if !defined (LSI_VALUE) |
fahadmirza | 0:a0c5877bd360 | 100 | #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ |
fahadmirza | 0:a0c5877bd360 | 101 | #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz |
fahadmirza | 0:a0c5877bd360 | 102 | The real value may vary depending on the variations |
fahadmirza | 0:a0c5877bd360 | 103 | in voltage and temperature.*/ |
fahadmirza | 0:a0c5877bd360 | 104 | /** |
fahadmirza | 0:a0c5877bd360 | 105 | * @brief External Low Speed oscillator (LSE) value. |
fahadmirza | 0:a0c5877bd360 | 106 | * This value is used by the UART, RTC HAL module to compute the system frequency |
fahadmirza | 0:a0c5877bd360 | 107 | */ |
fahadmirza | 0:a0c5877bd360 | 108 | #if !defined (LSE_VALUE) |
fahadmirza | 0:a0c5877bd360 | 109 | #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ |
fahadmirza | 0:a0c5877bd360 | 110 | #endif /* LSE_VALUE */ |
fahadmirza | 0:a0c5877bd360 | 111 | |
fahadmirza | 0:a0c5877bd360 | 112 | #if !defined (LSE_STARTUP_TIMEOUT) |
fahadmirza | 0:a0c5877bd360 | 113 | #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ |
fahadmirza | 0:a0c5877bd360 | 114 | #endif /* LSE_STARTUP_TIMEOUT */ |
fahadmirza | 0:a0c5877bd360 | 115 | |
fahadmirza | 0:a0c5877bd360 | 116 | /* Tip: To avoid modifying this file each time you need to use different HSE, |
fahadmirza | 0:a0c5877bd360 | 117 | === you can define the HSE value in your toolchain compiler preprocessor. */ |
fahadmirza | 0:a0c5877bd360 | 118 | |
fahadmirza | 0:a0c5877bd360 | 119 | /* ########################### System Configuration ######################### */ |
fahadmirza | 0:a0c5877bd360 | 120 | /** |
fahadmirza | 0:a0c5877bd360 | 121 | * @brief This is the HAL system configuration section |
fahadmirza | 0:a0c5877bd360 | 122 | */ |
fahadmirza | 0:a0c5877bd360 | 123 | #define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ |
fahadmirza | 0:a0c5877bd360 | 124 | #define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ |
fahadmirza | 0:a0c5877bd360 | 125 | #define USE_RTOS 0U |
fahadmirza | 0:a0c5877bd360 | 126 | #define PREFETCH_ENABLE 0U |
fahadmirza | 0:a0c5877bd360 | 127 | #define PREREAD_ENABLE 1U |
fahadmirza | 0:a0c5877bd360 | 128 | #define BUFFER_CACHE_DISABLE 0U |
fahadmirza | 0:a0c5877bd360 | 129 | |
fahadmirza | 0:a0c5877bd360 | 130 | /* ########################## Assert Selection ############################## */ |
fahadmirza | 0:a0c5877bd360 | 131 | /** |
fahadmirza | 0:a0c5877bd360 | 132 | * @brief Uncomment the line below to expanse the "assert_param" macro in the |
fahadmirza | 0:a0c5877bd360 | 133 | * HAL drivers code |
fahadmirza | 0:a0c5877bd360 | 134 | */ |
fahadmirza | 0:a0c5877bd360 | 135 | /* #define USE_FULL_ASSERT 1 */ |
fahadmirza | 0:a0c5877bd360 | 136 | |
fahadmirza | 0:a0c5877bd360 | 137 | /* Includes ------------------------------------------------------------------*/ |
fahadmirza | 0:a0c5877bd360 | 138 | #include "stm32l0xx_hal_rcc.h" |
fahadmirza | 0:a0c5877bd360 | 139 | #include "stm32l0xx_hal_gpio.h" |
fahadmirza | 0:a0c5877bd360 | 140 | #include "stm32l0xx_hal_dma.h" |
fahadmirza | 0:a0c5877bd360 | 141 | #include "stm32l0xx_hal_cortex.h" |
fahadmirza | 0:a0c5877bd360 | 142 | #include "stm32l0xx_hal_flash.h" |
fahadmirza | 0:a0c5877bd360 | 143 | #include "stm32l0xx_hal_pwr.h" |
fahadmirza | 0:a0c5877bd360 | 144 | #include "stm32l0xx_hal_rng.h" |
fahadmirza | 0:a0c5877bd360 | 145 | #include "stm32l0xx_hal_rtc.h" |
fahadmirza | 0:a0c5877bd360 | 146 | #include "stm32l0xx_hal_uart.h" |
fahadmirza | 0:a0c5877bd360 | 147 | |
fahadmirza | 0:a0c5877bd360 | 148 | /* Exported macro ------------------------------------------------------------*/ |
fahadmirza | 0:a0c5877bd360 | 149 | #ifdef USE_FULL_ASSERT |
fahadmirza | 0:a0c5877bd360 | 150 | /** |
fahadmirza | 0:a0c5877bd360 | 151 | * @brief The assert_param macro is used for function's parameters check. |
fahadmirza | 0:a0c5877bd360 | 152 | * @param expr: If expr is false, it calls assert_failed function |
fahadmirza | 0:a0c5877bd360 | 153 | * which reports the name of the source file and the source |
fahadmirza | 0:a0c5877bd360 | 154 | * line number of the call that failed. |
fahadmirza | 0:a0c5877bd360 | 155 | * If expr is true, it returns no value. |
fahadmirza | 0:a0c5877bd360 | 156 | * @retval None |
fahadmirza | 0:a0c5877bd360 | 157 | */ |
fahadmirza | 0:a0c5877bd360 | 158 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) |
fahadmirza | 0:a0c5877bd360 | 159 | /* Exported functions ------------------------------------------------------- */ |
fahadmirza | 0:a0c5877bd360 | 160 | void assert_failed(uint8_t* file, uint32_t line); |
fahadmirza | 0:a0c5877bd360 | 161 | #else |
fahadmirza | 0:a0c5877bd360 | 162 | #define assert_param(expr) ((void)0U) |
fahadmirza | 0:a0c5877bd360 | 163 | #endif /* USE_FULL_ASSERT */ |
fahadmirza | 0:a0c5877bd360 | 164 | |
fahadmirza | 0:a0c5877bd360 | 165 | #ifdef __cplusplus |
fahadmirza | 0:a0c5877bd360 | 166 | } |
fahadmirza | 0:a0c5877bd360 | 167 | #endif |
fahadmirza | 0:a0c5877bd360 | 168 | |
fahadmirza | 0:a0c5877bd360 | 169 | #endif /* __STM32L0xx_HAL_CONF_H */ |
fahadmirza | 0:a0c5877bd360 | 170 | |
fahadmirza | 0:a0c5877bd360 | 171 | |
fahadmirza | 0:a0c5877bd360 | 172 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
fahadmirza | 0:a0c5877bd360 | 173 |