Skip to content

Commit caeb8f3

Browse files
committed
system: G0: update STM32G0xx HAL Drivers to v1.4.2
Included in STM32CubeG0 FW v1.5.0 Signed-off-by: Frederic Pillon <[email protected]>
1 parent 0686e2d commit caeb8f3

File tree

123 files changed

+6363
-4383
lines changed

Some content is hidden

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

123 files changed

+6363
-4383
lines changed

Diff for: system/Drivers/STM32G0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h

+157-110
Large diffs are not rendered by default.

Diff for: system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_adc.h

+9-10
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ typedef struct
132132

133133
FunctionalState LowPowerAutoPowerOff; /*!< Select the auto-off mode: the ADC automatically powers-off after a conversion and automatically wakes-up when a new conversion is triggered (with startup time between trigger and start of sampling).
134134
This feature can be combined with automatic wait mode (parameter 'LowPowerAutoWait').
135-
This parameter can be set to ENABLE or DISABLE.
136-
Note: If enabled, this feature also turns off the ADC dedicated 14 MHz RC oscillator (HSI14) */
135+
This parameter can be set to ENABLE or DISABLE. */
137136

138137
FunctionalState ContinuousConvMode; /*!< Specify whether the conversion is performed in single mode (one conversion) or continuous mode for ADC group regular,
139138
after the first ADC conversion start trigger occurred (software start or external trigger).
@@ -473,7 +472,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to
473472
/** @defgroup ADC_HAL_EC_DATA_ALIGN ADC conversion data alignment
474473
* @{
475474
*/
476-
#define ADC_DATAALIGN_RIGHT (LL_ADC_DATA_ALIGN_RIGHT)/*!< ADC conversion data alignment: right aligned (alignment on data register LSB bit 0)*/
475+
#define ADC_DATAALIGN_RIGHT (LL_ADC_DATA_ALIGN_RIGHT) /*!< ADC conversion data alignment: right aligned (alignment on data register LSB bit 0)*/
477476
#define ADC_DATAALIGN_LEFT (LL_ADC_DATA_ALIGN_LEFT) /*!< ADC conversion data alignment: left aligned (alignment on data register MSB bit 15)*/
478477
/**
479478
* @}
@@ -516,17 +515,17 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to
516515
#define ADC_EXTERNALTRIG_T1_CC4 (LL_ADC_REG_TRIG_EXT_TIM1_CH4) /*!< ADC group regular conversion trigger from external peripheral: TIM1 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */
517516
#if defined(TIM2)
518517
#define ADC_EXTERNALTRIG_T2_TRGO (LL_ADC_REG_TRIG_EXT_TIM2_TRGO) /*!< ADC group regular conversion trigger from external peripheral: TIM2 TRGO. Trigger edge set to rising edge (default setting). */
519-
#endif
518+
#endif /* TIM2 */
520519
#define ADC_EXTERNALTRIG_T3_TRGO (LL_ADC_REG_TRIG_EXT_TIM3_TRGO) /*!< ADC group regular conversion trigger from external peripheral: TIM3 TRGO. Trigger edge set to rising edge (default setting). */
521520
#if defined(TIM4)
522521
#define ADC_EXTERNALTRIG_T4_TRGO (LL_ADC_REG_TRIG_EXT_TIM4_TRGO) /*!< ADC group regular conversion trigger from external peripheral: TIM4 TRGO. Trigger edge set to rising edge (default setting). */
523-
#endif
522+
#endif /* TIM4 */
524523
#if defined(TIM6)
525524
#define ADC_EXTERNALTRIG_T6_TRGO (LL_ADC_REG_TRIG_EXT_TIM6_TRGO) /*!< ADC group regular conversion trigger from external peripheral: TIM6 TRGO. Trigger edge set to rising edge (default setting). */
526-
#endif
525+
#endif /* TIM6 */
527526
#if defined(TIM15)
528527
#define ADC_EXTERNALTRIG_T15_TRGO (LL_ADC_REG_TRIG_EXT_TIM15_TRGO) /*!< ADC group regular conversion trigger from external peripheral: TIM15 TRGO. Trigger edge set to rising edge (default setting). */
529-
#endif
528+
#endif /* TIM15 */
530529
#define ADC_EXTERNALTRIG_EXT_IT11 (LL_ADC_REG_TRIG_EXT_EXTI_LINE11) /*!< ADC group regular conversion trigger from external peripheral: external interrupt line 11. Trigger edge set to rising edge (default setting). */
531530
/**
532531
* @}
@@ -941,7 +940,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to
941940
((REGTRIG) == ADC_EXTERNALTRIG_T3_TRGO) || \
942941
((REGTRIG) == ADC_EXTERNALTRIG_EXT_IT11) || \
943942
((REGTRIG) == ADC_SOFTWARE_START) )
944-
#endif
943+
#endif /* TIM15 && TIM6 && TIM2 */
945944

