Skip to content

Commit d3a4388

Browse files
committed
[F1] Update STM32F1xx HAL Drivers to v1.1.6
Included in STM32CubeF1 FW v1.8.2 Signed-off-by: Frederic Pillon <[email protected]>
1 parent ac1d03e commit d3a4388

Some content is hidden

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

54 files changed

+3933
-1811
lines changed

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

Lines changed: 165 additions & 27 deletions
Large diffs are not rendered by default.

system/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32f1xx_hal_can_ex_legacy.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) 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
*/

system/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_can.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,11 @@ typedef void (*pCAN_CallbackTypeDef)(CAN_HandleTypeDef *hcan); /*!< pointer to
295295
#define HAL_CAN_ERROR_RX_FOV0 (0x00000200U) /*!< Rx FIFO0 overrun error */
296296
#define HAL_CAN_ERROR_RX_FOV1 (0x00000400U) /*!< Rx FIFO1 overrun error */
297297
#define HAL_CAN_ERROR_TX_ALST0 (0x00000800U) /*!< TxMailbox 0 transmit failure due to arbitration lost */
298-
#define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /*!< TxMailbox 1 transmit failure due to tranmit error */
298+
#define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /*!< TxMailbox 1 transmit failure due to transmit error */
299299
#define HAL_CAN_ERROR_TX_ALST1 (0x00002000U) /*!< TxMailbox 0 transmit failure due to arbitration lost */
300-
#define HAL_CAN_ERROR_TX_TERR1 (0x00004000U) /*!< TxMailbox 1 transmit failure due to tranmit error */
300+
#define HAL_CAN_ERROR_TX_TERR1 (0x00004000U) /*!< TxMailbox 1 transmit failure due to transmit error */
301301
#define HAL_CAN_ERROR_TX_ALST2 (0x00008000U) /*!< TxMailbox 0 transmit failure due to arbitration lost */
302-
#define HAL_CAN_ERROR_TX_TERR2 (0x00010000U) /*!< TxMailbox 1 transmit failure due to tranmit error */
302+
#define HAL_CAN_ERROR_TX_TERR2 (0x00010000U) /*!< TxMailbox 1 transmit failure due to transmit error */
303303
#define HAL_CAN_ERROR_TIMEOUT (0x00020000U) /*!< Timeout error */
304304
#define HAL_CAN_ERROR_NOT_INITIALIZED (0x00040000U) /*!< Peripheral not initialized */
305305
#define HAL_CAN_ERROR_NOT_READY (0x00080000U) /*!< Peripheral not ready */

system/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ extern "C" {
2828

2929
/* Includes ------------------------------------------------------------------*/
3030
#include "stm32f1xx.h"
31-
#if defined(USE_HAL_LEGACY)
3231
#include "Legacy/stm32_hal_legacy.h"
33-
#endif
3432
#include <stddef.h>
3533

3634
/* Exported types ------------------------------------------------------------*/
@@ -108,7 +106,14 @@ typedef enum
108106
}while (0U)
109107
#endif /* USE_RTOS */
110108

111-
#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
109+
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
110+
#ifndef __weak
111+
#define __weak __attribute__((weak))
112+
#endif
113+
#ifndef __packed
114+
#define __packed __attribute__((packed))
115+
#endif
116+
#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
112117
#ifndef __weak
113118
#define __weak __attribute__((weak))
114119
#endif /* __weak */
@@ -119,7 +124,14 @@ typedef enum
119124

120125

