Skip to content

Commit 729184a

Browse files
committed
system(c5) update STM32C5xx HAL Drivers to v2.1.0
Included in STM32CubeC5 FW 2.1.0 Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent e578c58 commit 729184a

89 files changed

Lines changed: 13834 additions & 8656 deletions

File tree

Some content is hidden

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

‎system/Drivers/STM32C5xx_HAL_Driver/Inc/stm32c5xx_hal.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern "C" {
4545
* @{
4646
*/
4747
#define HAL_VERSION_MAIN (2UL) /*!< HAL driver version bitfield [31:24]: main version */
48-
#define HAL_VERSION_SUB1 (0UL) /*!< HAL driver version bitfield [23:16]: sub1 version */
48+
#define HAL_VERSION_SUB1 (1UL) /*!< HAL driver version bitfield [23:16]: sub1 version */
4949
#define HAL_VERSION_SUB2 (0UL) /*!< HAL driver version bitfield [15:8]: sub2 version */
5050
#define HAL_VERSION_RC (0UL) /*!< HAL driver version bitfield [7:0]: release candidate */
5151
#define HAL_VERSION ((HAL_VERSION_MAIN << 24U)\
@@ -115,7 +115,6 @@ hal_status_t HAL_Init(void);
115115
hal_status_t HAL_DeInit(void);
116116
hal_status_t HAL_InitTick(hal_tick_freq_t tick_freq, uint32_t tick_priority);
117117
hal_status_t HAL_UpdateCoreClock(void);
118-
119118
/**
120119
* @}
121120
*/

‎system/Drivers/STM32C5xx_HAL_Driver/Inc/stm32c5xx_hal_adc.h‎

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
******************************************************************************
2+
**********************************************************************************************************************
33
* @file stm32c5xx_hal_adc.h
44
* @brief Header file of ADC HAL module.
5-
******************************************************************************
5+
**********************************************************************************************************************
66
* @attention
77
*
88
* Copyright (c) 2026 STMicroelectronics.
@@ -12,18 +12,19 @@
1212
* in the root directory of this software component.
1313
* If no LICENSE file comes with this software, it is provided AS-IS.
1414
*
15-
******************************************************************************
15+
*
16+
**********************************************************************************************************************
1617
*/
1718

18-
/* Define to prevent recursive inclusion -------------------------------------*/
19+
/* Define to prevent recursive inclusion -----------------------------------------------------------------------------*/
1920
#ifndef STM32C5XX_HAL_ADC_H
2021
#define STM32C5XX_HAL_ADC_H
2122

2223
#ifdef __cplusplus
2324
extern "C" {
2425
#endif /* __cplusplus */
2526

26-
/* Includes ------------------------------------------------------------------*/
27+
/* Includes ----------------------------------------------------------------------------------------------------------*/
2728
#include "stm32c5xx_hal_def.h"
2829
#include "stm32c5xx_ll_adc.h"
2930

@@ -37,7 +38,7 @@ extern "C" {
3738
* @{
3839
*/
3940

40-
/* Private constants ---------------------------------------------------------*/
41+
/* Private constants -------------------------------------------------------------------------------------------------*/
4142
/** @addtogroup ADC_Private_Constants
4243
* @{
4344
*/
@@ -52,8 +53,8 @@ extern "C" {
5253
* @}
5354
*/
5455

55-
/* Exported constants ---------------------------------------------------------*/
56-
/** @defgroup ADC_Exported_Constants HAL ADC Constants
56+
/* Exported constants ------------------------------------------------------------------------------------------------*/
57+
/** @defgroup ADC_Exported_Constants HAL ADC Exported Constants
5758
* @{
5859
*/
5960

@@ -126,11 +127,12 @@ extern "C" {
126127
* @}
127128
*/
128129

130+
129131
/**
130132
* @}
131133
*/
132134

133-
/* Exported macro -------------------------------------------------------------*/
135+
/* Exported macro ----------------------------------------------------------------------------------------------------*/
134136
/** @defgroup ADC_Exported_Macro ADC Exported Macro
135137
* @{
136138
*/
@@ -285,8 +287,8 @@ LL_ADC_CONVERT_DATA_RESOLUTION((data), \
285287
* @}
286288
*/
287289

288-
/* Exported types ------------------------------------------------------------*/
289-
/** @defgroup ADC_Exported_Types HAL ADC Types
290+
/* Exported types ----------------------------------------------------------------------------------------------------*/
291+
/** @defgroup ADC_Exported_Types ADC Exported Types
290292
* @{
291293
*/
292294

@@ -496,11 +498,13 @@ typedef enum
496498
HAL_ADC_REG_TRIG_TIM8_TRGO = LL_ADC_REG_TRIG_TIM8_TRGO, /*!< ADC group regular conversion
497499
trigger from periph: TIM8 TRGO */
498500
HAL_ADC_REG_TRIG_TIM8_TRGO2 = LL_ADC_REG_TRIG_TIM8_TRGO2, /*!< ADC group regular conversion
499-
trigger from periph: TIM5 TRGO */
501+
trigger from periph: TIM8 TRGO2 */
500502
HAL_ADC_REG_TRIG_TIM15_TRGO = LL_ADC_REG_TRIG_TIM15_TRGO, /*!< ADC group regular conversion
501503
trigger from periph: TIM15 TRGO */
504+
#if defined(LPTIM1)
502505
HAL_ADC_REG_TRIG_LPTIM1_OC1 = LL_ADC_REG_TRIG_LPTIM1_OC1, /*!< ADC group regular conversion
503506
trigger from periph: LPTIM1 channel 1. */
507+
#endif /* LPTIM1 */
504508
} hal_adc_reg_trig_src_t;
505509

506510
/**
@@ -621,8 +625,10 @@ typedef enum
621625
trigger from external peripheral: TIM12 TRGO */
622626
HAL_ADC_INJ_TRIG_TIM15_TRGO = LL_ADC_INJ_TRIG_TIM15_TRGO, /*!< ADC group injected conversion
623627
trigger from external peripheral: TIM15 TRGO */
628+
#if defined(LPTIM1)
624629
HAL_ADC_INJ_TRIG_LPTIM1_OC1 = LL_ADC_INJ_TRIG_LPTIM1_OC1, /*!< ADC group injected conversion
625630
trigger from external peripheral: LPTIM1 channel 1 */
631+
#endif /* LPTIM1 */
626632
HAL_ADC_INJ_TRIG_FROM_REGULAR = LL_ADC_INJ_TRIG_FROM_REGULAR /*!< ADC group injected conversion
627633
trigger from ADC group regular end of sequence (no action ADC group injected
628634
conversion start or stop).
@@ -1040,15 +1046,17 @@ typedef struct
10401046
*/
10411047
typedef struct
10421048
{
1043-
hal_adc_left_bit_shift_t left_bit_shift; /*!< ADC data post-processing: left bit shift */
1049+
hal_adc_left_bit_shift_t left_bit_shift; /*!< ADC data post-processing: left bit shift
1050+
for ADC groups regular and injected conversions. */
10441051
uint32_t gain_compensation_x1000; /*!< ADC data post-processing: ADC gain coefficient
10451052
applied to raw conversions data. Value multiplied by 1000 to have an integer
10461053
value (example: to set coefficient 0.982, parameter value must be 982).
10471054
Therefore, unitary gain corresponds to value 1000.
10481055
Can be a number between: Min_Data = 0, Max_Data = 3999.
10491056
Note: Coefficient resolution managed by ADC peripheral is higher than 1/1000,
10501057
if needed to reach more accurate resolution, refer to function
1051-
LL_ADC_SetGainCompensation() */
1058+
LL_ADC_SetGainCompensation().
1059+
Note: Applies to ADC groups regular and injected conversions. */
10521060
} hal_adc_post_processing_config_t;
10531061

10541062
/**
@@ -1274,8 +1282,8 @@ struct hal_adc_handle_s
12741282
* @}
12751283
*/
12761284

1277-
/* Exported functions ---------------------------------------------------------*/
1278-
/** @defgroup ADC_Exported_Functions HAL ADC Functions
1285+
/* Exported functions ------------------------------------------------------------------------------------------------*/
1286+
/** @defgroup ADC_Exported_Functions ADC Exported Functions
12791287
* @{
12801288
*/
12811289

@@ -1398,7 +1406,7 @@ hal_status_t HAL_ADC_RegisterAwdOutOfWindowCallback(hal_adc_handle_t *hadc, hal_
13981406
* @}
13991407
*/
14001408

1401-
/** @defgroup ADC_Exported_Functions_Group4 Peripheral State, Error functions
1409+
/** @defgroup ADC_Exported_Functions_Group4 Peripheral state, errors, kernel clock frequency functions
14021410
* @{
14031411
*/
14041412
hal_adc_state_t HAL_ADC_GetState(const hal_adc_handle_t *hadc);

‎system/Drivers/STM32C5xx_HAL_Driver/Inc/stm32c5xx_hal_aes.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern "C" {
2525

2626
/* Includes ------------------------------------------------------------------*/
2727
#include "stm32c5xx_hal_def.h"
28+
#include "stm32c5xx_ll_rng.h"
2829

2930
/** @addtogroup STM32C5xx_HAL_Driver
3031
* @{

‎system/Drivers/STM32C5xx_HAL_Driver/Inc/stm32c5xx_hal_ccb.h‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern "C" {
2727
#include "stm32c5xx_hal_def.h"
2828
#include "stm32c5xx_ll_rng.h"
2929
#include "stm32c5xx_ll_pka.h"
30+
#include "stm32c5xx_ll_tamp.h"
3031
/** @addtogroup STM32C5xx_HAL_Driver
3132
* @{
3233
*/
@@ -419,7 +420,7 @@ hal_status_t HAL_CCB_RSA_SW_ComputeModularExp(hal_ccb_handle_t *hccb, const hal_
419420
const hal_ccb_wrapping_sw_key_context_t *p_wrapping_key_context,
420421
const uint32_t *p_in_wrapped_user_key,
421422
hal_ccb_rsa_key_blob_t *p_in_wrapped_private_key_blob,
422-
const uint8_t *p_out_operand, uint8_t *p_out_modular_exp);
423+
const uint8_t *p_in_operand, uint8_t *p_out_modular_exp);
423424
/**
424425
* @}
425426
*/
@@ -479,7 +480,7 @@ hal_status_t HAL_CCB_RSA_HW_WrapPrivateKey(hal_ccb_handle_t *hccb, const hal_ccb
479480
hal_status_t HAL_CCB_RSA_HW_ComputeModularExp(hal_ccb_handle_t *hccb, const hal_ccb_rsa_param_t *p_in_param,
480481
hal_ccb_wrapping_hw_key_type_t wrapping_hw_key_type,
481482
hal_ccb_rsa_key_blob_t *p_in_wrapped_private_key_blob,
482-
const uint8_t *p_out_operand, uint8_t *p_out_modular_exp);
483+
const uint8_t *p_in_operand, uint8_t *p_out_modular_exp);
483484
/**
484485
* @}
485486
*/
@@ -516,23 +517,11 @@ This section provides functions to manage CCB flags:
516517
* @arg @ref HAL_CCB_TAMP_EVT_PKA_RAM_REG PKA Register TAMP Event flag
517518
* @arg @ref HAL_CCB_TAMP_EVT_PKA_OPR PKA Operation TAMP Event flag
518519
* @arg @ref HAL_CCB_TAMP_EVT_CCB CCB TAMP Event flag
519-
* @retval uint32_t The state or value of flag .
520+
* @retval uint32_t The state or value of flag.
520521
*/
521522
__STATIC_INLINE uint32_t HAL_CCB_GetFlag(const hal_ccb_handle_t *hccb, uint32_t flag)
522523
{
523-
uint32_t status;
524-
525-
if ((flag == (uint32_t)HAL_CCB_FLAG_BUSY) || (flag == (uint32_t)HAL_CCB_TAMP_EVT_RNG)
526-
|| (flag == (uint32_t)HAL_CCB_TAMP_EVT_SAES) || (flag == (uint32_t)HAL_CCB_TAMP_EVT_PKA_RAM_REG)
527-
|| (flag == (uint32_t)HAL_CCB_TAMP_EVT_PKA_OPR) || (flag == (uint32_t)HAL_CCB_TAMP_EVT_CCB))
528-
{
529-
status = ((STM32_READ_BIT(((CCB_TypeDef *)((uint32_t)hccb->instance))->SR, flag) == flag) ? 1U : 0U);
530-
}
531-
else
532-
{
533-
status = 0;
534-
}
535-
return (status);
524+
return (((STM32_READ_BIT(((CCB_TypeDef *)((uint32_t)hccb->instance))->SR, flag) == flag) ? 1U : 0U));
536525
}
537526
/**
538527
* @}

‎system/Drivers/STM32C5xx_HAL_Driver/Inc/stm32c5xx_hal_comp.h‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern "C" {
3434
* @{
3535
*/
3636

37-
#if defined(COMP1)
37+
#if defined(COMP1) || defined(COMP2)
3838

3939
/** @defgroup COMP COMP
4040
* @{
@@ -50,12 +50,10 @@ extern "C" {
5050
*/
5151
typedef enum
5252
{
53-
#if defined(COMP2)
5453
HAL_COMP1 = COMP1_BASE,
55-
HAL_COMP2 = COMP2_BASE
56-
#else
57-
HAL_COMP1 = COMP1_BASE
58-
#endif
54+
#if defined(COMP2)
55+
HAL_COMP2 = COMP2_BASE,
56+
#endif /* COMP2 */
5957
} hal_comp_t;
6058

6159
/**
@@ -144,7 +142,7 @@ typedef enum
144142
to OPAMP1 output.
145143
Specific to COMP instances: COMP2 (available on devices STM32C53xx/54xx). */
146144
#endif /* COMP2 */
147-
HAL_COMP_INPUT_MINUS_TEMPSENSOR = LL_COMP_INPUT_MINUS_TEMPSENSOR, /*!< Comparator input minus connected
145+
HAL_COMP_INPUT_MINUS_TEMPSENSOR = LL_COMP_INPUT_MINUS_TEMPSENSOR, /*!< Comparator input minus connected
148146
to the internal temperature sensor (also accessible through the ADC
149147
peripheral).
150148
Note: Specific configuration with bitfields out of comparator registers
@@ -509,7 +507,7 @@ const void *HAL_COMP_GetUserData(const hal_comp_handle_t *hcomp);
509507
* @}
510508
*/
511509

512-
#endif /* COMP1 */
510+
#endif /* COMP1 || COMP2 || COMP3 || COMP4 */
513511

514512
/**
515513
* @}

‎system/Drivers/STM32C5xx_HAL_Driver/Inc/stm32c5xx_hal_cordic.h‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,16 +415,19 @@ hal_cordic_state_t HAL_CORDIC_GetState(const hal_cordic_handle_t *hcordic);
415415
* @}
416416
*/
417417

418-
#if defined (USE_HAL_CORDIC_USER_DATA) && (USE_HAL_CORDIC_USER_DATA == 1)
419-
/** @defgroup CORDIC_Exported_Functions_Group8 User Data functions
418+
/** @defgroup CORDIC_Exported_Functions_Group8 User Data and retrieve functions
420419
* @{
421420
*/
421+
#if defined (USE_HAL_CORDIC_USER_DATA) && (USE_HAL_CORDIC_USER_DATA == 1)
422422
void HAL_CORDIC_SetUserData(hal_cordic_handle_t *hcordic, const void *p_user_data);
423423
const void *HAL_CORDIC_GetUserData(const hal_cordic_handle_t *hcordic);
424+
#endif /* USE_HAL_CORDIC_USER_DATA */
425+
426+
hal_cordic_t HAL_CORDIC_GetInstance(const hal_cordic_handle_t *hcordic);
427+
CORDIC_TypeDef *HAL_CORDIC_GetLLInstance(const hal_cordic_handle_t *hcordic);
424428
/**
425429
* @}
426430
*/
427-
#endif /* USE_HAL_CORDIC_USER_DATA */
428431

429432
/**
430433
* @}

‎system/Drivers/STM32C5xx_HAL_Driver/Inc/stm32c5xx_hal_dac.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern "C" {
5252
*/
5353
typedef enum
5454
{
55-
HAL_DAC1 = DAC1_BASE, /*!< DAC1 */
55+
HAL_DAC1 = DAC1_BASE, /*!< DAC1 */
5656
} hal_dac_t;
5757

5858
/**
@@ -113,7 +113,9 @@ typedef enum
113113
HAL_DAC_TRIGGER_TIM8_TRGO = LL_DAC_TRIGGER_TIM8_TRGO, /*!< TIM8 TRGO selected as external conversion trigger for DAC channel. */
114114
HAL_DAC_TRIGGER_TIM12_TRGO = LL_DAC_TRIGGER_TIM12_TRGO, /*!< TIM12 TRGO selected as external conversion trigger for DAC channel. */
115115
HAL_DAC_TRIGGER_TIM15_TRGO = LL_DAC_TRIGGER_TIM15_TRGO, /*!< TIM15 TRGO selected as external conversion trigger for DAC channel. */
116+
#if defined(LPTIM1)
116117
HAL_DAC_TRIGGER_LPTIM1_OC1 = LL_DAC_TRIGGER_LPTIM1_OC1, /*!< LPTIM1 CH1 selected as external conversion trigger for DAC channel. */
118+
#endif /* LPTIM1 */
117119
HAL_DAC_TRIGGER_EXTI9 = LL_DAC_TRIGGER_EXTI9, /*!< EXTI Line9 event selected as external conversion trigger for DAC channel. */
118120
} hal_dac_trigger_t;
119121

@@ -678,7 +680,7 @@ const void *HAL_DAC_GetUserData(const hal_dac_handle_t *hdac);
678680
* @}
679681
*/
680682

681-
#endif /* DAC1 */
683+
#endif /* DAC1 || DAC2 */
682684

683685
/**
684686
* @}

0 commit comments

Comments
 (0)