Rev 56 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 56 | Rev 77 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /** |
1 | /** |
2 | ****************************************************************************** |
2 | ****************************************************************************** |
3 | * @file stm32l1xx_hal_crc.h |
3 | * @file stm32l1xx_hal_crc.h |
4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
5 | * @brief Header file of CRC HAL module. |
5 | * @brief Header file of CRC HAL module. |
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 | |
19 | 19 | /* Define to prevent recursive inclusion -------------------------------------*/ |
|
20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | #ifndef STM32L1xx_HAL_CRC_H |
21 | #ifndef STM32L1xx_HAL_CRC_H |
21 | #define STM32L1xx_HAL_CRC_H |
22 | #define STM32L1xx_HAL_CRC_H |
22 | |
23 | 23 | #ifdef __cplusplus |
|
24 | #ifdef __cplusplus |
24 | extern "C" { |
25 | extern "C" { |
25 | #endif |
26 | #endif |
26 | |
27 | 27 | /* Includes ------------------------------------------------------------------*/ |
|
28 | /* Includes ------------------------------------------------------------------*/ |
28 | #include "stm32l1xx_hal_def.h" |
29 | #include "stm32l1xx_hal_def.h" |
29 | |
30 | 30 | /** @addtogroup STM32L1xx_HAL_Driver |
|
31 | /** @addtogroup STM32L1xx_HAL_Driver |
31 | * @{ |
32 | * @{ |
32 | */ |
33 | */ |
33 | |
34 | 34 | /** @addtogroup CRC |
|
35 | /** @addtogroup CRC |
35 | * @{ |
36 | * @{ |
36 | */ |
37 | */ |
37 | |
38 | 38 | /* Exported types ------------------------------------------------------------*/ |
|
39 | /* Exported types ------------------------------------------------------------*/ |
39 | /** @defgroup CRC_Exported_Types CRC Exported Types |
40 | /** @defgroup CRC_Exported_Types CRC Exported Types |
40 | * @{ |
41 | * @{ |
41 | */ |
42 | */ |
42 | |
43 | 43 | /** |
|
44 | /** |
44 | * @brief CRC HAL State Structure definition |
45 | * @brief CRC HAL State Structure definition |
45 | */ |
46 | */ |
46 | typedef enum |
47 | typedef enum |
47 | { |
48 | { |
48 | HAL_CRC_STATE_RESET = 0x00U, /*!< CRC not yet initialized or disabled */ |
49 | HAL_CRC_STATE_RESET = 0x00U, /*!< CRC not yet initialized or disabled */ |
49 | HAL_CRC_STATE_READY = 0x01U, /*!< CRC initialized and ready for use */ |
50 | HAL_CRC_STATE_READY = 0x01U, /*!< CRC initialized and ready for use */ |
50 | HAL_CRC_STATE_BUSY = 0x02U, /*!< CRC internal process is ongoing */ |
51 | HAL_CRC_STATE_BUSY = 0x02U, /*!< CRC internal process is ongoing */ |
51 | HAL_CRC_STATE_TIMEOUT = 0x03U, /*!< CRC timeout state */ |
52 | HAL_CRC_STATE_TIMEOUT = 0x03U, /*!< CRC timeout state */ |
52 | HAL_CRC_STATE_ERROR = 0x04U /*!< CRC error state */ |
53 | HAL_CRC_STATE_ERROR = 0x04U /*!< CRC error state */ |
53 | } HAL_CRC_StateTypeDef; |
54 | } HAL_CRC_StateTypeDef; |
54 | |
55 | 55 | ||
56 | 56 | /** |
|
57 | /** |
57 | * @brief CRC Handle Structure definition |
58 | * @brief CRC Handle Structure definition |
58 | */ |
59 | */ |
59 | typedef struct |
60 | typedef struct |
60 | { |
61 | { |
61 | CRC_TypeDef *Instance; /*!< Register base address */ |
62 | CRC_TypeDef *Instance; /*!< Register base address */ |
62 | |
63 | 63 | HAL_LockTypeDef Lock; /*!< CRC Locking object */ |
|
64 | HAL_LockTypeDef Lock; /*!< CRC Locking object */ |
64 | |
65 | 65 | __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */ |
|
66 | __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */ |
66 | |
67 | 67 | } CRC_HandleTypeDef; |
|
68 | } CRC_HandleTypeDef; |
68 | /** |
69 | /** |
69 | * @} |
70 | * @} |
70 | */ |
71 | */ |
71 | |
72 | 72 | /* Exported constants --------------------------------------------------------*/ |
|
73 | /* Exported constants --------------------------------------------------------*/ |
73 | /** @defgroup CRC_Exported_Constants CRC Exported Constants |
74 | /** @defgroup CRC_Exported_Constants CRC Exported Constants |
74 | * @{ |
75 | * @{ |
75 | */ |
76 | */ |
76 | |
77 | 77 | /** |
|
78 | /** |
78 | * @} |
79 | * @} |
79 | */ |
80 | */ |
80 | |
81 | 81 | /* Exported macros -----------------------------------------------------------*/ |
|
82 | /* Exported macros -----------------------------------------------------------*/ |
82 | /** @defgroup CRC_Exported_Macros CRC Exported Macros |
83 | /** @defgroup CRC_Exported_Macros CRC Exported Macros |
83 | * @{ |
84 | * @{ |
84 | */ |
85 | */ |
85 | |
86 | 86 | /** @brief Reset CRC handle state. |
|
87 | /** @brief Reset CRC handle state. |
87 | * @param __HANDLE__ CRC handle. |
88 | * @param __HANDLE__ CRC handle. |
88 | * @retval None |
89 | * @retval None |
89 | */ |
90 | */ |
90 | #define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET) |
91 | #define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET) |
91 | |
92 | 92 | /** |
|
93 | /** |
93 | * @brief Reset CRC Data Register. |
94 | * @brief Reset CRC Data Register. |
94 | * @param __HANDLE__ CRC handle |
95 | * @param __HANDLE__ CRC handle |
95 | * @retval None |
96 | * @retval None |
96 | */ |
97 | */ |
97 | #define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET) |
98 | #define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET) |
98 | |
99 | 99 | /** |
|
100 | /** |
100 | * @brief Store data in the Independent Data (ID) register. |
101 | * @brief Store data in the Independent Data (ID) register. |
101 | * @param __HANDLE__ CRC handle |
102 | * @param __HANDLE__ CRC handle |
102 | * @param __VALUE__ Value to be stored in the ID register |
103 | * @param __VALUE__ Value to be stored in the ID register |
103 | * @note Refer to the Reference Manual to get the authorized __VALUE__ length in bits |
104 | * @note Refer to the Reference Manual to get the authorized __VALUE__ length in bits |
104 | * @retval None |
105 | * @retval None |
105 | */ |
106 | */ |
106 | #define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (WRITE_REG((__HANDLE__)->Instance->IDR, (__VALUE__))) |
107 | #define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (WRITE_REG((__HANDLE__)->Instance->IDR, (__VALUE__))) |
107 | |
108 | 108 | /** |
|
109 | /** |
109 | * @brief Return the data stored in the Independent Data (ID) register. |
110 | * @brief Return the data stored in the Independent Data (ID) register. |
110 | * @param __HANDLE__ CRC handle |
111 | * @param __HANDLE__ CRC handle |
111 | * @note Refer to the Reference Manual to get the authorized __VALUE__ length in bits |
112 | * @note Refer to the Reference Manual to get the authorized __VALUE__ length in bits |
112 | * @retval Value of the ID register |
113 | * @retval Value of the ID register |
113 | */ |
114 | */ |
114 | #define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR) |
115 | #define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR) |
115 | /** |
116 | /** |
116 | * @} |
117 | * @} |
117 | */ |
118 | */ |
118 | |
119 | 119 | ||
120 | 120 | /* Private macros --------------------------------------------------------*/ |
|
121 | /* Private macros --------------------------------------------------------*/ |
121 | /** @defgroup CRC_Private_Macros CRC Private Macros |
122 | /** @defgroup CRC_Private_Macros CRC Private Macros |
122 | * @{ |
123 | * @{ |
123 | */ |
124 | */ |
124 | |
125 | 125 | /** |
|
126 | /** |
126 | * @} |
127 | * @} |
127 | */ |
128 | */ |
128 | |
129 | 129 | /* Exported functions --------------------------------------------------------*/ |
|
130 | /* Exported functions --------------------------------------------------------*/ |
130 | /** @defgroup CRC_Exported_Functions CRC Exported Functions |
131 | /** @defgroup CRC_Exported_Functions CRC Exported Functions |
131 | * @{ |
132 | * @{ |
132 | */ |
133 | */ |
133 | |
134 | 134 | /* Initialization and de-initialization functions ****************************/ |
|
135 | /* Initialization and de-initialization functions ****************************/ |
135 | /** @defgroup CRC_Exported_Functions_Group1 Initialization and de-initialization functions |
136 | /** @defgroup CRC_Exported_Functions_Group1 Initialization and de-initialization functions |
136 | * @{ |
137 | * @{ |
137 | */ |
138 | */ |
138 | HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc); |
139 | HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc); |
139 | HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc); |
140 | HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc); |
140 | void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc); |
141 | void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc); |
141 | void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc); |
142 | void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc); |
142 | /** |
143 | /** |
143 | * @} |
144 | * @} |
144 | */ |
145 | */ |
145 | |
146 | 146 | /* Peripheral Control functions ***********************************************/ |
|
147 | /* Peripheral Control functions ***********************************************/ |
147 | /** @defgroup CRC_Exported_Functions_Group2 Peripheral Control functions |
148 | /** @defgroup CRC_Exported_Functions_Group2 Peripheral Control functions |
148 | * @{ |
149 | * @{ |
149 | */ |
150 | */ |
150 | uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); |
151 | uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); |
151 | uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); |
152 | uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); |
152 | /** |
153 | /** |
153 | * @} |
154 | * @} |
154 | */ |
155 | */ |
155 | |
156 | 156 | /* Peripheral State and Error functions ***************************************/ |
|
157 | /* Peripheral State and Error functions ***************************************/ |
157 | /** @defgroup CRC_Exported_Functions_Group3 Peripheral State functions |
158 | /** @defgroup CRC_Exported_Functions_Group3 Peripheral State functions |
158 | * @{ |
159 | * @{ |
159 | */ |
160 | */ |
160 | HAL_CRC_StateTypeDef HAL_CRC_GetState(const CRC_HandleTypeDef *hcrc); |
161 | HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc); |
161 | /** |
162 | /** |
162 | * @} |
163 | * @} |
163 | */ |
164 | */ |
164 | |
165 | 165 | /** |
|
166 | /** |
166 | * @} |
167 | * @} |
167 | */ |
168 | */ |
168 | |
169 | 169 | /** |
|
170 | /** |
170 | * @} |
171 | * @} |
171 | */ |
172 | */ |
172 | |
173 | 173 | /** |
|
174 | /** |
174 | * @} |
175 | * @} |
175 | */ |
176 | */ |
176 | |
177 | 177 | #ifdef __cplusplus |
|
178 | #ifdef __cplusplus |
178 | } |
179 | } |
179 | #endif |
180 | #endif |
180 | |
181 | 181 | #endif /* STM32L1xx_HAL_CRC_H */ |
|
182 | #endif /* STM32L1xx_HAL_CRC_H */ |
- | |
183 | - | ||
184 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
- |