Skip to content

Commit 08b05e4

Browse files
committed
system(c5) add STM32C5xx HAL Drivers to v2.0.0
Included in STM32CubeC5 FW 2.0.0 Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 23ebbe8 commit 08b05e4

144 files changed

Lines changed: 289447 additions & 0 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.
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32_hal.h
4+
* @brief This file contains all the function prototypes for the HAL
5+
* module driver, whatever the STM32 family.
6+
******************************************************************************
7+
* @attention
8+
*
9+
* Copyright (c) 2026 STMicroelectronics.
10+
* All rights reserved.
11+
*
12+
* This software is licensed under terms that can be found in the LICENSE file
13+
* in the root directory of this software component.
14+
* If no LICENSE file comes with this software, it is provided AS-IS.
15+
*
16+
******************************************************************************
17+
*/
18+
19+
/* Define to prevent recursive inclusion -------------------------------------*/
20+
#ifndef STM32_HAL_H
21+
#define STM32_HAL_H
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
/* Includes ------------------------------------------------------------------*/
28+
#include "stm32c5xx_hal.h"
29+
30+
#if defined(USE_HAL_MUTEX) && (USE_HAL_MUTEX == 1)
31+
#include "stm32_hal_os.h"
32+
#endif /* USE_HAL_MUTEX == 1 */
33+
34+
#if defined(USE_HAL_RCC_MODULE) && (USE_HAL_RCC_MODULE == 1)
35+
#include "stm32c5xx_hal_rcc.h"
36+
#endif /* USE_HAL_RCC_MODULE == 1 */
37+
38+
#if defined(USE_HAL_GPIO_MODULE) && (USE_HAL_GPIO_MODULE == 1)
39+
#include "stm32c5xx_hal_gpio.h"
40+
#endif /* USE_HAL_GPIO_MODULE == 1 */
41+
42+
#if defined(USE_HAL_DMA_MODULE) && (USE_HAL_DMA_MODULE == 1)
43+
#include "stm32c5xx_hal_dma.h"
44+
#endif /* USE_HAL_DMA_MODULE == 1 */
45+
46+
#if defined(USE_HAL_CORTEX_MODULE) && (USE_HAL_CORTEX_MODULE == 1)
47+
#include "stm32c5xx_hal_cortex.h"
48+
#endif /* USE_HAL_CORTEX_MODULE == 1 */
49+
50+
#if defined(USE_HAL_ADC_MODULE) && (USE_HAL_ADC_MODULE == 1)
51+
#include "stm32c5xx_hal_adc.h"
52+
#endif /* USE_HAL_ADC_MODULE == 1 */
53+
54+
#if defined(USE_HAL_AES_MODULE) && (USE_HAL_AES_MODULE == 1)
55+
#include "stm32c5xx_hal_aes.h"
56+
#endif /* USE_HAL_AES_MODULE == 1 */
57+
58+
#if defined(USE_HAL_CCB_MODULE) && (USE_HAL_CCB_MODULE == 1)
59+
#include "stm32c5xx_hal_ccb.h"
60+
#endif /* USE_HAL_CCB_MODULE == 1 */
61+
62+
#if defined(USE_HAL_CORDIC_MODULE) && (USE_HAL_CORDIC_MODULE == 1)
63+
#include "stm32c5xx_hal_cordic.h"
64+
#endif /* USE_HAL_CORDIC_MODULE == 1 */
65+
66+
#if defined(USE_HAL_COMP_MODULE) && (USE_HAL_COMP_MODULE == 1)
67+
#include "stm32c5xx_hal_comp.h"
68+
#endif /* USE_HAL_COMP_MODULE == 1 */
69+
70+
#if defined(USE_HAL_CRC_MODULE) && (USE_HAL_CRC_MODULE == 1)
71+
#include "stm32c5xx_hal_crc.h"
72+
#endif /* USE_HAL_CRC_MODULE == 1 */
73+
74+
#if defined(USE_HAL_CRS_MODULE) && (USE_HAL_CRS_MODULE == 1)
75+
#include "stm32c5xx_hal_crs.h"
76+
#endif /* USE_HAL_CRS_MODULE == 1 */
77+
78+
#if defined(USE_HAL_DAC_MODULE) && (USE_HAL_DAC_MODULE == 1)
79+
#include "stm32c5xx_hal_dac.h"
80+
#endif /* USE_HAL_DAC_MODULE == 1 */
81+
82+
#if defined(USE_HAL_DBGMCU_MODULE) && (USE_HAL_DBGMCU_MODULE == 1)
83+
#include "stm32c5xx_hal_dbgmcu.h"
84+
#endif /* USE_HAL_DBGMCU_MODULE == 1 */
85+
86+
#if defined(USE_HAL_ETH_MODULE) && (USE_HAL_ETH_MODULE == 1)
87+
#include "stm32c5xx_hal_eth.h"
88+
#endif /* USE_HAL_ETH_MODULE == 1 */
89+
90+
#if defined(USE_HAL_EXTI_MODULE) && (USE_HAL_EXTI_MODULE == 1)
91+
#include "stm32c5xx_hal_exti.h"
92+
#endif /* USE_HAL_EXTI_MODULE == 1 */
93+
94+
#if defined(USE_HAL_FDCAN_MODULE) && (USE_HAL_FDCAN_MODULE == 1)
95+
#include "stm32c5xx_hal_fdcan.h"
96+
#endif /* USE_HAL_FDCAN_MODULE == 1 */
97+
98+
#if defined(USE_HAL_FLASH_MODULE) && (USE_HAL_FLASH_MODULE == 1)
99+
#include "stm32c5xx_hal_flash.h"
100+
#endif /* USE_HAL_FLASH_MODULE == 1 */
101+
102+
#if defined(USE_HAL_HASH_MODULE) && (USE_HAL_HASH_MODULE == 1)
103+
#include "stm32c5xx_hal_hash.h"
104+
#endif /* USE_HAL_HASH_MODULE == 1 */
105+
106+
#if defined(USE_HAL_HCD_MODULE) && (USE_HAL_HCD_MODULE == 1)
107+
#include "stm32c5xx_hal_hcd.h"
108+
#endif /* USE_HAL_HCD_MODULE == 1 */
109+
110+
#if defined(USE_HAL_I2C_MODULE) && (USE_HAL_I2C_MODULE == 1)
111+
#include "stm32c5xx_hal_i2c.h"
112+
#endif /* USE_HAL_I2C_MODULE == 1 */
113+
114+
#if defined(USE_HAL_I2S_MODULE) && (USE_HAL_I2S_MODULE == 1)
115+
#include "stm32c5xx_hal_i2s.h"
116+
#endif /* USE_HAL_I2S_MODULE == 1 */
117+
118+
#if defined(USE_HAL_I3C_MODULE) && (USE_HAL_I3C_MODULE == 1)
119+
#include "stm32c5xx_hal_i3c.h"
120+
#endif /* USE_HAL_I3C_MODULE == 1 */
121+
122+
#if defined(USE_HAL_ICACHE_MODULE) && (USE_HAL_ICACHE_MODULE == 1)
123+
#include "stm32c5xx_hal_icache.h"
124+
#endif /* USE_HAL_ICACHE_MODULE == 1 */
125+
126+
#if defined(USE_HAL_IWDG_MODULE) && (USE_HAL_IWDG_MODULE == 1)
127+
#include "stm32c5xx_hal_iwdg.h"
128+
#endif /* USE_HAL_IWDG_MODULE == 1 */
129+
130+
#if defined(USE_HAL_LPTIM_MODULE) && (USE_HAL_LPTIM_MODULE == 1)
131+
#include "stm32c5xx_hal_lptim.h"
132+
#endif /* USE_HAL_LPTIM_MODULE == 1 */
133+
134+
#if defined(USE_HAL_OPAMP_MODULE) && (USE_HAL_OPAMP_MODULE == 1)
135+
#include "stm32c5xx_hal_opamp.h"
136+
#endif /* USE_HAL_OPAMP_MODULE == 1 */
137+
138+
#if defined(USE_HAL_PCD_MODULE) && (USE_HAL_PCD_MODULE == 1)
139+
#include "stm32c5xx_hal_pcd.h"
140+
#endif /* USE_HAL_PCD_MODULE == 1 */
141+
142+
#if defined(USE_HAL_PKA_MODULE) && (USE_HAL_PKA_MODULE == 1)
143+
#include "stm32c5xx_hal_pka.h"
144+
#endif /* USE_HAL_PKA_MODULE == 1 */
145+
146+
#if defined(USE_HAL_PWR_MODULE) && (USE_HAL_PWR_MODULE == 1)
147+
#include "stm32c5xx_hal_pwr.h"
148+
#endif /* USE_HAL_PWR_MODULE == 1 */
149+
150+
#if defined(USE_HAL_RAMCFG_MODULE) && (USE_HAL_RAMCFG_MODULE == 1)
151+
#include "stm32c5xx_hal_ramcfg.h"
152+
#endif /* USE_HAL_RAMCFG_MODULE == 1 */
153+
154+
#if defined(USE_HAL_RNG_MODULE) && (USE_HAL_RNG_MODULE == 1)
155+
#include "stm32c5xx_hal_rng.h"
156+
#endif /* USE_HAL_RNG_MODULE == 1 */
157+
158+
#if defined(USE_HAL_RTC_MODULE) && (USE_HAL_RTC_MODULE == 1)
159+
#include "stm32c5xx_hal_rtc.h"
160+
#endif /* USE_HAL_RTC_MODULE == 1 */
161+
162+
#if defined(USE_HAL_SBS_MODULE) && (USE_HAL_SBS_MODULE == 1)
163+
#include "stm32c5xx_hal_sbs.h"
164+
#endif /* USE_HAL_SBS_MODULE == 1 */
165+
166+
#if defined(USE_HAL_SMBUS_MODULE) && (USE_HAL_SMBUS_MODULE == 1)
167+
#include "stm32c5xx_hal_smbus.h"
168+
#endif /* USE_HAL_SMBUS_MODULE == 1 */
169+
170+
#if defined(USE_HAL_SMARTCARD_MODULE) && (USE_HAL_SMARTCARD_MODULE == 1)
171+
#include "stm32c5xx_hal_smartcard.h"
172+
#endif /* USE_HAL_SMARTCARD_MODULE == 1 */
173+
174+
#if defined(USE_HAL_SPI_MODULE) && (USE_HAL_SPI_MODULE == 1)
175+
#include "stm32c5xx_hal_spi.h"
176+
#endif /* USE_HAL_SPI_MODULE == 1 */
177+
178+
#if defined(USE_HAL_TAMP_MODULE) && (USE_HAL_TAMP_MODULE == 1)
179+
#include "stm32c5xx_hal_tamp.h"
180+
#endif /* USE_HAL_TAMP_MODULE == 1 */
181+
182+
#if defined(USE_HAL_TIM_MODULE) && (USE_HAL_TIM_MODULE == 1)
183+
#include "stm32c5xx_hal_tim.h"
184+
#endif /* USE_HAL_TIM_MODULE == 1 */
185+
186+
#if defined(USE_HAL_UART_MODULE) && (USE_HAL_UART_MODULE == 1)
187+
#include "stm32c5xx_hal_uart.h"
188+
#endif /* USE_HAL_UART_MODULE == 1 */
189+
190+
#if defined(USE_HAL_USART_MODULE) && (USE_HAL_USART_MODULE == 1)
191+
#include "stm32c5xx_hal_usart.h"
192+
#endif /* USE_HAL_USART_MODULE == 1 */
193+
194+
#if defined(USE_HAL_WWDG_MODULE) && (USE_HAL_WWDG_MODULE == 1)
195+
#include "stm32c5xx_hal_wwdg.h"
196+
#endif /* USE_HAL_WWDG_MODULE == 1 */
197+
198+
#if defined(USE_HAL_XSPI_MODULE) && (USE_HAL_XSPI_MODULE == 1)
199+
#include "stm32c5xx_hal_xspi.h"
200+
#endif /* USE_HAL_XSPI_MODULE == 1 */
201+
202+
#if defined(USE_FULL_ASSERT)
203+
#ifndef USE_ASSERT_DBG_PARAM
204+
#define USE_ASSERT_DBG_PARAM
205+
#endif /* !USE_ASSERT_DBG_PARAM */
206+
#ifndef USE_ASSERT_DBG_STATE
207+
#define USE_ASSERT_DBG_STATE
208+
#endif /* !USE_ASSERT_DBG_STATE */
209+
#endif /* USE_FULL_ASSERT */
210+
211+
#if defined(USE_ASSERT_DBG_PARAM) || defined(USE_ASSERT_DBG_STATE)
212+
#include "stm32_assert.h"
213+
#else
214+
#define ASSERT_DBG_PARAM(expr) ((void) 0U)
215+
#define ASSERT_DBG_STATE(__STATE__,__VAL__) ((void)0U)
216+
#endif /* USE_ASSERT_DBG_PARAM || USE_ASSERT_DBG_STATE */
217+
218+
/* Exported variables --------------------------------------------------------*/
219+
/* Exported functions --------------------------------------------------------*/
220+
/* Private types -------------------------------------------------------------*/
221+
/* Private variables ---------------------------------------------------------*/
222+
/* Private constants ---------------------------------------------------------*/
223+
/* Private macros ------------------------------------------------------------*/
224+
/* Private functions ---------------------------------------------------------*/
225+
226+
#ifdef __cplusplus
227+
}
228+
#endif
229+
230+
#endif /* STM32_HAL_H */
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32_utils_fdcan.h
4+
* @brief Header file for STM32 UTILS FDCAN module.
5+
******************************************************************************
6+
* @attention
7+
*
8+
* Copyright (c) 2026 STMicroelectronics.
9+
* All rights reserved.
10+
*
11+
* This software is licensed under terms that can be found in the LICENSE file
12+
* in the root directory of this software component.
13+
* If no LICENSE file comes with this software, it is provided AS-IS.
14+
*
15+
******************************************************************************
16+
*/
17+
18+
/* Define to prevent recursive inclusion -------------------------------------*/
19+
#ifndef STM32_UTILS_FDCAN_H
20+
#define STM32_UTILS_FDCAN_H
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif /* __cplusplus */
25+
26+
/* Includes ------------------------------------------------------------------*/
27+
#include <stdint.h>
28+
#include <stddef.h>
29+
30+
/** @addtogroup STM32C5xx_UTILS_Driver
31+
* @{
32+
*/
33+
34+
/** @defgroup UTILS_FDCAN UTILS_FDCAN
35+
* @{
36+
*/
37+
38+
/* Exported types ------------------------------------------------------------*/
39+
/** @defgroup UTILS_FDCAN_Exported_Types UTILS FDCAN Types
40+
* @{
41+
*/
42+
43+
/**
44+
* @brief FDCAN Utils status structure definition.
45+
*/
46+
typedef enum
47+
{
48+
STM32_UTILS_FDCAN_OK = 0x00000000U, /*!< Utils FDCAN operation completed successfully */
49+
STM32_UTILS_FDCAN_ERROR = 0xFFFFFFFFU, /*!< Utils FDCAN operation completed with error */
50+
STM32_UTILS_FDCAN_INVALID_PARAM = 0xAAAAAAAAU, /*!< Utils FDCAN invalid parameter */
51+
} stm32_utils_fdcan_status_t;
52+
53+
/**
54+
* @brief FDCAN Output real bus parameters obtained with computed bit timings.
55+
*/
56+
typedef struct
57+
{
58+
uint32_t real_bitrate_kbps; /*!< Real bus bitrate in kbit/s */
59+
uint16_t real_sample_point_per_mille; /*!< Real sample point in per mille (percent * 10) */
60+
} stm32_utils_fdcan_output_config_t;
61+
62+
/**
63+
* @brief FDCAN Input bus parameters.
64+
*/
65+
typedef struct
66+
{
67+
uint32_t fdcan_ker_clk_khz; /*!< FDCAN kernel clk in kHz */
68+
uint32_t desired_bitrate_kbps; /*!< Desired bus bitrate in kbit/s */
69+
uint16_t sample_point_per_mille; /*!< Sample point in per mille (percent * 10) */
70+
uint8_t bitrate_tolerance_per_mille; /*!< Maximum bitrate tolerance in per mille (percent * 10) */
71+
} stm32_utils_fdcan_input_bus_param_t;
72+
73+
/**
74+
* @brief FDCAN Timing structure definition. Applicable to nominal or data bit timing.
75+
*/
76+
typedef struct
77+
{
78+
uint32_t prescaler; /*!< Specifies the value by which the oscillator frequency is divided
79+
for generating the nominal bit time quanta. */
80+
uint32_t sync_jump_width; /*!< Specifies the maximum number of time quanta the FDCAN hardware is
81+
allowed to lengthen or shorten a bit to perform resynchronization. */
82+
uint32_t time_seg1; /*!< Specifies the number of time quanta in Bit Segment 1. */
83+
uint32_t time_seg2; /*!< Specifies the number of time quanta in Bit Segment 2. */
84+
} stm32_utils_fdcan_bit_timing_t;
85+
86+
/**
87+
* @brief FDCAN Nominal or data bit timing types.
88+
*/
89+
typedef enum
90+
{
91+
STM32_UTILS_FDCAN_BIT_TIMING_TYPE_NOMINAL = 0U, /*!< Nominal bit timing */
92+
STM32_UTILS_FDCAN_BIT_TIMING_TYPE_DATA = 1U, /*!< Data bit timing */
93+
} stm32_utils_fdcan_bit_timing_type_t;
94+
95+
/**
96+
* @}
97+
*/
98+
99+
/* Exported functions ---------------------------------------------------------*/
100+
/** @defgroup UTILS_FDCAN_Exported_Functions UTILS FDCAN Functions
101+
* @{
102+
*/
103+
104+
stm32_utils_fdcan_status_t STM32_UTILS_FDCAN_ComputeBitTiming(const stm32_utils_fdcan_input_bus_param_t *p_bus_param,
105+
stm32_utils_fdcan_bit_timing_type_t bit_timing_type,
106+
stm32_utils_fdcan_bit_timing_t *p_output_bit_timing,
107+
stm32_utils_fdcan_output_config_t *p_output_config);
108+
109+
stm32_utils_fdcan_status_t STM32_UTILS_FDCAN_ComputeBitrate(const stm32_utils_fdcan_bit_timing_t *p_bit_timing,
110+
uint32_t fdcan_clk_khz,
111+
stm32_utils_fdcan_output_config_t *p_output_config);
112+
113+
/**
114+
* @}
115+
*/
116+
117+
/**
118+
* @}
119+
*/
120+
121+
/**
122+
* @}
123+
*/
124+
125+
#ifdef __cplusplus
126+
}
127+
#endif /* __cplusplus */
128+
129+
#endif /* STM32_UTILS_FDCAN_H */

0 commit comments

Comments
 (0)