Skip to content

Commit 66e06fb

Browse files
committed
[F2] Update STM32F2xx HAL Drivers to v1.2.3
Included in STM32CubeF2 FW V1.8.0 Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent d381cc2 commit 66e06fb

File tree

148 files changed

+52927
-33908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+52927
-33908
lines changed

system/Drivers/STM32F2xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h

Lines changed: 484 additions & 110 deletions
Large diffs are not rendered by default.

system/Drivers/STM32F2xx_HAL_Driver/Inc/Legacy/stm32f2xx_hal_can_legacy.h

Lines changed: 761 additions & 0 deletions
Large diffs are not rendered by default.

system/Drivers/STM32F2xx_HAL_Driver/Inc/stm32_assert_template.h

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,13 @@
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
12+
* All rights reserved.</center></h2>
1213
*
13-
* Redistribution and use in source and binary forms, with or without modification,
14-
* are permitted provided that the following conditions are met:
15-
* 1. Redistributions of source code must retain the above copyright notice,
16-
* this list of conditions and the following disclaimer.
17-
* 2. Redistributions in binary form must reproduce the above copyright notice,
18-
* this list of conditions and the following disclaimer in the documentation
19-
* and/or other materials provided with the distribution.
20-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
21-
* may be used to endorse or promote products derived from this software
22-
* without specific prior written permission.
23-
*
24-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14+
* This software component is licensed by ST under BSD 3-Clause license,
15+
* the "License"; You may not use this file except in compliance with the
16+
* License. You may obtain a copy of the License at:
17+
* opensource.org/licenses/BSD-3-Clause
3418
*
3519
******************************************************************************
3620
*/

system/Drivers/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal.h

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,16 @@
77
******************************************************************************
88
* @attention
99
*
10-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
10+
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
11+
* All rights reserved.</center></h2>
1112
*
12-
* Redistribution and use in source and binary forms, with or without modification,
13-
* are permitted provided that the following conditions are met:
14-
* 1. Redistributions of source code must retain the above copyright notice,
15-
* this list of conditions and the following disclaimer.
16-
* 2. Redistributions in binary form must reproduce the above copyright notice,
17-
* this list of conditions and the following disclaimer in the documentation
18-
* and/or other materials provided with the distribution.
19-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
20-
* may be used to endorse or promote products derived from this software
21-
* without specific prior written permission.
22-
*
23-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13+
* This software component is licensed by ST under BSD 3-Clause license,
14+
* the "License"; You may not use this file except in compliance with the
15+
* License. You may obtain a copy of the License at:
16+
* opensource.org/licenses/BSD-3-Clause
3317
*
3418
******************************************************************************
35-
*/
19+
*/
3620

3721
/* Define to prevent recursive inclusion -------------------------------------*/
3822
#ifndef __STM32F2xx_HAL_H
@@ -55,6 +39,29 @@
5539

5640
/* Exported types ------------------------------------------------------------*/
5741
/* Exported constants --------------------------------------------------------*/
42+
43+
/** @defgroup HAL_Exported_Constants HAL Exported Constants
44+
* @{
45+
*/
46+
47+
/** @defgroup HAL_TICK_FREQ Tick Frequency
48+
* @{
49+
*/
50+
typedef enum
51+
{
52+
HAL_TICK_FREQ_10HZ = 100U,
53+
HAL_TICK_FREQ_100HZ = 10U,
54+
HAL_TICK_FREQ_1KHZ = 1U,
55+
HAL_TICK_FREQ_DEFAULT = HAL_TICK_FREQ_1KHZ
56+
} HAL_TickFreqTypeDef;
57+
58+
/**
59+
* @}
60+
*/
61+
62+
/**
63+
* @}
64+
*/
5865
/* Exported macro ------------------------------------------------------------*/
5966
/** @defgroup HAL_Exported_Macros HAL Exported Macros
6067
* @{
@@ -135,6 +142,16 @@
135142
* @}
136143
*/
137144

145+
/** @defgroup HAL_Private_Macros HAL Private Macros
146+
* @{
147+
*/
148+
#define IS_TICKFREQ(FREQ) (((FREQ) == HAL_TICK_FREQ_10HZ) || \
149+
((FREQ) == HAL_TICK_FREQ_100HZ) || \
150+
((FREQ) == HAL_TICK_FREQ_1KHZ))
151+
/**
152+
* @}
153+
*/
154+
138155
/* Exported functions --------------------------------------------------------*/
139156
/** @addtogroup HAL_Exported_Functions
140157
* @{
@@ -148,6 +165,17 @@ HAL_StatusTypeDef HAL_DeInit(void);
148165
void HAL_MspInit(void);
149166
void HAL_MspDeInit(void);
150167
HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
168+
/**
169+
* @}
170+
*/
171+
172+
/* Exported variables ---------------------------------------------------------*/
173+
/** @addtogroup HAL_Exported_Variables
174+
* @{
175+
*/
176+
extern __IO uint32_t uwTick;
177+
extern uint32_t uwTickPrio;
178+
extern HAL_TickFreqTypeDef uwTickFreq;
151179
/**
152180
* @}
153181
*/
@@ -159,6 +187,9 @@ HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
159187
void HAL_IncTick(void);
160188
void HAL_Delay(__IO uint32_t Delay);
161189
uint32_t HAL_GetTick(void);
190+
uint32_t HAL_GetTickPrio(void);
191+
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq);
192+
HAL_TickFreqTypeDef HAL_GetTickFreq(void);
162193
void HAL_SuspendTick(void);
163194
void HAL_ResumeTick(void);
164195
uint32_t HAL_GetHalVersion(void);
@@ -172,7 +203,9 @@ void HAL_DBGMCU_EnableDBGStandbyMode(void);
172203
void HAL_DBGMCU_DisableDBGStandbyMode(void);
173204
void HAL_EnableCompensationCell(void);
174205
void HAL_DisableCompensationCell(void);
175-
void HAL_GetUID(uint32_t *UID);
206+
uint32_t HAL_GetUIDw0(void);
207+
uint32_t HAL_GetUIDw1(void);
208+
uint32_t HAL_GetUIDw2(void);
176209
/**
177210
* @}
178211
*/

