Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 9 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | 19 | ||
20 | @endverbatim |
20 | @endverbatim |
21 | ****************************************************************************** |
21 | ****************************************************************************** |
22 | * @attention |
22 | * @attention |
23 | * |
23 | * |
24 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
24 | * <h2><center>© Copyright (c) 2016 STMicroelectronics. |
- | 25 | * All rights reserved.</center></h2> |
|
25 | * |
26 | * |
26 | * Redistribution and use in source and binary forms, with or without modification, |
27 | * This software component is licensed by ST under BSD 3-Clause license, |
27 | * are permitted provided that the following conditions are met: |
28 | * the "License"; You may not use this file except in compliance with the |
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. |
29 | * License. You may obtain a copy of the License at: |
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 |
30 | * opensource.org/licenses/BSD-3-Clause |
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. |
- | |
47 | * |
31 | * |
48 | ****************************************************************************** |
32 | ****************************************************************************** |
49 | */ |
33 | */ |
50 | 34 | ||
51 | /* Includes ------------------------------------------------------------------*/ |
35 | /* Includes ------------------------------------------------------------------*/ |
Line 67... | Line 51... | ||
67 | 51 | ||
68 | /** @defgroup HAL_Private_Constants HAL Private Constants |
52 | /** @defgroup HAL_Private_Constants HAL Private Constants |
69 | * @{ |
53 | * @{ |
70 | */ |
54 | */ |
71 | /** |
55 | /** |
72 | * @brief STM32F1xx HAL Driver version number V1.1.3 |
56 | * @brief STM32F1xx HAL Driver version number V1.1.7 |
73 | */ |
57 | */ |
74 | #define __STM32F1xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */ |
58 | #define __STM32F1xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */ |
75 | #define __STM32F1xx_HAL_VERSION_SUB1 (0x01U) /*!< [23:16] sub1 version */ |
59 | #define __STM32F1xx_HAL_VERSION_SUB1 (0x01U) /*!< [23:16] sub1 version */ |
76 | #define __STM32F1xx_HAL_VERSION_SUB2 (0x03U) /*!< [15:8] sub2 version */ |
60 | #define __STM32F1xx_HAL_VERSION_SUB2 (0x07U) /*!< [15:8] sub2 version */ |
77 | #define __STM32F1xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */ |
61 | #define __STM32F1xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */ |
78 | #define __STM32F1xx_HAL_VERSION ((__STM32F1xx_HAL_VERSION_MAIN << 24)\ |
62 | #define __STM32F1xx_HAL_VERSION ((__STM32F1xx_HAL_VERSION_MAIN << 24)\ |
79 | |(__STM32F1xx_HAL_VERSION_SUB1 << 16)\ |
63 | |(__STM32F1xx_HAL_VERSION_SUB1 << 16)\ |
80 | |(__STM32F1xx_HAL_VERSION_SUB2 << 8 )\ |
64 | |(__STM32F1xx_HAL_VERSION_SUB2 << 8 )\ |
81 | |(__STM32F1xx_HAL_VERSION_RC)) |
65 | |(__STM32F1xx_HAL_VERSION_RC)) |
Line 331... | Line 315... | ||
331 | return uwTickPrio; |
315 | return uwTickPrio; |
332 | } |
316 | } |
333 | 317 | ||
334 | /** |
318 | /** |
335 | * @brief Set new tick Freq. |
319 | * @brief Set new tick Freq. |
336 | * @retval Status |
320 | * @retval status |
337 | */ |
321 | */ |
338 | HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq) |
322 | HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq) |
339 | { |
323 | { |
340 | HAL_StatusTypeDef status = HAL_OK; |
324 | HAL_StatusTypeDef status = HAL_OK; |
- | 325 | HAL_TickFreqTypeDef prevTickFreq; |
|
- | 326 | ||
341 | assert_param(IS_TICKFREQ(Freq)); |
327 | assert_param(IS_TICKFREQ(Freq)); |
342 | 328 | ||
343 | if (uwTickFreq != Freq) |
329 | if (uwTickFreq != Freq) |
344 | { |
330 | { |
- | 331 | /* Back up uwTickFreq frequency */ |
|
- | 332 | prevTickFreq = uwTickFreq; |
|
- | 333 | ||
- | 334 | /* Update uwTickFreq global variable used by HAL_InitTick() */ |
|
345 | uwTickFreq = Freq; |
335 | uwTickFreq = Freq; |
346 | 336 | ||
347 | /* Apply the new tick Freq */ |
337 | /* Apply the new tick Freq */ |
348 | status = HAL_InitTick(uwTickPrio); |
338 | status = HAL_InitTick(uwTickPrio); |
- | 339 | ||
- | 340 | if (status != HAL_OK) |
|
- | 341 | { |
|
- | 342 | /* Restore previous tick frequency */ |
|
- | 343 | uwTickFreq = prevTickFreq; |
|
- | 344 | } |
|
349 | } |
345 | } |
350 | 346 | ||
351 | return status; |
347 | return status; |
352 | } |
348 | } |
353 | 349 | ||
Line 459... | Line 455... | ||
459 | { |
455 | { |
460 | return ((DBGMCU->IDCODE) & IDCODE_DEVID_MASK); |
456 | return ((DBGMCU->IDCODE) & IDCODE_DEVID_MASK); |
461 | } |
457 | } |
462 | 458 | ||
463 | /** |
459 | /** |
- | 460 | * @brief Returns first word of the unique device identifier (UID based on 96 bits) |
|
- | 461 | * @retval Device identifier |
|
- | 462 | */ |
|
- | 463 | uint32_t HAL_GetUIDw0(void) |
|
- | 464 | { |
|
- | 465 | return(READ_REG(*((uint32_t *)UID_BASE))); |
|
- | 466 | } |
|
- | 467 | ||
- | 468 | /** |
|
- | 469 | * @brief Returns second word of the unique device identifier (UID based on 96 bits) |
|
- | 470 | * @retval Device identifier |
|
- | 471 | */ |
|
- | 472 | uint32_t HAL_GetUIDw1(void) |
|
- | 473 | { |
|
- | 474 | return(READ_REG(*((uint32_t *)(UID_BASE + 4U)))); |
|
- | 475 | } |
|
- | 476 | ||
- | 477 | /** |
|
- | 478 | * @brief Returns third word of the unique device identifier (UID based on 96 bits) |
|
- | 479 | * @retval Device identifier |
|
- | 480 | */ |
|
- | 481 | uint32_t HAL_GetUIDw2(void) |
|
- | 482 | { |
|
- | 483 | return(READ_REG(*((uint32_t *)(UID_BASE + 8U)))); |
|
- | 484 | } |
|
- | 485 | ||
- | 486 | /** |
|
464 | * @brief Enable the Debug Module during SLEEP mode |
487 | * @brief Enable the Debug Module during SLEEP mode |
465 | * @retval None |
488 | * @retval None |
466 | */ |
489 | */ |
467 | void HAL_DBGMCU_EnableDBGSleepMode(void) |
490 | void HAL_DBGMCU_EnableDBGSleepMode(void) |
468 | { |
491 | { |
Line 562... | Line 585... | ||
562 | { |
585 | { |
563 | CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); |
586 | CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); |
564 | } |
587 | } |
565 | 588 | ||
566 | /** |
589 | /** |
567 | * @brief Return the unique device identifier (UID based on 96 bits) |
- | |
568 | * @param UID pointer to 3 words array. |
- | |
569 | * @retval Device identifier |
- | |
570 | */ |
- | |
571 | void HAL_GetUID(uint32_t *UID) |
- | |
572 | { |
- | |
573 | UID[0] = (uint32_t)(READ_REG(*((uint32_t *)UID_BASE))); |
- | |
574 | UID[1] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 4U)))); |
- | |
575 | UID[2] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 8U)))); |
- | |
576 | } |
- | |
577 | - | ||
578 | /** |
- | |
579 | * @} |
590 | * @} |
580 | */ |
591 | */ |
581 | 592 | ||
582 | /** |
593 | /** |
583 | * @} |
594 | * @} |