121126
/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
122-
#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
127+
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
128+
#ifndef __ALIGN_BEGIN
129+
#define __ALIGN_BEGIN
130+
#endif
131+
#ifndef __ALIGN_END
132+
#define __ALIGN_END __attribute__ ((aligned (4)))
133+
#endif
134+
#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
123135
#ifndef __ALIGN_END
124136
#define __ALIGN_END __attribute__ ((aligned (4)))
125137
#endif /* __ALIGN_END */
@@ -131,7 +143,7 @@ typedef enum
131143
#define __ALIGN_END
132144
#endif /* __ALIGN_END */
133145
#ifndef __ALIGN_BEGIN
134-
#if defined (__CC_ARM) /* ARM Compiler */
146+
#if defined (__CC_ARM) /* ARM Compiler V5*/
135147
#define __ALIGN_BEGIN __align(4)
136148
#elif defined (__ICCARM__) /* IAR Compiler */
137149
#define __ALIGN_BEGIN
@@ -143,9 +155,9 @@ typedef enum
143155
/**
144156
* @brief __RAM_FUNC definition
145157
*/
146-
#if defined ( __CC_ARM )
147-
/* ARM Compiler
148-
------------
158+
#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
159+
/* ARM Compiler V4/V5 and V6
160+
--------------------------
149161
RAM functions are defined using the toolchain options.
150162
Functions that are executed in RAM should reside in a separate source module.
151163
Using the 'Options for File' dialog you can simply change the 'Code / Const'
@@ -175,9 +187,9 @@ typedef enum
175187
/**
176188
* @brief __NOINLINE definition
177189
*/
178-
#if defined ( __CC_ARM ) || defined ( __GNUC__ )
179-
/* ARM & GNUCompiler
180-
----------------
190+
#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined ( __GNUC__ )
191+
/* ARM V4/V5 and V6 & GNU Compiler
192+
-------------------------------
181193
*/
182194
#define __NOINLINE __attribute__ ( (noinline) )
183195

system/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_hcd.h

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern "C" {
3333
* @{
3434
*/
3535

36-
/** @addtogroup HCD
36+
/** @addtogroup HCD HCD
3737
* @{
3838
*/
3939

@@ -262,9 +262,6 @@ HAL_StatusTypeDef HAL_HCD_Stop(HCD_HandleTypeDef *hhcd);
262262
/**
263263
* @}
264264
*/
265-
/**
266-
* @}
267-
*/
268265

269266
/* Peripheral State functions ************************************************/
270267
/** @addtogroup HCD_Exported_Functions_Group4 Peripheral State functions
@@ -293,20 +290,11 @@ uint32_t HAL_HCD_GetCurrentSpeed(HCD_HandleTypeDef *hhcd);
293290
* @}
294291
*/
295292
/* Private functions prototypes ----------------------------------------------*/
296-
/** @defgroup HCD_Private_Functions_Prototypes HCD Private Functions Prototypes
297-
* @{
298-
*/
299293

300-
/**
294+
/**
301295
* @}
302296
*/
303-
304-
/* Private functions ---------------------------------------------------------*/
305-
/** @defgroup HCD_Private_Functions HCD Private Functions
306-
* @{
307-
*/
308-
309-
/**
297+
/**
310298
* @}
311299
*/
312300
#endif /* defined (USB_OTG_FS) */

system/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2s.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ typedef void (*pI2S_CallbackTypeDef)(I2S_HandleTypeDef *hi2s); /*!< pointer to
174174
#if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
175175
#define HAL_I2S_ERROR_INVALID_CALLBACK (0x00000020U) /*!< Invalid Callback error */
176176
#endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
177+
#define HAL_I2S_ERROR_BUSY_LINE_RX (0x00000040U) /*!< Busy Rx Line error */
177178
/**
178179
* @}
179180
*/
@@ -380,6 +381,15 @@ typedef void (*pI2S_CallbackTypeDef)(I2S_HandleTypeDef *hi2s); /*!< pointer to
380381
tmpreg_udr = ((__HANDLE__)->Instance->SR);\
381382
UNUSED(tmpreg_udr); \
382383
}while(0U)
384+
/** @brief Flush the I2S DR Register.
385+
* @param __HANDLE__ specifies the I2S Handle.
386+
* @retval None
387+
*/
388+
#define __HAL_I2S_FLUSH_RX_DR(__HANDLE__) do{\
389+
__IO uint32_t tmpreg_dr = 0x00U;\
390+
tmpreg_dr = ((__HANDLE__)->Instance->DR);\
391+
UNUSED(tmpreg_dr); \
392+
}while(0U)
383393
/**
384394
* @}
385395
*/
@@ -462,7 +472,7 @@ uint32_t HAL_I2S_GetError(I2S_HandleTypeDef *hi2s);
462472
*/
463473

464474
/** @brief Check whether the specified SPI flag is set or not.
465-
* @param __SR__ copy of I2S SR regsiter.
475+
* @param __SR__ copy of I2S SR register.
466476
* @param __FLAG__ specifies the flag to check.
467477
* This parameter can be one of the following values:
468478
* @arg I2S_FLAG_RXNE: Receive buffer not empty flag
@@ -477,7 +487,7 @@ uint32_t HAL_I2S_GetError(I2S_HandleTypeDef *hi2s);
477487
& ((__FLAG__) & I2S_FLAG_MASK)) == ((__FLAG__) & I2S_FLAG_MASK)) ? SET : RESET)
478488

479489
/** @brief Check whether the specified SPI Interrupt is set or not.
480-
* @param __CR2__ copy of I2S CR2 regsiter.
490+
* @param __CR2__ copy of I2S CR2 register.
481491
* @param __INTERRUPT__ specifies the SPI interrupt source to check.
482492
* This parameter can be one of the following values:
483493
* @arg I2S_IT_TXE: Tx buffer empty interrupt enable

system/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_iwdg.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern "C" {
3232
* @{
3333
*/
3434

35-
/** @addtogroup IWDG
35+
/** @defgroup IWDG IWDG
3636
* @{
3737
*/
3838

@@ -62,9 +62,9 @@ typedef struct
6262
IWDG_TypeDef *Instance; /*!< Register base address */
6363

6464
IWDG_InitTypeDef Init; /*!< IWDG required parameters */
65-
6665
} IWDG_HandleTypeDef;
6766

