Rev 61 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 61 | Rev 77 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /** |
1 | /** |
2 | ****************************************************************************** |
2 | ****************************************************************************** |
3 | * @file stm32l1xx_ll_crc.c |
3 | * @file stm32l1xx_ll_crc.c |
4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
5 | * @brief CRC LL module driver. |
5 | * @brief CRC LL module driver. |
6 | ****************************************************************************** |
6 | ****************************************************************************** |
7 | * @attention |
7 | * @attention |
8 | * |
8 | * |
9 | * <h2><center>© Copyright (c) 2017 STMicroelectronics. |
9 | * Copyright (c) 2017 STMicroelectronics. |
10 | * All rights reserved.</center></h2> |
10 | * All rights reserved. |
11 | * |
11 | * |
12 | * This software component is licensed by ST under BSD 3-Clause license, |
12 | * This software is licensed under terms that can be found in the LICENSE file |
13 | * the "License"; You may not use this file except in compliance with the |
13 | * in the root directory of this software component. |
14 | * License. You may obtain a copy of the License at: |
14 | * If no LICENSE file comes with this software, it is provided AS-IS. |
15 | * opensource.org/licenses/BSD-3-Clause |
15 | * |
16 | * |
16 | ****************************************************************************** |
17 | ****************************************************************************** |
17 | */ |
18 | */ |
18 | #if defined(USE_FULL_LL_DRIVER) |
19 | #if defined(USE_FULL_LL_DRIVER) |
19 | |
20 | 20 | /* Includes ------------------------------------------------------------------*/ |
|
21 | /* Includes ------------------------------------------------------------------*/ |
21 | #include "stm32l1xx_ll_crc.h" |
22 | #include "stm32l1xx_ll_crc.h" |
22 | #include "stm32l1xx_ll_bus.h" |
23 | #include "stm32l1xx_ll_bus.h" |
23 | |
24 | 24 | #ifdef USE_FULL_ASSERT |
|
25 | #ifdef USE_FULL_ASSERT |
25 | #include "stm32_assert.h" |
26 | #include "stm32_assert.h" |
26 | #else |
27 | #else |
27 | #define assert_param(expr) ((void)0U) |
28 | #define assert_param(expr) ((void)0U) |
28 | #endif /* USE_FULL_ASSERT */ |
29 | #endif/* USE_FULL_ASSERT */ |
29 | |
30 | 30 | /** @addtogroup STM32L1xx_LL_Driver |
|
31 | /** @addtogroup STM32L1xx_LL_Driver |
31 | * @{ |
32 | * @{ |
32 | */ |
33 | */ |
33 | |
34 | 34 | #if defined (CRC) |
|
35 | #if defined (CRC) |
35 | |
36 | 36 | /** @addtogroup CRC_LL |
|
37 | /** @addtogroup CRC_LL |
37 | * @{ |
38 | * @{ |
38 | */ |
39 | */ |
39 | |
40 | 40 | /* Private types -------------------------------------------------------------*/ |
|
41 | /* Private types -------------------------------------------------------------*/ |
41 | /* Private variables ---------------------------------------------------------*/ |
42 | /* Private variables ---------------------------------------------------------*/ |
42 | /* Private constants ---------------------------------------------------------*/ |
43 | /* Private constants ---------------------------------------------------------*/ |
43 | /* Private macros ------------------------------------------------------------*/ |
44 | /* Private macros ------------------------------------------------------------*/ |
44 | /* Private function prototypes -----------------------------------------------*/ |
45 | /* Private function prototypes -----------------------------------------------*/ |
45 | |
46 | 46 | /* Exported functions --------------------------------------------------------*/ |
|
47 | /* Exported functions --------------------------------------------------------*/ |
47 | /** @addtogroup CRC_LL_Exported_Functions |
48 | /** @addtogroup CRC_LL_Exported_Functions |
48 | * @{ |
49 | * @{ |
49 | */ |
50 | */ |
50 | |
51 | 51 | /** @addtogroup CRC_LL_EF_Init |
|
52 | /** @addtogroup CRC_LL_EF_Init |
52 | * @{ |
53 | * @{ |
53 | */ |
54 | */ |
54 | |
55 | 55 | /** |
|
56 | /** |
56 | * @brief De-initialize CRC registers (Registers restored to their default values). |
57 | * @brief De-initialize CRC registers (Registers restored to their default values). |
57 | * @param CRCx CRC Instance |
58 | * @param CRCx CRC Instance |
58 | * @retval An ErrorStatus enumeration value: |
59 | * @retval An ErrorStatus enumeration value: |
59 | * - SUCCESS: CRC registers are de-initialized |
60 | * - SUCCESS: CRC registers are de-initialized |
60 | * - ERROR: CRC registers are not de-initialized |
61 | * - ERROR: CRC registers are not de-initialized |
61 | */ |
62 | */ |
62 | ErrorStatus LL_CRC_DeInit(const CRC_TypeDef *CRCx) |
63 | ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx) |
63 | { |
64 | { |
64 | ErrorStatus status = SUCCESS; |
65 | ErrorStatus status = SUCCESS; |
65 | |
66 | 66 | /* Check the parameters */ |
|
67 | /* Check the parameters */ |
67 | assert_param(IS_CRC_ALL_INSTANCE(CRCx)); |
68 | assert_param(IS_CRC_ALL_INSTANCE(CRCx)); |
68 | |
69 | 69 | if (CRCx == CRC) |
|
70 | if (CRCx == CRC) |
70 | { |
71 | { |
71 | /* Force CRC reset */ |
72 | /* Force CRC reset */ |
72 | LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC); |
73 | LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC); |
73 | |
74 | 74 | /* Release CRC reset */ |
|
75 | /* Release CRC reset */ |
75 | LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC); |
76 | LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC); |
76 | } |
77 | } |
77 | else |
78 | else |
78 | { |
79 | { |
79 | status = ERROR; |
80 | status = ERROR; |
80 | } |
81 | } |
81 | |
82 | 82 | return (status); |
|
83 | return (status); |
83 | } |
84 | } |
84 | |
85 | 85 | /** |
|
86 | /** |
86 | * @} |
87 | * @} |
87 | */ |
88 | */ |
88 | |
89 | 89 | /** |
|
90 | /** |
90 | * @} |
91 | * @} |
91 | */ |
92 | */ |
92 | |
93 | 93 | /** |
|
94 | /** |
94 | * @} |
95 | * @} |
95 | */ |
96 | */ |
96 | |
97 | 97 | #endif /* defined (CRC) */ |
|
98 | #endif /* defined (CRC) */ |
98 | |
99 | 99 | /** |
|
100 | /** |
100 | * @} |
101 | * @} |
101 | */ |
102 | */ |
102 | |
103 | 103 | #endif /* USE_FULL_LL_DRIVER */ |
|
104 | #endif /* USE_FULL_LL_DRIVER */ |
- | |
105 | - | ||
106 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
- | |
107 | - |