system/Drivers/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_adc.h

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,13 @@
66
******************************************************************************
77
* @attention
88
*
9-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
9+
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
10+
* All rights reserved.</center></h2>
1011
*
11-
* Redistribution and use in source and binary forms, with or without modification,
12-
* are permitted provided that the following conditions are met:
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.
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
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.
12+
* This software component is licensed by ST under BSD 3-Clause license,
13+
* the "License"; You may not use this file except in compliance with the
14+
* License. You may obtain a copy of the License at:
15+
* opensource.org/licenses/BSD-3-Clause
3216
*
3317
******************************************************************************
3418
*/
@@ -197,7 +181,11 @@ typedef struct
197181
/**
198182
* @brief ADC handle Structure definition
199183
*/
184+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
185+
typedef struct __ADC_HandleTypeDef
186+
#else
200187
typedef struct
188+
#endif
201189
{
202190
ADC_TypeDef *Instance; /*!< Register base address */
203191

@@ -212,7 +200,39 @@ typedef struct
212200
__IO uint32_t State; /*!< ADC communication state */
213201

214202
__IO uint32_t ErrorCode; /*!< ADC Error code */
203+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
204+
void (* ConvCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC conversion complete callback */
205+
void (* ConvHalfCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC conversion DMA half-transfer callback */
206+
void (* LevelOutOfWindowCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC analog watchdog 1 callback */
207+
void (* ErrorCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC error callback */
208+
void (* InjectedConvCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC group injected conversion complete callback */
209+
void (* MspInitCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC Msp Init callback */
210+
void (* MspDeInitCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC Msp DeInit callback */
211+
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
215212
}ADC_HandleTypeDef;
213+
214+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
215+
/**
216+
* @brief HAL ADC Callback ID enumeration definition
217+
*/
218+
typedef enum
219+
{
220+
HAL_ADC_CONVERSION_COMPLETE_CB_ID = 0x00U, /*!< ADC conversion complete callback ID */
221+
HAL_ADC_CONVERSION_HALF_CB_ID = 0x01U, /*!< ADC conversion DMA half-transfer callback ID */
222+
HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID = 0x02U, /*!< ADC analog watchdog 1 callback ID */
223+
HAL_ADC_ERROR_CB_ID = 0x03U, /*!< ADC error callback ID */
224+
HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID = 0x04U, /*!< ADC group injected conversion complete callback ID */
225+
HAL_ADC_MSPINIT_CB_ID = 0x05U, /*!< ADC Msp Init callback ID */
226+
HAL_ADC_MSPDEINIT_CB_ID = 0x06U /*!< ADC Msp DeInit callback ID */
227+
} HAL_ADC_CallbackIDTypeDef;
228+
229+
/**
230+
* @brief HAL ADC Callback pointer definition
231+
*/
232+
typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to a ADC callback function */
233+
234+
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
235+
216236
/**
217237
* @}
218238
*/
@@ -230,6 +250,9 @@ typedef struct
230250
enable/disable, erroneous state */
231251
#define HAL_ADC_ERROR_OVR 0x02U /*!< Overrun error */
232252
#define HAL_ADC_ERROR_DMA 0x04U /*!< DMA transfer error */
253+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
254+
#define HAL_ADC_ERROR_INVALID_CALLBACK (0x10U) /*!< Invalid Callback error */
255+
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
233256
/**
234257
* @}
235258
*/
@@ -450,7 +473,17 @@ typedef struct
450473
* @param __HANDLE__ ADC handle
451474
* @retval None
452475
*/
453-
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_ADC_STATE_RESET)
476+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
477+
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) \
478+
do{ \
479+
(__HANDLE__)->State = HAL_ADC_STATE_RESET; \
480+
(__HANDLE__)->MspInitCallback = NULL; \
481+
(__HANDLE__)->MspDeInitCallback = NULL; \
482+
} while(0)
483+
#else
484+
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) \
485+
((__HANDLE__)->State = HAL_ADC_STATE_RESET)
486+
#endif
454487

455488
/**
456489
* @brief Enable the ADC peripheral.
@@ -525,6 +558,12 @@ HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc);
525558
HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc);
526559
void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc);
527560
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc);
561+
562+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
563+
/* Callbacks Register/UnRegister functions ***********************************/
564+
HAL_StatusTypeDef HAL_ADC_RegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID, pADC_CallbackTypeDef pCallback);
565+
HAL_StatusTypeDef HAL_ADC_UnRegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID);
566+
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
528567
/**
529568
* @}
530569
*/

system/Drivers/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_adc_ex.h

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,13 @@
66
******************************************************************************
77
* @attention
88
*
9-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
9+
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
10+
* All rights reserved.</center></h2>
1011
*
11-
* Redistribution and use in source and binary forms, with or without modification,
12-
* are permitted provided that the following conditions are met:
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.
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
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.
12+
* This software component is licensed by ST under BSD 3-Clause license,
13+
* the "License"; You may not use this file except in compliance with the
14+
* License. You may obtain a copy of the License at:
15+
* opensource.org/licenses/BSD-3-Clause
3216
*
3317
******************************************************************************
3418
*/

0 commit comments

Comments
 (0)