Skip to content

Commit ff04da1

Browse files
committed
[F3] Update STM32F3xx HAL Drivers to v1.5.3
Included in STM32CubeF3 FW V1.11.0 Signed-off-by: Frederic Pillon <[email protected]>
1 parent 4b89ae8 commit ff04da1

File tree

163 files changed

+45898
-29287
lines changed

Some content is hidden

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

163 files changed

+45898
-29287
lines changed

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

Lines changed: 315 additions & 36 deletions
Large diffs are not rendered by default.

system/Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32f3xx_hal_can_legacy.h

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
11
/**
22
******************************************************************************
3-
* @file stm32f3xx_hal_can.h
3+
* @file stm32f3xx_hal_can_legacy.h
44
* @author MCD Application Team
55
* @brief Header file of CAN HAL module.
66
******************************************************************************
77
* @attention
88
*
9-
* <h2><center>&copy; COPYRIGHT(c) 2016 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
*/
3519

3620
/* Define to prevent recursive inclusion -------------------------------------*/
37-
#ifndef __STM32F3xx_CAN_H
38-
#define __STM32F3xx_CAN_H
21+
#ifndef __STM32F3xx_HAL_CAN_LEGACY_H
22+
#define __STM32F3xx_HAL_CAN_LEGACY_H
3923

4024
#ifdef __cplusplus
4125
extern "C" {
@@ -813,7 +797,7 @@ HAL_CAN_StateTypeDef HAL_CAN_GetState(CAN_HandleTypeDef* hcan);
813797
}
814798
#endif
815799

816-
#endif /* __STM32F3xx_CAN_H */
800+
#endif /* __STM32F3xx_HAL_CAN_LEGACY_H */
817801

818802

819803
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

system/Drivers/STM32F3xx_HAL_Driver/Inc/stm32_assert_template.h

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,13 @@
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2016 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
*/
@@ -56,9 +40,9 @@
5640
* If expr is true, it returns no value.
5741
* @retval None
5842
*/
59-
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((char *)__FILE__, __LINE__))
43+
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
6044
/* Exported functions ------------------------------------------------------- */
61-
void assert_failed(char* file, uint32_t line);
45+
void assert_failed(uint8_t* file, uint32_t line);
6246
#else
6347
#define assert_param(expr) ((void)0U)
6448
#endif /* USE_FULL_ASSERT */

system/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,13 @@
77
******************************************************************************
88
* @attention
99
*
10-
* <h2><center>&copy; COPYRIGHT(c) 2016 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
******************************************************************************
3519
*/

system/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_adc.h

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,13 @@
66
******************************************************************************
77
* @attention
88
*
9-
* <h2><center>&copy; COPYRIGHT(c) 2016 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
*/
@@ -127,8 +111,40 @@ typedef struct __ADC_HandleTypeDef
127111
/* STM32F302xC || STM32F303xC || STM32F358xx || */
128112
/* STM32F303x8 || STM32F334x8 || STM32F328xx || */
129113
/* STM32F301x8 || STM32F302x8 || STM32F318xx */
130-
114+
115+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
116+
void (* ConvCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC conversion complete callback */
117+
void (* ConvHalfCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC conversion DMA half-transfer callback */
118+
void (* LevelOutOfWindowCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC analog watchdog 1 callback */
119+
void (* ErrorCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC error callback */
120+
void (* InjectedConvCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC group injected conversion complete callback */ /*!< ADC end of sampling callback */
121+
void (* MspInitCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC Msp Init callback */
122+
void (* MspDeInitCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC Msp DeInit callback */
123+
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
131124
}ADC_HandleTypeDef;
125+
126+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
127+
/**
128+
* @brief HAL ADC Callback ID enumeration definition
129+
*/
130+
typedef enum
131+
{
132+
HAL_ADC_CONVERSION_COMPLETE_CB_ID = 0x00U, /*!< ADC conversion complete callback ID */
133+
HAL_ADC_CONVERSION_HALF_CB_ID = 0x01U, /*!< ADC conversion DMA half-transfer callback ID */
134+
HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID = 0x02U, /*!< ADC analog watchdog 1 callback ID */
135+
HAL_ADC_ERROR_CB_ID = 0x03U, /*!< ADC error callback ID */
136+
HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID = 0x04U, /*!< ADC group injected conversion complete callback ID */
137+
HAL_ADC_MSPINIT_CB_ID = 0x09U, /*!< ADC Msp Init callback ID */
138+
HAL_ADC_MSPDEINIT_CB_ID = 0x0AU /*!< ADC Msp DeInit callback ID */
139+
} HAL_ADC_CallbackIDTypeDef;
140+
141+
/**
142+
* @brief HAL ADC Callback pointer definition
143+
*/
144+
typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to a ADC callback function */
145+
146+
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
147+
132148
/**
133149
* @}
134150
*/
@@ -143,7 +159,17 @@ typedef struct __ADC_HandleTypeDef
143159
* @param __HANDLE__ ADC handle
144160
* @retval None
145161
*/
146-
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_ADC_STATE_RESET)
162+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
163+
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) \
164+
do{ \
165+
(__HANDLE__)->State = HAL_ADC_STATE_RESET; \
166+
(__HANDLE__)->MspInitCallback = NULL; \
167+
(__HANDLE__)->MspDeInitCallback = NULL; \
168+
} while(0)
169+
#else
170+
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) \
171+
((__HANDLE__)->State = HAL_ADC_STATE_RESET)
172+
#endif
147173

148174
/**
149175
* @}
@@ -164,6 +190,12 @@ HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc);
164190
HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc);
165191
void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc);
166192
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc);
193+
194+
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
195+
/* Callbacks Register/UnRegister functions ***********************************/
196+
HAL_StatusTypeDef HAL_ADC_RegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID, pADC_CallbackTypeDef pCallback);
197+
HAL_StatusTypeDef HAL_ADC_UnRegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID);
198+
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
167199
/**
168200
* @}
169201
*/

0 commit comments

Comments
 (0)