946945
#define IS_ADC_EOC_SELECTION(EOC_SELECTION) (((EOC_SELECTION) == ADC_EOC_SINGLE_CONV) || \
947946
((EOC_SELECTION) == ADC_EOC_SEQ_CONV))
@@ -1707,8 +1706,8 @@ void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc);
17071706
* @{
17081707
*/
17091708
/* Peripheral Control functions ***********************************************/
1710-
HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef *hadc, ADC_ChannelConfTypeDef *sConfig);
1711-
HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef *hadc, ADC_AnalogWDGConfTypeDef *AnalogWDGConfig);
1709+
HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef *hadc, ADC_ChannelConfTypeDef *pConfig);
1710+
HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef *hadc, ADC_AnalogWDGConfTypeDef *pAnalogWDGConfig);
17121711

17131712
/**
17141713
* @}

Diff for: system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_comp.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ typedef enum
103103
typedef struct __COMP_HandleTypeDef
104104
#else
105105
typedef struct
106-
#endif
106+
#endif /* USE_HAL_COMP_REGISTER_CALLBACKS */
107107
{
108108
COMP_TypeDef *Instance; /*!< Register base address */
109109
COMP_InitTypeDef Init; /*!< COMP required parameters */
@@ -173,7 +173,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
173173
#define COMP_WINDOWOUTPUT_COMP2 (COMP_CSR_WINOUT | COMP_WINDOWMODE_COMP2) /*!< Window output synthetized on COMP2 output: COMP2 output is no more indicating its own state, but global window mode state (logical high means monitored signal is within comparators window). */
174174
#if defined(COMP3)
175175
#define COMP_WINDOWOUTPUT_COMP3 (COMP_CSR_WINOUT) /*!< Window output synthetized on COMP3 output: COMP3 output is no more indicating its own state, but global window mode state (logical high means monitored signal is within comparators window). */
176-
#endif
176+
#endif /* COMP3 */
177177
#define COMP_WINDOWOUTPUT_BOTH (0x00000001UL) /*!< Window output synthetized on both comparators output of pair of comparator selected (COMP1 and COMP2, or COMP2 and COMP3 for devices featuring COMP3 instance): both comparators outputs are no more indicating their own state, but global window mode state (logical high means monitored signal is within comparators window). This is a specific configuration (technically possible but not relevant from application point of view: 2 comparators output used for the same signal level), standard configuration for window mode is one of the settings above. */
178178
/**
179179
* @}
@@ -307,7 +307,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
307307
} while(0)
308308
#else
309309
#define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_COMP_STATE_RESET)
310-
#endif
310+
#endif /* USE_HAL_COMP_REGISTER_CALLBACKS */
311311

312312
/**
313313
* @brief Clear COMP error code (set it to no error code "HAL_COMP_ERROR_NONE").
@@ -674,7 +674,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
674674
#define COMP_EXTI_LINE_COMP2 (EXTI_IMR1_IM18) /*!< EXTI line 18 connected to COMP2 output */
675675
#if defined(COMP3)
676676
#define COMP_EXTI_LINE_COMP3 (EXTI_IMR1_IM20) /*!< EXTI line 20 connected to COMP3 output */
677-
#endif
677+
#endif /* COMP3 */
678678
/**
679679
* @}
680680
*/
@@ -714,7 +714,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
714714
#else
715715
#define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1 \
716716
: COMP_EXTI_LINE_COMP2)
717-
#endif
717+
#endif /* COMP3 */
718718
/**
719719
* @}
720720
*/
@@ -738,7 +738,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
738738
(((__WINDOWMODE__) == COMP_WINDOWMODE_DISABLE) || \
739739
((__WINDOWMODE__) == COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON)|| \
740740
((__WINDOWMODE__) == COMP_WINDOWMODE_COMP2_INPUT_PLUS_COMMON) )
741-
#endif
741+
#endif /* COMP3 */
742742