67+
6868
/**
6969
* @}
7070
*/
@@ -77,22 +77,24 @@ typedef struct
7777
/** @defgroup IWDG_Prescaler IWDG Prescaler
7878
* @{
7979
*/
80-
#define IWDG_PRESCALER_4 0x00000000U /*!< IWDG prescaler set to 4 */
81-
#define IWDG_PRESCALER_8 IWDG_PR_PR_0 /*!< IWDG prescaler set to 8 */
82-
#define IWDG_PRESCALER_16 IWDG_PR_PR_1 /*!< IWDG prescaler set to 16 */
83-
#define IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 32 */
84-
#define IWDG_PRESCALER_64 IWDG_PR_PR_2 /*!< IWDG prescaler set to 64 */
85-
#define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 128 */
86-
#define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< IWDG prescaler set to 256 */
80+
#define IWDG_PRESCALER_4 0x00000000U /*!< IWDG prescaler set to 4 */
81+
#define IWDG_PRESCALER_8 IWDG_PR_PR_0 /*!< IWDG prescaler set to 8 */
82+
#define IWDG_PRESCALER_16 IWDG_PR_PR_1 /*!< IWDG prescaler set to 16 */
83+
#define IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 32 */
84+
#define IWDG_PRESCALER_64 IWDG_PR_PR_2 /*!< IWDG prescaler set to 64 */
85+
#define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0) /*!< IWDG prescaler set to 128 */
86+
#define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1) /*!< IWDG prescaler set to 256 */
87+
8788
/**
8889
* @}
8990
*/
9091

92+
93+
9194
/**
9295
* @}
9396
*/
9497

95-
9698
/* Exported macros -----------------------------------------------------------*/
9799
/** @defgroup IWDG_Exported_Macros IWDG Exported Macros
98100
* @{
@@ -107,7 +109,7 @@ typedef struct
107109

108110
/**
109111
* @brief Reload IWDG counter with value defined in the reload register
110-
* (write access to IWDG_PR & IWDG_RLR registers disabled).
112+
* (write access to IWDG_PR and IWDG_RLR registers disabled).
111113
* @param __HANDLE__ IWDG handle
112114
* @retval None
113115
*/
@@ -200,6 +202,8 @@ HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg);
200202
*/
201203
#define IS_IWDG_RELOAD(__RELOAD__) ((__RELOAD__) <= IWDG_RLR_RL)
202204

205+
206+
203207
/**
204208
* @}
205209
*/

0 commit comments

Comments
 (0)