Skip to content

Commit 7d3e349

Browse files
committed
Update HAL for STM32L1xx (from STM32CubeL1 V1.7.0)
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 50f638a commit 7d3e349

File tree

132 files changed

+3020
-2773
lines changed

Some content is hidden

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

132 files changed

+3020
-2773
lines changed

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

Lines changed: 164 additions & 79 deletions
Large diffs are not rendered by default.

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32_assert_template.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
******************************************************************************
33
* @file stm32_assert.h
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 01-July-2016
5+
* @version 21-April-2017
6+
* @date V1.3.0
77
* @brief STM32 assert template file.
88
* This file should be copied to the application folder and renamed
99
* to stm32_assert.h.
1010
******************************************************************************
1111
* @attention
1212
*
13-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
13+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
1414
*
1515
* Redistribution and use in source and binary forms, with or without modification,
1616
* are permitted provided that the following conditions are met:

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
******************************************************************************
33
* @file stm32l1xx_hal.h
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 01-July-2016
5+
* @version 21-April-2017
6+
* @date V1.3.0
77
* @brief This file contains all the functions prototypes for the HAL
88
* module driver.
99
******************************************************************************
1010
* @attention
1111
*
12-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
12+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
1313
*
1414
* Redistribution and use in source and binary forms, with or without modification,
1515
* are permitted provided that the following conditions are met:

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_adc.h

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

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_adc_ex.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
******************************************************************************
33
* @file stm32l1xx_hal_adc_ex.h
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 01-July-2016
5+
* @version 21-April-2017
6+
* @date V1.3.0
77
* @brief Header file of ADC HAL Extension module.
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
1212
*
1313
* Redistribution and use in source and binary forms, with or without modification,
1414
* are permitted provided that the following conditions are met:
@@ -140,18 +140,18 @@ typedef struct
140140
/** @defgroup ADCEx_injected_rank ADCEx rank into injected group
141141
* @{
142142
*/
143-
#define ADC_INJECTED_RANK_1 ((uint32_t)0x00000001)
144-
#define ADC_INJECTED_RANK_2 ((uint32_t)0x00000002)
145-
#define ADC_INJECTED_RANK_3 ((uint32_t)0x00000003)
146-
#define ADC_INJECTED_RANK_4 ((uint32_t)0x00000004)
143+
#define ADC_INJECTED_RANK_1 (0x00000001U)
144+
#define ADC_INJECTED_RANK_2 (0x00000002U)
145+
#define ADC_INJECTED_RANK_3 (0x00000003U)
146+
#define ADC_INJECTED_RANK_4 (0x00000004U)
147147
/**
148148
* @}
149149
*/
150150

151151
/** @defgroup ADCEx_External_trigger_edge_Injected ADCEx external trigger enable for injected group
152152
* @{
153153
*/
154-
#define ADC_EXTERNALTRIGINJECCONV_EDGE_NONE ((uint32_t)0x00000000)
154+
#define ADC_EXTERNALTRIGINJECCONV_EDGE_NONE (0x00000000U)
155155
#define ADC_EXTERNALTRIGINJECCONV_EDGE_RISING ((uint32_t)ADC_CR2_JEXTEN_0)
156156
#define ADC_EXTERNALTRIGINJECCONV_EDGE_FALLING ((uint32_t)ADC_CR2_JEXTEN_1)
157157
#define ADC_EXTERNALTRIGINJECCONV_EDGE_RISINGFALLING ((uint32_t)ADC_CR2_JEXTEN)
@@ -175,7 +175,7 @@ typedef struct
175175
#define ADC_EXTERNALTRIGINJECCONV_T9_TRGO ADC_EXTERNALTRIGINJEC_T9_TRGO
176176
#define ADC_EXTERNALTRIGINJECCONV_T10_CC1 ADC_EXTERNALTRIGINJEC_T10_CC1
177177
#define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ADC_EXTERNALTRIGINJEC_EXT_IT15
178-
#define ADC_INJECTED_SOFTWARE_START ((uint32_t)0x00000010)
178+
#define ADC_INJECTED_SOFTWARE_START (0x00000010U)
179179
/**
180180
* @}
181181
*/
@@ -197,7 +197,7 @@ typedef struct
197197