743743
#define IS_COMP_WINDOWOUTPUT(__WINDOWOUTPUT__) (((__WINDOWOUTPUT__) == COMP_WINDOWOUTPUT_EACH_COMP) || \
744744
((__WINDOWOUTPUT__) == COMP_WINDOWOUTPUT_COMP1) || \

Diff for: system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_conf_template.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ extern "C" {
127127
#define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz.
128128
The real value my vary depending on manufacturing process variations.*/
129129
#endif /* HSI48_VALUE */
130-
#endif
130+
#endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
131131

132132
/**
133133
* @brief Internal Low Speed oscillator (LSI) value.
@@ -167,7 +167,7 @@ in voltage and temperature.*/
167167
#if !defined (EXTERNAL_I2S2_CLOCK_VALUE)
168168
#define EXTERNAL_I2S2_CLOCK_VALUE 48000U /*!< Value of the I2S2 External clock source in Hz*/
169169
#endif /* EXTERNAL_I2S2_CLOCK_VALUE */
170-
#endif
170+
#endif /* STM32G0C1xx || STM32G0B1xx || STM32G0B0xx */
171171

172172
/* Tip: To avoid modifying this file each time you need to use different HSE,
173173
=== you can define the HSE value in your toolchain compiler preprocessor. */

Diff for: system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_crc.h

+28-27
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,22 @@ typedef struct
6060
{
6161
uint8_t DefaultPolynomialUse; /*!< This parameter is a value of @ref CRC_Default_Polynomial and indicates if default polynomial is used.
6262
If set to DEFAULT_POLYNOMIAL_ENABLE, resort to default
63-
X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 +X^8 + X^7 + X^5 + X^4 + X^2+ X +1.
63+
X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 +X^8 + X^7 + X^5 +
64+
X^4 + X^2+ X +1.
6465
In that case, there is no need to set GeneratingPolynomial field.
65-
If otherwise set to DEFAULT_POLYNOMIAL_DISABLE, GeneratingPolynomial and CRCLength fields must be set. */
66+
If otherwise set to DEFAULT_POLYNOMIAL_DISABLE, GeneratingPolynomial and
67+
CRCLength fields must be set. */
6668

6769
uint8_t DefaultInitValueUse; /*!< This parameter is a value of @ref CRC_Default_InitValue_Use and indicates if default init value is used.
6870
If set to DEFAULT_INIT_VALUE_ENABLE, resort to default
69-
0xFFFFFFFF value. In that case, there is no need to set InitValue field.
70-
If otherwise set to DEFAULT_INIT_VALUE_DISABLE, InitValue field must be set. */
71+
0xFFFFFFFF value. In that case, there is no need to set InitValue field. If
72+
otherwise set to DEFAULT_INIT_VALUE_DISABLE, InitValue field must be set. */
7173

7274
uint32_t GeneratingPolynomial; /*!< Set CRC generating polynomial as a 7, 8, 16 or 32-bit long value for a polynomial degree
73-
respectively equal to 7, 8, 16 or 32. This field is written in normal representation,
74-
e.g., for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1 is written 0x65.
75-
No need to specify it if DefaultPolynomialUse is set to DEFAULT_POLYNOMIAL_ENABLE. */
75+
respectively equal to 7, 8, 16 or 32. This field is written in normal,
76+
representation e.g., for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1
77+
is written 0x65. No need to specify it if DefaultPolynomialUse is set to
78+
DEFAULT_POLYNOMIAL_ENABLE. */
7679

7780
uint32_t CRCLength; /*!< This parameter is a value of @ref CRC_Polynomial_Sizes and indicates CRC length.
7881
Value can be either one of
@@ -87,14 +90,18 @@ typedef struct
8790
uint32_t InputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Input_Data_Inversion and specifies input data inversion mode.
8891
Can be either one of the following values
8992
@arg @ref CRC_INPUTDATA_INVERSION_NONE no input data inversion
90-
@arg @ref CRC_INPUTDATA_INVERSION_BYTE byte-wise inversion, 0x1A2B3C4D becomes 0x58D43CB2
91-
@arg @ref CRC_INPUTDATA_INVERSION_HALFWORD halfword-wise inversion, 0x1A2B3C4D becomes 0xD458B23C
92-
@arg @ref CRC_INPUTDATA_INVERSION_WORD word-wise inversion, 0x1A2B3C4D becomes 0xB23CD458 */
93+
@arg @ref CRC_INPUTDATA_INVERSION_BYTE byte-wise inversion, 0x1A2B3C4D
94+
becomes 0x58D43CB2
95+
@arg @ref CRC_INPUTDATA_INVERSION_HALFWORD halfword-wise inversion,
96+
0x1A2B3C4D becomes 0xD458B23C
97+
@arg @ref CRC_INPUTDATA_INVERSION_WORD word-wise inversion, 0x1A2B3C4D
98+
becomes 0xB23CD458 */
9399

94100
uint32_t OutputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Output_Data_Inversion and specifies output data (i.e. CRC) inversion mode.
95101
Can be either
96102
@arg @ref CRC_OUTPUTDATA_INVERSION_DISABLE no CRC inversion,
97-
@arg @ref CRC_OUTPUTDATA_INVERSION_ENABLE CRC 0x11223344 is converted into 0x22CC4488 */
103+
@arg @ref CRC_OUTPUTDATA_INVERSION_ENABLE CRC 0x11223344 is converted
104+
into 0x22CC4488 */
98105
} CRC_InitTypeDef;
99106

100107
/**
@@ -112,12 +119,16 @@ typedef struct
112119

113120
uint32_t InputDataFormat; /*!< This parameter is a value of @ref CRC_Input_Buffer_Format and specifies input data format.
114121
Can be either
115-
@arg @ref CRC_INPUTDATA_FORMAT_BYTES input data is a stream of bytes (8-bit data)
116-
@arg @ref CRC_INPUTDATA_FORMAT_HALFWORDS input data is a stream of half-words (16-bit data)
117-
@arg @ref CRC_INPUTDATA_FORMAT_WORDS input data is a stream of words (32-bit data)
118-
119-
Note that constant CRC_INPUT_FORMAT_UNDEFINED is defined but an initialization error
120-
must occur if InputBufferFormat is not one of the three values listed above */
122+
@arg @ref CRC_INPUTDATA_FORMAT_BYTES input data is a stream of bytes
123+
(8-bit data)
124+
@arg @ref CRC_INPUTDATA_FORMAT_HALFWORDS input data is a stream of
125+
half-words (16-bit data)
126+
@arg @ref CRC_INPUTDATA_FORMAT_WORDS input data is a stream of words
127+
(32-bit data)
128+
129+
Note that constant CRC_INPUT_FORMAT_UNDEFINED is defined but an initialization
130+
error must occur if InputBufferFormat is not one of the three values listed
131+
above */
121132
} CRC_HandleTypeDef;
122133
/**
123134
* @}
@@ -199,15 +210,6 @@ typedef struct
199210
* @}
200211
*/
201212

