21
21
******************************************************************************
22
22
* @attention
23
23
*
24
- * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
24
+ * <h2><center>© Copyright (c) 2017 STMicroelectronics.
25
+ * All rights reserved.</center></h2>
25
26
*
26
- * Redistribution and use in source and binary forms, with or without modification,
27
- * are permitted provided that the following conditions are met:
28
- * 1. Redistributions of source code must retain the above copyright notice,
29
- * this list of conditions and the following disclaimer.
30
- * 2. Redistributions in binary form must reproduce the above copyright notice,
31
- * this list of conditions and the following disclaimer in the documentation
32
- * and/or other materials provided with the distribution.
33
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
34
- * may be used to endorse or promote products derived from this software
35
- * without specific prior written permission.
36
- *
37
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
41
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ * This software component is licensed by ST under BSD 3-Clause license,
28
+ * the "License"; You may not use this file except in compliance with the
29
+ * License. You may obtain a copy of the License at:
30
+ * opensource.org/licenses/BSD-3-Clause
47
31
*
48
32
******************************************************************************
49
33
*/
66
50
* @{
67
51
*/
68
52
/**
69
- * @brief STM32F4xx HAL Driver version number V1.7.3
53
+ * @brief STM32F4xx HAL Driver version number V1.7.8
70
54
*/
71
55
#define __STM32F4xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
72
56
#define __STM32F4xx_HAL_VERSION_SUB1 (0x07U) /*!< [23:16] sub1 version */
73
- #define __STM32F4xx_HAL_VERSION_SUB2 (0x03U ) /*!< [15:8] sub2 version */
57
+ #define __STM32F4xx_HAL_VERSION_SUB2 (0x08U ) /*!< [15:8] sub2 version */
74
58
#define __STM32F4xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
75
59
#define __STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24U)\
76
60
|(__STM32F4xx_HAL_VERSION_SUB1 << 16U)\
@@ -357,14 +341,26 @@ uint32_t HAL_GetTickPrio(void)
357
341
HAL_StatusTypeDef HAL_SetTickFreq (HAL_TickFreqTypeDef Freq )
358
342
{
359
343
HAL_StatusTypeDef status = HAL_OK ;
344
+ HAL_TickFreqTypeDef prevTickFreq ;
345
+
360
346
assert_param (IS_TICKFREQ (Freq ));
361
347
362
348
if (uwTickFreq != Freq )
363
349
{
350
+ /* Back up uwTickFreq frequency */
351
+ prevTickFreq = uwTickFreq ;
352
+
353
+ /* Update uwTickFreq global variable used by HAL_InitTick() */
364
354
uwTickFreq = Freq ;
365
355
366
356
/* Apply the new tick Freq */
367
357
status = HAL_InitTick (uwTickPrio );
358
+
359
+ if (status != HAL_OK )
360
+ {
361
+ /* Restore previous tick frequency */
362
+ uwTickFreq = prevTickFreq ;
363
+ }
368
364
}
369
365
370
366
return status ;
@@ -542,23 +538,38 @@ void HAL_DisableCompensationCell(void)
542
538
}
543
539
544
540
/**
545
- * @brief Return the unique device identifier (UID based on 96 bits)
546
- * @param UID pointer to 3 words array.
541
+ * @brief Returns first word of the unique device identifier (UID based on 96 bits)
542
+ * @retval Device identifier
543
+ */
544
+ uint32_t HAL_GetUIDw0 (void )
545
+ {
546
+ return (READ_REG (* ((uint32_t * )UID_BASE )));
547
+ }
548
+
549
+ /**
550
+ * @brief Returns second word of the unique device identifier (UID based on 96 bits)
551
+ * @retval Device identifier
552
+ */
553
+ uint32_t HAL_GetUIDw1 (void )
554
+ {
555
+ return (READ_REG (* ((uint32_t * )(UID_BASE + 4U ))));
556
+ }
557
+
558
+ /**
559
+ * @brief Returns third word of the unique device identifier (UID based on 96 bits)
547
560
* @retval Device identifier
548
561
*/
549
- void HAL_GetUID ( uint32_t * UID )
562
+ uint32_t HAL_GetUIDw2 ( void )
550
563
{
551
- UID [0 ] = (uint32_t )(READ_REG (* ((uint32_t * )UID_BASE )));
552
- UID [1 ] = (uint32_t )(READ_REG (* ((uint32_t * )(UID_BASE + 4U ))));
553
- UID [2 ] = (uint32_t )(READ_REG (* ((uint32_t * )(UID_BASE + 8U ))));
564
+ return (READ_REG (* ((uint32_t * )(UID_BASE + 8U ))));
554
565
}
555
566
556
567
#if defined(STM32F427xx ) || defined(STM32F437xx ) || defined(STM32F429xx )|| defined(STM32F439xx ) || \
557
568
defined(STM32F469xx ) || defined(STM32F479xx )
558
569
/**
559
570
* @brief Enables the Internal FLASH Bank Swapping.
560
571
*
561
- * @note This function can be used only for STM32F42xxx/43xxx devices.
572
+ * @note This function can be used only for STM32F42xxx/43xxx/469xx/479xx devices.
562
573
*
563
574
* @note Flash Bank2 mapped at 0x08000000 (and aliased @0x00000000)
564
575
* and Flash Bank1 mapped at 0x08100000 (and aliased at 0x00100000)
@@ -573,7 +584,7 @@ void HAL_EnableMemorySwappingBank(void)
573
584
/**
574
585
* @brief Disables the Internal FLASH Bank Swapping.
575
586
*
576
- * @note This function can be used only for STM32F42xxx/43xxx devices.
587
+ * @note This function can be used only for STM32F42xxx/43xxx/469xx/479xx devices.
577
588
*
578
589
* @note The default state : Flash Bank1 mapped at 0x08000000 (and aliased @0x00000000)
579
590
* and Flash Bank2 mapped at 0x08100000 (and aliased at 0x00100000)
0 commit comments