198198
/* List of external triggers of injected group for ADC1: */
199199
/* (used internally by HAL driver. To not use into HAL structure parameters) */
200-
#define ADC_EXTERNALTRIGINJEC_T9_CC1 ((uint32_t) 0x00000000)
200+
#define ADC_EXTERNALTRIGINJEC_T9_CC1 (0x00000000U)
201201
#define ADC_EXTERNALTRIGINJEC_T9_TRGO ((uint32_t)( ADC_CR2_JEXTSEL_0))
202202
#define ADC_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t)( ADC_CR2_JEXTSEL_1 ))
203203
#define ADC_EXTERNALTRIGINJEC_T2_CC1 ((uint32_t)( ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
@@ -333,7 +333,7 @@ typedef struct
333333
((_SAMPLETIME_) << (3 * ((_CHANNELNB_) - 30)))
334334
#else
335335
#define ADC_SMPR0(_SAMPLETIME_, _CHANNELNB_) \
336-
((uint32_t)0x00000000)
336+
(0x00000000U)
337337
#endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
338338

339339
#if defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
@@ -517,7 +517,7 @@ typedef struct
517517
/** @defgroup ADCEx_injected_nb_conv_verification ADCEx injected nb conv verification
518518
* @{
519519
*/
520-
#define IS_ADC_INJECTED_NB_CONV(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)4)))
520+
#define IS_ADC_INJECTED_NB_CONV(LENGTH) (((LENGTH) >= (1U)) && ((LENGTH) <= (4U)))
521521
/**
522522
* @}
523523
*/

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_comp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
******************************************************************************
33
* @file stm32l1xx_hal_comp.h
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 01-July-2016
5+
* @version 21-April-2017
6+
* @date V1.3.0
77
* @brief Header file of COMP HAL module.
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
1212
*
1313
* Redistribution and use in source and binary forms, with or without modification,
1414
* are permitted provided that the following conditions are met:

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_comp_ex.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
******************************************************************************
33
* @file stm32l1xx_hal_comp_ex.h
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 01-July-2016
5+
* @version 21-April-2017
6+
* @date V1.3.0
77
* @brief Header file of COMP HAL Extension module.
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
1212
*
1313
* Redistribution and use in source and binary forms, with or without modification,
1414
* are permitted provided that the following conditions are met:

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_conf_template.h

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
******************************************************************************
33
* @file stm32l1xx_hal_conf.h
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 01-July-2016
5+
* @version 21-April-2017
6+
* @date V1.3.0
77
* @brief HAL configuration template file.
88
* This file should be copied to the application folder and renamed
99
* to stm32l1xx_hal_conf.h.
1010
******************************************************************************
1111
* @attention
1212
*
13-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
13+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
1414
*
1515
* Redistribution and use in source and binary forms, with or without modification,
1616
* are permitted provided that the following conditions are met:
@@ -89,41 +89,42 @@
8989
* (when HSE is used as system clock source, directly or through the PLL).
9090
*/
9191
#if !defined (HSE_VALUE)
92-
#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
92+
#define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */
9393
#endif /* HSE_VALUE */
9494

9595
#if !defined (HSE_STARTUP_TIMEOUT)
96-
#define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
96+
#define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
9797
#endif /* HSE_STARTUP_TIMEOUT */
9898

9999
/**
100100
* @brief Internal Multiple Speed oscillator (MSI) default value.
101101
* This value is the default MSI range value after Reset.
102102
*/
103103
#if !defined (MSI_VALUE)
104-
#define MSI_VALUE ((uint32_t)2097000) /*!< Value of the Internal oscillator in Hz*/
104+
#define MSI_VALUE (2097000U) /*!< Value of the Internal oscillator in Hz*/
105105
#endif /* MSI_VALUE */
106106
/**
107107
* @brief Internal High Speed oscillator (HSI) value.
108108
* This value is used by the RCC HAL module to compute the system frequency
109109
* (when HSI is used as system clock source, directly or through the PLL).
110110
*/
111111
#if !defined (HSI_VALUE)
112-
#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/
112+
#define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/
113113
#endif /* HSI_VALUE */
114114

