Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 9 | ||
---|---|---|---|
Line 4... | Line 4... | ||
4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
5 | * @brief Header file of CRC LL module. |
5 | * @brief Header file of CRC LL module. |
6 | ****************************************************************************** |
6 | ****************************************************************************** |
7 | * @attention |
7 | * @attention |
8 | * |
8 | * |
9 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
9 | * <h2><center>© Copyright (c) 2016 STMicroelectronics. |
- | 10 | * All rights reserved.</center></h2> |
|
10 | * |
11 | * |
11 | * Redistribution and use in source and binary forms, with or without modification, |
12 | * This software component is licensed by ST under BSD 3-Clause license, |
12 | * are permitted provided that the following conditions are met: |
13 | * the "License"; You may not use this file except in compliance with the |
13 | * 1. Redistributions of source code must retain the above copyright notice, |
- | |
14 | * this list of conditions and the following disclaimer. |
- | |
15 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
- | |
16 | * this list of conditions and the following disclaimer in the documentation |
- | |
17 | * and/or other materials provided with the distribution. |
14 | * License. You may obtain a copy of the License at: |
18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
- | |
19 | * may be used to endorse or promote products derived from this software |
15 | * opensource.org/licenses/BSD-3-Clause |
20 | * without specific prior written permission. |
- | |
21 | * |
- | |
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
- | |
23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
- | |
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
- | |
25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
- | |
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
- | |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
- | |
28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
- | |
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
- | |
30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
- | |
31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- | |
32 | * |
16 | * |
33 | ****************************************************************************** |
17 | ****************************************************************************** |
34 | */ |
18 | */ |
35 | 19 | ||
36 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
37 | #ifndef __STM32F1xx_LL_CRC_H |
21 | #ifndef STM32F1xx_LL_CRC_H |
38 | #define __STM32F1xx_LL_CRC_H |
22 | #define STM32F1xx_LL_CRC_H |
39 | 23 | ||
40 | #ifdef __cplusplus |
24 | #ifdef __cplusplus |
41 | extern "C" { |
25 | extern "C" { |
42 | #endif |
26 | #endif |
43 | 27 | ||
Line 59... | Line 43... | ||
59 | /* Private constants ---------------------------------------------------------*/ |
43 | /* Private constants ---------------------------------------------------------*/ |
60 | /* Private macros ------------------------------------------------------------*/ |
44 | /* Private macros ------------------------------------------------------------*/ |
61 | 45 | ||
62 | /* Exported types ------------------------------------------------------------*/ |
46 | /* Exported types ------------------------------------------------------------*/ |
63 | /* Exported constants --------------------------------------------------------*/ |
47 | /* Exported constants --------------------------------------------------------*/ |
- | 48 | /** @defgroup CRC_LL_Exported_Constants CRC Exported Constants |
|
- | 49 | * @{ |
|
- | 50 | */ |
|
- | 51 | ||
- | 52 | /** |
|
- | 53 | * @} |
|
- | 54 | */ |
|
64 | 55 | ||
65 | /* Exported macro ------------------------------------------------------------*/ |
56 | /* Exported macro ------------------------------------------------------------*/ |
66 | /** @defgroup CRC_LL_Exported_Macros CRC Exported Macros |
57 | /** @defgroup CRC_LL_Exported_Macros CRC Exported Macros |
67 | * @{ |
58 | * @{ |
68 | */ |
59 | */ |
Line 76... | Line 67... | ||
76 | * @param __INSTANCE__ CRC Instance |
67 | * @param __INSTANCE__ CRC Instance |
77 | * @param __REG__ Register to be written |
68 | * @param __REG__ Register to be written |
78 | * @param __VALUE__ Value to be written in the register |
69 | * @param __VALUE__ Value to be written in the register |
79 | * @retval None |
70 | * @retval None |
80 | */ |
71 | */ |
81 | #define LL_CRC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) |
72 | #define LL_CRC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, __VALUE__) |
82 | 73 | ||
83 | /** |
74 | /** |
84 | * @brief Read a value in CRC register |
75 | * @brief Read a value in CRC register |
85 | * @param __INSTANCE__ CRC Instance |
76 | * @param __INSTANCE__ CRC Instance |
86 | * @param __REG__ Register to be read |
77 | * @param __REG__ Register to be read |
Line 105... | Line 96... | ||
105 | * @{ |
96 | * @{ |
106 | */ |
97 | */ |
107 | 98 | ||
108 | /** |
99 | /** |
109 | * @brief Reset the CRC calculation unit. |
100 | * @brief Reset the CRC calculation unit. |
- | 101 | * @note If Programmable Initial CRC value feature |
|
- | 102 | * is available, also set the Data Register to the value stored in the |
|
- | 103 | * CRC_INIT register, otherwise, reset Data Register to its default value. |
|
110 | * @rmtoll CR RESET LL_CRC_ResetCRCCalculationUnit |
104 | * @rmtoll CR RESET LL_CRC_ResetCRCCalculationUnit |
111 | * @param CRCx CRC Instance |
105 | * @param CRCx CRC Instance |
112 | * @retval None |
106 | * @retval None |
113 | */ |
107 | */ |
114 | __STATIC_INLINE void LL_CRC_ResetCRCCalculationUnit(CRC_TypeDef *CRCx) |
108 | __STATIC_INLINE void LL_CRC_ResetCRCCalculationUnit(CRC_TypeDef *CRCx) |
115 | { |
109 | { |
116 | WRITE_REG(CRCx->CR, CRC_CR_RESET); |
110 | SET_BIT(CRCx->CR, CRC_CR_RESET); |
117 | } |
111 | } |
118 | 112 | ||
119 | /** |
113 | /** |
120 | * @} |
114 | * @} |
121 | */ |
115 | */ |
Line 162... | Line 156... | ||
162 | /** |
156 | /** |
163 | * @brief Store data in the Independent Data(IDR) register. |
157 | * @brief Store data in the Independent Data(IDR) register. |
164 | * @note This register can be used as a temporary storage location for one byte. |
158 | * @note This register can be used as a temporary storage location for one byte. |
165 | * @rmtoll IDR IDR LL_CRC_Write_IDR |
159 | * @rmtoll IDR IDR LL_CRC_Write_IDR |
166 | * @param CRCx CRC Instance |
160 | * @param CRCx CRC Instance |
167 | * @param InData value to be stored in CRC_IDR register (8-bit) between between Min_Data=0 and Max_Data=0xFF |
161 | * @param InData value to be stored in CRC_IDR register (8-bit) between Min_Data=0 and Max_Data=0xFF |
168 | * @retval None |
162 | * @retval None |
169 | */ |
163 | */ |
170 | __STATIC_INLINE void LL_CRC_Write_IDR(CRC_TypeDef *CRCx, uint32_t InData) |
164 | __STATIC_INLINE void LL_CRC_Write_IDR(CRC_TypeDef *CRCx, uint32_t InData) |
171 | { |
165 | { |
172 | *((uint8_t __IO *)(&CRCx->IDR)) = (uint8_t) InData; |
166 | *((uint8_t __IO *)(&CRCx->IDR)) = (uint8_t) InData; |
Line 203... | Line 197... | ||
203 | 197 | ||
204 | #ifdef __cplusplus |
198 | #ifdef __cplusplus |
205 | } |
199 | } |
206 | #endif |
200 | #endif |
207 | 201 | ||
208 | #endif /* __STM32F1xx_LL_CRC_H */ |
202 | #endif /* STM32F1xx_LL_CRC_H */ |
209 | 203 | ||
210 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
204 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |