The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Wed Apr 12 16:07:08 2017 +0100
Revision:
140:97feb9bacc10
Parent:
128:9bcdf88f62b0
Child:
145:64910690c574
Release 140 of the mbed library

Ports for Upcoming Targets

3841: Add nRf52840 target https://github.com/ARMmbed/mbed-os/pull/3841
3992: Introducing UBLOX_C030 platform. https://github.com/ARMmbed/mbed-os/pull/3992

Fixes and Changes

3951: [NUCLEO_F303ZE] Correct ARDUINO pin https://github.com/ARMmbed/mbed-os/pull/3951
4021: Fixing a macro to detect when RTOS was in use for the NRF52840_DK https://github.com/ARMmbed/mbed-os/pull/4021
3979: KW24D: Add missing SPI defines and Arduino connector definitions https://github.com/ARMmbed/mbed-os/pull/3979
3990: UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the https://github.com/ARMmbed/mbed-os/pull/3990
4003: Fixed OBOE in async serial tx for NRF52 target, fixes #4002 https://github.com/ARMmbed/mbed-os/pull/4003
4012: STM32: Correct I2C master error handling https://github.com/ARMmbed/mbed-os/pull/4012
4020: NUCLEO_L011K4 remove unsupported tool chain files https://github.com/ARMmbed/mbed-os/pull/4020
4065: K66F: Move bss section to m_data_2 Section https://github.com/ARMmbed/mbed-os/pull/4065
4014: Issue 3763: Reduce heap allocation in the GCC linker file https://github.com/ARMmbed/mbed-os/pull/4014
4030: [STM32L0] reduce IAR heap and stack size for small targets https://github.com/ARMmbed/mbed-os/pull/4030
4109: NUCLEO_L476RG : minor serial pin update https://github.com/ARMmbed/mbed-os/pull/4109
3982: Ticker - kl25z bugfix for handling events in the past https://github.com/ARMmbed/mbed-os/pull/3982

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 122:f9eeca106725 1 /**
Kojto 122:f9eeca106725 2 ******************************************************************************
Kojto 122:f9eeca106725 3 * @file stm32l4xx_ll_utils.h
Kojto 122:f9eeca106725 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.5.1
Kojto 122:f9eeca106725 6 * @date 31-May-2016
Kojto 122:f9eeca106725 7 * @brief Header file of UTILS LL module.
Kojto 122:f9eeca106725 8 @verbatim
Kojto 122:f9eeca106725 9 ==============================================================================
Kojto 122:f9eeca106725 10 ##### How to use this driver #####
Kojto 122:f9eeca106725 11 ==============================================================================
Kojto 122:f9eeca106725 12 [..]
Kojto 122:f9eeca106725 13 The LL UTILS driver contains a set of generic APIs that can be
Kojto 122:f9eeca106725 14 used by user:
Kojto 122:f9eeca106725 15 (+) Device electronic signature
Kojto 122:f9eeca106725 16 (+) Timing functions
Kojto 122:f9eeca106725 17 (+) PLL configuration functions
Kojto 122:f9eeca106725 18
Kojto 122:f9eeca106725 19 @endverbatim
Kojto 122:f9eeca106725 20 ******************************************************************************
Kojto 122:f9eeca106725 21 * @attention
Kojto 122:f9eeca106725 22 *
Kojto 122:f9eeca106725 23 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 122:f9eeca106725 24 *
Kojto 122:f9eeca106725 25 * Redistribution and use in source and binary forms, with or without modification,
Kojto 122:f9eeca106725 26 * are permitted provided that the following conditions are met:
Kojto 122:f9eeca106725 27 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 122:f9eeca106725 28 * this list of conditions and the following disclaimer.
Kojto 122:f9eeca106725 29 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 122:f9eeca106725 30 * this list of conditions and the following disclaimer in the documentation
Kojto 122:f9eeca106725 31 * and/or other materials provided with the distribution.
Kojto 122:f9eeca106725 32 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 122:f9eeca106725 33 * may be used to endorse or promote products derived from this software
Kojto 122:f9eeca106725 34 * without specific prior written permission.
Kojto 122:f9eeca106725 35 *
Kojto 122:f9eeca106725 36 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 122:f9eeca106725 37 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 122:f9eeca106725 38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 122:f9eeca106725 39 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 122:f9eeca106725 40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 122:f9eeca106725 41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 122:f9eeca106725 42 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 122:f9eeca106725 43 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 122:f9eeca106725 44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 122:f9eeca106725 45 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 122:f9eeca106725 46 *
Kojto 122:f9eeca106725 47 ******************************************************************************
Kojto 122:f9eeca106725 48 */
Kojto 122:f9eeca106725 49
Kojto 122:f9eeca106725 50 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 122:f9eeca106725 51 #ifndef __STM32L4xx_LL_UTILS_H
Kojto 122:f9eeca106725 52 #define __STM32L4xx_LL_UTILS_H
Kojto 122:f9eeca106725 53
Kojto 122:f9eeca106725 54 #ifdef __cplusplus
Kojto 122:f9eeca106725 55 extern "C" {
Kojto 122:f9eeca106725 56 #endif
Kojto 122:f9eeca106725 57
Kojto 122:f9eeca106725 58 /* Includes ------------------------------------------------------------------*/
Kojto 122:f9eeca106725 59 #include "stm32l4xx.h"
Kojto 122:f9eeca106725 60
Kojto 122:f9eeca106725 61 /** @addtogroup STM32L4xx_LL_Driver
Kojto 122:f9eeca106725 62 * @{
Kojto 122:f9eeca106725 63 */
Kojto 122:f9eeca106725 64
Kojto 122:f9eeca106725 65 /** @defgroup UTILS_LL UTILS
Kojto 122:f9eeca106725 66 * @{
Kojto 122:f9eeca106725 67 */
Kojto 122:f9eeca106725 68
Kojto 122:f9eeca106725 69 /* Private types -------------------------------------------------------------*/
Kojto 122:f9eeca106725 70 /* Private variables ---------------------------------------------------------*/
Kojto 122:f9eeca106725 71
Kojto 122:f9eeca106725 72 /* Private constants ---------------------------------------------------------*/
Kojto 122:f9eeca106725 73 /** @defgroup UTILS_LL_Private_Constants UTILS Private Constants
Kojto 122:f9eeca106725 74 * @{
Kojto 122:f9eeca106725 75 */
Kojto 122:f9eeca106725 76
Kojto 122:f9eeca106725 77 /* Max delay can be used in LL_mDelay */
Kojto 122:f9eeca106725 78 #define LL_MAX_DELAY (uint32_t)0xFFFFFFFFU
Kojto 122:f9eeca106725 79
Kojto 122:f9eeca106725 80 /**
Kojto 122:f9eeca106725 81 * @brief Unique device ID register base address
Kojto 122:f9eeca106725 82 */
Kojto 122:f9eeca106725 83 #define UID_BASE_ADDRESS UID_BASE
Kojto 122:f9eeca106725 84
Kojto 122:f9eeca106725 85 /**
Kojto 122:f9eeca106725 86 * @brief Flash size data register base address
Kojto 122:f9eeca106725 87 */
Kojto 122:f9eeca106725 88 #define FLASHSIZE_BASE_ADDRESS FLASHSIZE_BASE
Kojto 122:f9eeca106725 89
Kojto 122:f9eeca106725 90 /**
Kojto 122:f9eeca106725 91 * @brief Package data register base address
Kojto 122:f9eeca106725 92 */
Kojto 122:f9eeca106725 93 #define PACKAGE_BASE_ADDRESS PACKAGE_BASE
Kojto 122:f9eeca106725 94
Kojto 122:f9eeca106725 95 /**
Kojto 122:f9eeca106725 96 * @}
Kojto 122:f9eeca106725 97 */
Kojto 122:f9eeca106725 98
Kojto 122:f9eeca106725 99 /* Private macros ------------------------------------------------------------*/
Kojto 122:f9eeca106725 100 /** @defgroup UTILS_LL_Private_Macros UTILS Private Macros
Kojto 122:f9eeca106725 101 * @{
Kojto 122:f9eeca106725 102 */
Kojto 122:f9eeca106725 103 /**
Kojto 122:f9eeca106725 104 * @}
Kojto 122:f9eeca106725 105 */
Kojto 122:f9eeca106725 106 /* Exported types ------------------------------------------------------------*/
Kojto 122:f9eeca106725 107 /** @defgroup UTILS_LL_ES_INIT UTILS Exported structures
Kojto 122:f9eeca106725 108 * @{
Kojto 122:f9eeca106725 109 */
Kojto 122:f9eeca106725 110 /**
Kojto 122:f9eeca106725 111 * @brief UTILS PLL structure definition
Kojto 122:f9eeca106725 112 */
Kojto 122:f9eeca106725 113 typedef struct
Kojto 122:f9eeca106725 114 {
Kojto 122:f9eeca106725 115 uint32_t PLLM; /*!< Division factor for PLL VCO input clock.
Kojto 122:f9eeca106725 116 This parameter can be a value of @ref RCC_LL_EC_PLLM_DIV
Kojto 122:f9eeca106725 117
Kojto 122:f9eeca106725 118 This feature can be modified afterwards using unitary function
Kojto 122:f9eeca106725 119 @ref LL_RCC_PLL_ConfigDomain_SYS(). */
Kojto 122:f9eeca106725 120
Kojto 122:f9eeca106725 121 uint32_t PLLN; /*!< Multiplication factor for PLL VCO output clock.
Kojto 122:f9eeca106725 122 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F
Kojto 122:f9eeca106725 123
Kojto 122:f9eeca106725 124 This feature can be modified afterwards using unitary function
Kojto 122:f9eeca106725 125 @ref LL_RCC_PLL_ConfigDomain_SYS(). */
Kojto 122:f9eeca106725 126
Kojto 122:f9eeca106725 127 uint32_t PLLR; /*!< Division for the main system clock.
Kojto 122:f9eeca106725 128 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF
Kojto 122:f9eeca106725 129
Kojto 122:f9eeca106725 130 This feature can be modified afterwards using unitary function
Kojto 122:f9eeca106725 131 @ref LL_RCC_PLL_ConfigDomain_SYS(). */
Kojto 122:f9eeca106725 132 } LL_UTILS_PLLInitTypeDef;
Kojto 122:f9eeca106725 133
Kojto 122:f9eeca106725 134 /**
Kojto 122:f9eeca106725 135 * @brief UTILS System, AHB and APB buses clock configuration structure definition
Kojto 122:f9eeca106725 136 */
Kojto 122:f9eeca106725 137 typedef struct
Kojto 122:f9eeca106725 138 {
Kojto 122:f9eeca106725 139 uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK).
Kojto 122:f9eeca106725 140 This parameter can be a value of @ref RCC_LL_EC_SYSCLK_DIV
Kojto 122:f9eeca106725 141
Kojto 122:f9eeca106725 142 This feature can be modified afterwards using unitary function
Kojto 122:f9eeca106725 143 @ref LL_RCC_SetAHBPrescaler(). */
Kojto 122:f9eeca106725 144
Kojto 122:f9eeca106725 145 uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).
Kojto 122:f9eeca106725 146 This parameter can be a value of @ref RCC_LL_EC_APB1_DIV
Kojto 122:f9eeca106725 147
Kojto 122:f9eeca106725 148 This feature can be modified afterwards using unitary function
Kojto 122:f9eeca106725 149 @ref LL_RCC_SetAPB1Prescaler(). */
Kojto 122:f9eeca106725 150
Kojto 122:f9eeca106725 151 uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).
Kojto 122:f9eeca106725 152 This parameter can be a value of @ref RCC_LL_EC_APB2_DIV
Kojto 122:f9eeca106725 153
Kojto 122:f9eeca106725 154 This feature can be modified afterwards using unitary function
Kojto 122:f9eeca106725 155 @ref LL_RCC_SetAPB2Prescaler(). */
Kojto 122:f9eeca106725 156
Kojto 122:f9eeca106725 157 } LL_UTILS_ClkInitTypeDef;
Kojto 122:f9eeca106725 158
Kojto 122:f9eeca106725 159 /**
Kojto 122:f9eeca106725 160 * @}
Kojto 122:f9eeca106725 161 */
Kojto 122:f9eeca106725 162
Kojto 122:f9eeca106725 163 /* Exported constants --------------------------------------------------------*/
Kojto 122:f9eeca106725 164 /** @defgroup UTILS_LL_Exported_Constants UTILS Exported Constants
Kojto 122:f9eeca106725 165 * @{
Kojto 122:f9eeca106725 166 */
Kojto 122:f9eeca106725 167
Kojto 122:f9eeca106725 168 /** @defgroup UTILS_EC_HSE_BYPASS HSE Bypass activation
Kojto 122:f9eeca106725 169 * @{
Kojto 122:f9eeca106725 170 */
Kojto 122:f9eeca106725 171 #define LL_UTILS_HSEBYPASS_OFF (uint32_t)0x00000000U /*!< HSE Bypass is not enabled */
Kojto 122:f9eeca106725 172 #define LL_UTILS_HSEBYPASS_ON (uint32_t)0x00000001U /*!< HSE Bypass is enabled */
Kojto 122:f9eeca106725 173 /**
Kojto 122:f9eeca106725 174 * @}
Kojto 122:f9eeca106725 175 */
Kojto 122:f9eeca106725 176
Kojto 122:f9eeca106725 177 /** @defgroup UTILS_EC_PACKAGETYPE PACKAGE TYPE
Kojto 122:f9eeca106725 178 * @{
Kojto 122:f9eeca106725 179 */
Kojto 122:f9eeca106725 180 #define LL_UTILS_PACKAGETYPE_LQFP64 (uint32_t)0x00000000U /*!< LQFP64 package type */
Kojto 122:f9eeca106725 181 #define LL_UTILS_PACKAGETYPE_WLCSP64 (uint32_t)0x00000001U /*!< WLCSP64 package type */
Kojto 122:f9eeca106725 182 #define LL_UTILS_PACKAGETYPE_LQFP100 (uint32_t)0x00000002U /*!< LQFP100 package type */
Kojto 122:f9eeca106725 183 #define LL_UTILS_PACKAGETYPE_BGA132 (uint32_t)0x00000003U /*!< BGA132 package type */
Kojto 122:f9eeca106725 184 #define LL_UTILS_PACKAGETYPE_LQFP144_CSP72 (uint32_t)0x00000004U /*!< LQFP144, WLCSP81 or WLCSP72 package type */
Kojto 122:f9eeca106725 185 #define LL_UTILS_PACKAGETYPE_UFQFPN32 (uint32_t)0x00000008U /*!< UFQFPN32 package type */
Kojto 122:f9eeca106725 186 #define LL_UTILS_PACKAGETYPE_UFQFPN48 (uint32_t)0x0000000AU /*!< UFQFPN48 package type */
Kojto 122:f9eeca106725 187 #define LL_UTILS_PACKAGETYPE_LQFP48 (uint32_t)0x0000000BU /*!< LQFP48 package type */
Kojto 122:f9eeca106725 188 #define LL_UTILS_PACKAGETYPE_WLCSP49 (uint32_t)0x0000000CU /*!< WLCSP49 package type */
Kojto 122:f9eeca106725 189 #define LL_UTILS_PACKAGETYPE_UFBGA64 (uint32_t)0x0000000DU /*!< UFBGA64 package type */
Kojto 122:f9eeca106725 190 #define LL_UTILS_PACKAGETYPE_UFBGA100 (uint32_t)0x0000000EU /*!< UFBGA100 package type */
Kojto 122:f9eeca106725 191 /**
Kojto 122:f9eeca106725 192 * @}
Kojto 122:f9eeca106725 193 */
Kojto 122:f9eeca106725 194
Kojto 122:f9eeca106725 195 /**
Kojto 122:f9eeca106725 196 * @}
Kojto 122:f9eeca106725 197 */
Kojto 122:f9eeca106725 198
Kojto 122:f9eeca106725 199 /* Exported macro ------------------------------------------------------------*/
Kojto 122:f9eeca106725 200
Kojto 122:f9eeca106725 201 /* Exported functions --------------------------------------------------------*/
Kojto 122:f9eeca106725 202 /** @defgroup UTILS_LL_Exported_Functions UTILS Exported Functions
Kojto 122:f9eeca106725 203 * @{
Kojto 122:f9eeca106725 204 */
Kojto 122:f9eeca106725 205
Kojto 122:f9eeca106725 206 /** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE
Kojto 122:f9eeca106725 207 * @{
Kojto 122:f9eeca106725 208 */
Kojto 122:f9eeca106725 209
Kojto 122:f9eeca106725 210 /**
Kojto 122:f9eeca106725 211 * @brief Get Word0 of the unique device identifier (UID based on 96 bits)
Kojto 122:f9eeca106725 212 * @retval UID[31:0]: X and Y coordinates on the wafer expressed in BCD format
Kojto 122:f9eeca106725 213 */
Kojto 122:f9eeca106725 214 __STATIC_INLINE uint32_t LL_GetUID_Word0(void)
Kojto 122:f9eeca106725 215 {
Kojto 122:f9eeca106725 216 return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));
Kojto 122:f9eeca106725 217 }
Kojto 122:f9eeca106725 218
Kojto 122:f9eeca106725 219 /**
Kojto 122:f9eeca106725 220 * @brief Get Word1 of the unique device identifier (UID based on 96 bits)
Kojto 122:f9eeca106725 221 * @retval UID[63:32]: Wafer number (UID[39:32]) & LOT_NUM[23:0] (UID[63:40])
Kojto 122:f9eeca106725 222 */
Kojto 122:f9eeca106725 223 __STATIC_INLINE uint32_t LL_GetUID_Word1(void)
Kojto 122:f9eeca106725 224 {
Kojto 122:f9eeca106725 225 return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));
Kojto 122:f9eeca106725 226 }
Kojto 122:f9eeca106725 227
Kojto 122:f9eeca106725 228 /**
Kojto 122:f9eeca106725 229 * @brief Get Word2 of the unique device identifier (UID based on 96 bits)
Kojto 122:f9eeca106725 230 * @retval UID[95:64]: Lot number (ASCII encoded) - LOT_NUM[55:24]
Kojto 122:f9eeca106725 231 */
Kojto 122:f9eeca106725 232 __STATIC_INLINE uint32_t LL_GetUID_Word2(void)
Kojto 122:f9eeca106725 233 {
Kojto 122:f9eeca106725 234 return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));
Kojto 122:f9eeca106725 235 }
Kojto 122:f9eeca106725 236
Kojto 122:f9eeca106725 237 /**
Kojto 122:f9eeca106725 238 * @brief Get Flash memory size
Kojto 122:f9eeca106725 239 * @note This bitfield indicates the size of the device Flash memory expressed in
Kojto 122:f9eeca106725 240 * Kbytes. As an example, 0x040 corresponds to 64 Kbytes.
Kojto 122:f9eeca106725 241 * @retval FLASH_SIZE[15:0]: Flash memory size
Kojto 122:f9eeca106725 242 */
Kojto 122:f9eeca106725 243 __STATIC_INLINE uint32_t LL_GetFlashSize(void)
Kojto 122:f9eeca106725 244 {
Kojto 122:f9eeca106725 245 return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)));
Kojto 122:f9eeca106725 246 }
Kojto 122:f9eeca106725 247
Kojto 122:f9eeca106725 248 /**
Kojto 122:f9eeca106725 249 * @brief Get Package type
Kojto 122:f9eeca106725 250 * @retval Returned value can be one of the following values:
Kojto 122:f9eeca106725 251 * @arg @ref LL_UTILS_PACKAGETYPE_LQFP64 (*)
Kojto 122:f9eeca106725 252 * @arg @ref LL_UTILS_PACKAGETYPE_LQFP100 (*)
Kojto 122:f9eeca106725 253 * @arg @ref LL_UTILS_PACKAGETYPE_BGA132 (*)
Kojto 122:f9eeca106725 254 * @arg @ref LL_UTILS_PACKAGETYPE_LQFP144_CSP72 (*)
Kojto 122:f9eeca106725 255 * @arg @ref LL_UTILS_PACKAGETYPE_UFQFPN32 (*)
Kojto 122:f9eeca106725 256 * @arg @ref LL_UTILS_PACKAGETYPE_UFQFPN48 (*)
Kojto 122:f9eeca106725 257 * @arg @ref LL_UTILS_PACKAGETYPE_LQFP48 (*)
Kojto 122:f9eeca106725 258 * @arg @ref LL_UTILS_PACKAGETYPE_WLCSP49 (*)
Kojto 122:f9eeca106725 259 * @arg @ref LL_UTILS_PACKAGETYPE_UFBGA64 (*)
Kojto 122:f9eeca106725 260 * @arg @ref LL_UTILS_PACKAGETYPE_UFBGA100 (*)
Kojto 122:f9eeca106725 261 *
Kojto 122:f9eeca106725 262 * (*) value not defined in all devices.
Kojto 122:f9eeca106725 263 */
Kojto 122:f9eeca106725 264 __STATIC_INLINE uint32_t LL_GetPackageType(void)
Kojto 122:f9eeca106725 265 {
Kojto 122:f9eeca106725 266 return (uint8_t)(READ_REG(*((uint32_t *)PACKAGE_BASE_ADDRESS)) & (uint32_t)0x1FU);
Kojto 122:f9eeca106725 267 }
Kojto 122:f9eeca106725 268
Kojto 122:f9eeca106725 269 /**
Kojto 122:f9eeca106725 270 * @}
Kojto 122:f9eeca106725 271 */
Kojto 122:f9eeca106725 272
Kojto 122:f9eeca106725 273 /** @defgroup UTILS_LL_EF_DELAY DELAY
Kojto 122:f9eeca106725 274 * @{
Kojto 122:f9eeca106725 275 */
Kojto 122:f9eeca106725 276
Kojto 122:f9eeca106725 277 /**
Kojto 122:f9eeca106725 278 * @brief This function configures the Cortex-M SysTick source of the time base.
Kojto 122:f9eeca106725 279 * @param HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro)
Kojto 122:f9eeca106725 280 * @note When a RTOS is used, it is recommended to avoid changing the SysTick
Kojto 122:f9eeca106725 281 * configuration by calling this function, for a delay use rather osDelay RTOS service.
Kojto 122:f9eeca106725 282 * @param Ticks Number of ticks
Kojto 122:f9eeca106725 283 * @retval None
Kojto 122:f9eeca106725 284 */
Kojto 122:f9eeca106725 285 __STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks)
Kojto 122:f9eeca106725 286 {
Kojto 122:f9eeca106725 287 /* Configure the SysTick to have interrupt in 1ms time base */
Kojto 122:f9eeca106725 288 SysTick->LOAD = (uint32_t)((HCLKFrequency / Ticks) - 1UL); /* set reload register */
Kojto 122:f9eeca106725 289 SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
Kojto 122:f9eeca106725 290 SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
Kojto 122:f9eeca106725 291 SysTick_CTRL_ENABLE_Msk; /* Enable the Systick Timer */
Kojto 122:f9eeca106725 292 }
Kojto 122:f9eeca106725 293
Kojto 122:f9eeca106725 294 void LL_Init1msTick(uint32_t HCLKFrequency);
Kojto 122:f9eeca106725 295 void LL_mDelay(uint32_t Delay);
Kojto 122:f9eeca106725 296
Kojto 122:f9eeca106725 297 /**
Kojto 122:f9eeca106725 298 * @}
Kojto 122:f9eeca106725 299 */
Kojto 122:f9eeca106725 300
Kojto 122:f9eeca106725 301 /** @defgroup UTILS_EF_SYSTEM SYSTEM
Kojto 122:f9eeca106725 302 * @{
Kojto 122:f9eeca106725 303 */
Kojto 122:f9eeca106725 304
Kojto 122:f9eeca106725 305 void LL_SetSystemCoreClock(uint32_t HCLKFrequency);
Kojto 122:f9eeca106725 306 ErrorStatus LL_PLL_ConfigSystemClock_MSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct,
Kojto 122:f9eeca106725 307 LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
Kojto 122:f9eeca106725 308 ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct,
Kojto 122:f9eeca106725 309 LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
Kojto 122:f9eeca106725 310 ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypass,
Kojto 122:f9eeca106725 311 LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
Kojto 122:f9eeca106725 312
Kojto 122:f9eeca106725 313 /**
Kojto 122:f9eeca106725 314 * @}
Kojto 122:f9eeca106725 315 */
Kojto 122:f9eeca106725 316
Kojto 122:f9eeca106725 317 /**
Kojto 122:f9eeca106725 318 * @}
Kojto 122:f9eeca106725 319 */
Kojto 122:f9eeca106725 320
Kojto 122:f9eeca106725 321 /**
Kojto 122:f9eeca106725 322 * @}
Kojto 122:f9eeca106725 323 */
Kojto 122:f9eeca106725 324
Kojto 122:f9eeca106725 325 /**
Kojto 122:f9eeca106725 326 * @}
Kojto 122:f9eeca106725 327 */
Kojto 122:f9eeca106725 328
Kojto 122:f9eeca106725 329 #ifdef __cplusplus
Kojto 122:f9eeca106725 330 }
Kojto 122:f9eeca106725 331 #endif
Kojto 122:f9eeca106725 332
Kojto 122:f9eeca106725 333 #endif /* __STM32L4xx_LL_UTILS_H */
Kojto 122:f9eeca106725 334
Kojto 122:f9eeca106725 335 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/