115115
/**
116116
* @brief External Low Speed oscillator (LSE) value.
117-
* This value is used by the UART, RTC HAL module to compute the system frequency
118117
*/
119118
#if !defined (LSE_VALUE)
120-
#define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/
119+
#define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz*/
121120
#endif /* LSE_VALUE */
122121

123-
122+
/**
123+
* @brief Time out for LSE start up value in ms.
124+
*/
124125
#if !defined (LSE_STARTUP_TIMEOUT)
125-
#define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */
126-
#endif /* HSE_STARTUP_TIMEOUT */
126+
#define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */
127+
#endif /* LSE_STARTUP_TIMEOUT */
127128

128129

129130
/* Tip: To avoid modifying this file each time you need to use different HSE,
@@ -133,19 +134,19 @@
133134
/**
134135
* @brief This is the HAL system configuration section
135136
*/
136-
#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
137-
#define TICK_INT_PRIORITY ((uint32_t)0x000F) /*!< tick interrupt priority */
138-
#define USE_RTOS 0
139-
#define PREFETCH_ENABLE 1
140-
#define INSTRUCTION_CACHE_ENABLE 0
141-
#define DATA_CACHE_ENABLE 0
137+
#define VDD_VALUE (3300U) /*!< Value of VDD in mv */
138+
#define TICK_INT_PRIORITY (0x000FU) /*!< tick interrupt priority */
139+
#define USE_RTOS 0U
140+
#define PREFETCH_ENABLE 1U
141+
#define INSTRUCTION_CACHE_ENABLE 0U
142+
#define DATA_CACHE_ENABLE 0U
142143

143144
/* ########################## Assert Selection ############################## */
144145
/**
145146
* @brief Uncomment the line below to expanse the "assert_param" macro in the
146147
* HAL drivers code
147148
*/
148-
/*#define USE_FULL_ASSERT 1*/
149+
/*#define USE_FULL_ASSERT 1U*/
149150

150151
/* Includes ------------------------------------------------------------------*/
151152
/**

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_cortex.h

Lines changed: 22 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
******************************************************************************
33
* @file stm32l1xx_hal_cortex.h
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 01-July-2016
5+
* @version 21-April-2017
6+
* @date V1.3.0
77
* @brief Header file of CORTEX HAL module.
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
1212
*
1313
* Redistribution and use in source and binary forms, with or without modification,
1414
* are permitted provided that the following conditions are met:
@@ -108,25 +108,25 @@ typedef struct
108108
* @{
109109
*/
110110

111-
#define NVIC_PRIORITYGROUP_0 ((uint32_t)0x00000007) /*!< 0 bits for pre-emption priority
112-
4 bits for subpriority */
113-
#define NVIC_PRIORITYGROUP_1 ((uint32_t)0x00000006) /*!< 1 bits for pre-emption priority
114-
3 bits for subpriority */
115-
#define NVIC_PRIORITYGROUP_2 ((uint32_t)0x00000005) /*!< 2 bits for pre-emption priority
116-
2 bits for subpriority */
117-
#define NVIC_PRIORITYGROUP_3 ((uint32_t)0x00000004) /*!< 3 bits for pre-emption priority
118-
1 bits for subpriority */
119-
#define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority
120-
0 bits for subpriority */
111+
#define NVIC_PRIORITYGROUP_0 (0x00000007U) /*!< 0 bits for pre-emption priority
112+
4 bits for subpriority */
113+
#define NVIC_PRIORITYGROUP_1 (0x00000006U) /*!< 1 bits for pre-emption priority
114+
3 bits for subpriority */
115+
#define NVIC_PRIORITYGROUP_2 (0x00000005U) /*!< 2 bits for pre-emption priority
116+
2 bits for subpriority */
117+
#define NVIC_PRIORITYGROUP_3 (0x00000004U) /*!< 3 bits for pre-emption priority
118+
1 bits for subpriority */
119+
#define NVIC_PRIORITYGROUP_4 (0x00000003U) /*!< 4 bits for pre-emption priority
120+
0 bits for subpriority */
121121
/**
122122
* @}
123123
*/
124124