202-
/** @defgroup CRC_Aliases CRC API aliases
203-
* @{
204-
*/
205-
#define HAL_CRC_Input_Data_Reverse HAL_CRCEx_Input_Data_Reverse /*!< Aliased to HAL_CRCEx_Input_Data_Reverse for inter STM32 series compatibility */
206-
#define HAL_CRC_Output_Data_Reverse HAL_CRCEx_Output_Data_Reverse /*!< Aliased to HAL_CRCEx_Output_Data_Reverse for inter STM32 series compatibility */
207-
/**
208-
* @}
209-
*/
210-
211213
/**
212214
* @}
213215
*/
@@ -267,7 +269,6 @@ typedef struct
267269
#define IS_DEFAULT_POLYNOMIAL(DEFAULT) (((DEFAULT) == DEFAULT_POLYNOMIAL_ENABLE) || \
268270
((DEFAULT) == DEFAULT_POLYNOMIAL_DISABLE))
269271

270-
271272
#define IS_DEFAULT_INIT_VALUE(VALUE) (((VALUE) == DEFAULT_INIT_VALUE_ENABLE) || \
272273
((VALUE) == DEFAULT_INIT_VALUE_DISABLE))
273274

Diff for: system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_cryp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ typedef enum
107107
typedef struct __CRYP_HandleTypeDef
108108
#else
109109
typedef struct
110-
#endif
110+
#endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */
111111
{
112112
AES_TypeDef *Instance; /*!< AES Register base address */
113113

Diff for: system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dac.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ typedef enum
6464
typedef struct __DAC_HandleTypeDef
6565
#else
6666
typedef struct
67-
#endif
67+
#endif /* USE_HAL_DAC_REGISTER_CALLBACKS */
6868
{
6969
DAC_TypeDef *Instance; /*!< Register base address */
7070

Diff for: system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_def.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ typedef enum
110110
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
111111
#ifndef __weak
112112
#define __weak __attribute__((weak))
113-
#endif
113+
#endif /* __weak */
114114
#ifndef __packed
115115
#define __packed __attribute__((packed))
116-
#endif
116+
#endif /* __packed */
117117
#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
118118
#ifndef __weak
119119
#define __weak __attribute__((weak))
@@ -129,10 +129,10 @@ typedef enum
129129
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
130130
#ifndef __ALIGN_BEGIN
131131
#define __ALIGN_BEGIN
132-
#endif
132+
#endif /* __ALIGN_BEGIN */
133133
#ifndef __ALIGN_END
134134
#define __ALIGN_END __attribute__ ((aligned (4)))
135-
#endif
135+
#endif /* __ALIGN_END */
136136
#elif defined (__GNUC__) && !defined (__CC_ARM) /* GNU Compiler */
137137
#ifndef __ALIGN_END
138138
#define __ALIGN_END __attribute__ ((aligned (4U)))
@@ -185,7 +185,7 @@ typedef enum
185185
*/
186186
#define __RAM_FUNC __attribute__((section(".RamFunc")))
187187

188-
#endif
188+
#endif /* __CC_ARM || __ARMCC_VERSION */
189189

190190
/**
191191
* @brief __NOINLINE definition
@@ -202,7 +202,7 @@ typedef enum
202202
*/
203203
#define __NOINLINE _Pragma("optimize = no_inline")
204204

205-
#endif
205+
#endif /* __CC_ARM || __ARMCC_VERSION */
206206

207207

208208
#ifdef __cplusplus

0 commit comments

Comments
 (0)