125125
/** @defgroup CORTEX_SysTick_clock_source CORTEX SysTick clock source
126126
* @{
127127
*/
128-
#define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000)
129-
#define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004)
128+
#define SYSTICK_CLKSOURCE_HCLK_DIV8 (0x00000000U)
129+
#define SYSTICK_CLKSOURCE_HCLK (0x00000004U)
130130

131131
/**
132132
* @}
@@ -136,10 +136,11 @@ typedef struct
136136
/** @defgroup CORTEX_MPU_HFNMI_PRIVDEF_Control MPU HFNMI and PRIVILEGED Access control
137137
* @{
138138
*/
139-
#define MPU_HFNMI_PRIVDEF_NONE ((uint32_t)0x00000000)
140-
#define MPU_HARDFAULT_NMI ((uint32_t)0x00000002)
141-
#define MPU_PRIVILEGED_DEFAULT ((uint32_t)0x00000004)
142-
#define MPU_HFNMI_PRIVDEF ((uint32_t)0x00000006)
139+
#define MPU_HFNMI_PRIVDEF_NONE (0x00000000U)
140+
#define MPU_HARDFAULT_NMI (MPU_CTRL_HFNMIENA_Msk)
141+
#define MPU_PRIVILEGED_DEFAULT (MPU_CTRL_PRIVDEFENA_Msk)
142+
#define MPU_HFNMI_PRIVDEF (MPU_CTRL_HFNMIENA_Msk | MPU_CTRL_PRIVDEFENA_Msk)
143+
143144
/**
144145
* @}
145146
*/
@@ -386,40 +387,6 @@ typedef struct
386387
* @{
387388
*/
388389

389-
#if (__MPU_PRESENT == 1)
390-
/**
391-
* @brief Disables the MPU
392-
* @retval None
393-
*/
394-
__STATIC_INLINE void HAL_MPU_Disable(void)
395-
{
396-
/* Disable fault exceptions */
397-
SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
398-
399-
/* Disable the MPU */
400-
MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
401-
}
402-
403-
/**
404-
* @brief Enables the MPU
405-
* @param MPU_Control: Specifies the control mode of the MPU during hard fault,
406-
* NMI, FAULTMASK and privileged accessto the default memory
407-
* This parameter can be one of the following values:
408-
* @arg MPU_HFNMI_PRIVDEF_NONE
409-
* @arg MPU_HARDFAULT_NMI
410-
* @arg MPU_PRIVILEGED_DEFAULT
411-
* @arg MPU_HFNMI_PRIVDEF
412-
* @retval None
413-
*/
414-
__STATIC_INLINE void HAL_MPU_Enable(uint32_t MPU_Control)
415-
{
416-
/* Enable the MPU */
417-
MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
418-
419-
/* Enable fault exceptions */
420-
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
421-
}
422-
#endif /* __MPU_PRESENT */
423390

424391
/**
425392
* @}
@@ -449,6 +416,8 @@ uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb);
449416
*/
450417
/* Peripheral Control functions ***********************************************/
451418
#if (__MPU_PRESENT == 1)
419+
void HAL_MPU_Enable(uint32_t MPU_Control);
420+
void HAL_MPU_Disable(void);
452421
void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init);
453422
#endif /* __MPU_PRESENT */
454423
uint32_t HAL_NVIC_GetPriorityGrouping(void);

system/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_crc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
******************************************************************************
33
* @file stm32l1xx_hal_crc.h
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 01-July-2016
5+
* @version 21-April-2017
6+
* @date V1.3.0
77
* @brief Header file of CRC HAL module.
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
1212
*
1313
* Redistribution and use in source and binary forms, with or without modification,
1414
* are permitted provided that the following conditions are met:

0 commit comments

Comments
 (0)