Skip to content

Commit 013a1b0

Browse files
FRASTMerwango
authored andcommitted
stm32cube: update stm32u3 to cube version V1.2.0
Update Cube version for STM32U3xx series on https://github.com/STMicroelectronics from version v1.1.0 to version v1.2.0 Signed-off-by: F. Ramu <[email protected]>
1 parent a317d95 commit 013a1b0

32 files changed

+1293
-542
lines changed

stm32cube/stm32u3xx/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_DAC_EX drivers/src/stm32u3xx_h
2020
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_DMA drivers/src/stm32u3xx_hal_dma.c)
2121
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_DMA_EX drivers/src/stm32u3xx_hal_dma_ex.c)
2222
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_EXTI drivers/src/stm32u3xx_hal_exti.c)
23-
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_EXTI drivers/src/stm32u3xx_hal_fdcan.c)
23+
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_FDCAN drivers/src/stm32u3xx_hal_fdcan.c)
2424
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_FLASH drivers/src/stm32u3xx_hal_flash.c)
2525
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_FLASH_EX drivers/src/stm32u3xx_hal_flash_ex.c)
2626
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_GPIO drivers/src/stm32u3xx_hal_gpio.c)
@@ -37,7 +37,6 @@ zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_LPTIM drivers/src/stm32u3xx_ha
3737
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_MDF drivers/src/stm32u3xx_hal_mdf.c)
3838
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_MMC drivers/src/stm32u3xx_hal_mmc.c)
3939
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_MMC_EX drivers/src/stm32u3xx_hal_mmc_ex.c)
40-
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_MSP_TEMPLATE drivers/src/stm32u3xx_hal_msp_template.c)
4140
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_OPAMP drivers/src/stm32u3xx_hal_opamp.c)
4241
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_OPAMP_EX drivers/src/stm32u3xx_hal_opamp_ex.c)
4342
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PCD drivers/src/stm32u3xx_hal_pcd.c)
@@ -46,8 +45,6 @@ zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PKA drivers/src/stm32u3xx_hal_
4645
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PWR drivers/src/stm32u3xx_hal_pwr.c)
4746
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PWR_EX drivers/src/stm32u3xx_hal_pwr_ex.c)
4847
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_RAMCFG drivers/src/stm32u3xx_hal_ramcfg.c)
49-
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_RCC drivers/src/stm32u3xx_hal_rcc.c)
50-
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_RCC_EX drivers/src/stm32u3xx_hal_rcc_ex.c)
5148
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_RNG drivers/src/stm32u3xx_hal_rng.c)
5249
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_RNG_EX drivers/src/stm32u3xx_hal_rng_ex.c)
5350
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_RTC drivers/src/stm32u3xx_hal_rtc.c)
@@ -64,8 +61,6 @@ zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_SPI drivers/src/stm32u3xx_hal_
6461
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_SPI_EX drivers/src/stm32u3xx_hal_spi_ex.c)
6562
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_TIM drivers/src/stm32u3xx_hal_tim.c)
6663
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_TIM_EX drivers/src/stm32u3xx_hal_tim_ex.c)
67-
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_TIMEBASE_RTC_WAKEUP_TEMPLATE drivers/src/stm32u3xx_hal_timebase_rtc_wakeup_template.c)
68-
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_TIMEBASE_TIM_TEMPLATE drivers/src/stm32u3xx_hal_timebase_tim_template.c)
6964
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_TSC drivers/src/stm32u3xx_hal_tsc.c)
7065
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_UART drivers/src/stm32u3xx_hal_uart.c)
7166
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_UART_EX drivers/src/stm32u3xx_hal_uart_ex.c)
@@ -99,4 +94,3 @@ zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_TIM drivers/src/stm32u3xx_ll_ti
9994
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_USART drivers/src/stm32u3xx_ll_usart.c)
10095
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_USB drivers/src/stm32u3xx_ll_usb.c)
10196
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_UTILS drivers/src/stm32u3xx_ll_utils.c)
102-
zephyr_library_sources_ifdef(CONFIG_USE_STM32_UTIL_I3C drivers/src/stm32u3xx_util_i3c.c)

stm32cube/stm32u3xx/README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Origin:
66
https://www.st.com/en/embedded-software/stm32cubeu3.html
77

88
Status:
9-
version v1.1.0
9+
version v1.2.0
1010

1111
Purpose:
1212
ST Microelectronics official MCU package for STM32U3 series.
@@ -23,7 +23,7 @@ URL:
2323
https://github.com/STMicroelectronics/STM32CubeU3
2424

2525
Commit:
26-
6dead3ef988faf1bdb8087bf4239d6fcb80b1058
26+
72307d0719b421db6c2ae49fab8a10b7e7253b43
2727

2828
Maintained-by:
2929
External
@@ -48,4 +48,4 @@ Patch List:
4848
Impacted files:
4949
stm32cube/stm32u0xx/drivers/include/Legacy/stm32_hal_legacy.h
5050

51-
See release_note.html from STM32Cube
51+
See release_note.html from STM32Cube
Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
1-
/*
2-
* SPDX-License-Identifier: Apache-2.0
3-
* Copyright (c) 2025 STMicroelectronics
4-
*/
1+
/**
2+
******************************************************************************
3+
* @file stm32_assert.h
4+
* @author MCD Application Team
5+
* @brief STM32 assert template file.
6+
* This file should be copied to the application folder and renamed
7+
* to stm32_assert.h.
8+
******************************************************************************
9+
* @attention
10+
*
11+
* Copyright (c) 2023 STMicroelectronics.
12+
* All rights reserved.
13+
*
14+
* This software is licensed under terms that can be found in the LICENSE file
15+
* in the root directory of this software component.
16+
* If no LICENSE file comes with this software, it is provided AS-IS.
17+
*
18+
******************************************************************************
19+
*/
520

6-
#include <stm32u3xx_hal_conf.h>
21+
/* Define to prevent recursive inclusion -------------------------------------*/
22+
#ifndef __STM32_ASSERT_H
23+
#define __STM32_ASSERT_H
24+
25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
29+
/* Exported types ------------------------------------------------------------*/
30+
/* Exported constants --------------------------------------------------------*/
31+
/* Includes ------------------------------------------------------------------*/
32+
/* Exported macro ------------------------------------------------------------*/
33+
#ifdef USE_FULL_ASSERT
34+
/**
35+
* @brief The assert_param macro is used for function's parameters check.
36+
* @param expr If expr is false, it calls assert_failed function
37+
* which reports the name of the source file and the source
38+
* line number of the call that failed.
39+
* If expr is true, it returns no value.
40+
* @retval None
41+
*/
42+
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
43+
/* Exported functions ------------------------------------------------------- */
44+
void assert_failed(uint8_t *file, uint32_t line);
45+
#else
46+
#define assert_param(expr) ((void)0U)
47+
#endif /* USE_FULL_ASSERT */
48+
49+
#ifdef __cplusplus
50+
}
51+
#endif
52+
53+
#endif /* __STM32_ASSERT_H */

stm32cube/stm32u3xx/drivers/include/stm32u3xx_hal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extern HAL_TickFreqTypeDef uwTickFreq;
7575
* @brief STM32U3xx HAL Driver version number
7676
*/
7777
#define __STM32U3xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
78-
#define __STM32U3xx_HAL_VERSION_SUB1 (0x01U) /*!< [23:16] sub1 version */
78+
#define __STM32U3xx_HAL_VERSION_SUB1 (0x02U) /*!< [23:16] sub1 version */
7979
#define __STM32U3xx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
8080
#define __STM32U3xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
8181
#define __STM32U3xx_HAL_VERSION ((__STM32U3xx_HAL_VERSION_MAIN << 24U)\

stm32cube/stm32u3xx/drivers/include/stm32u3xx_hal_conf.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,6 @@ extern "C" {
376376
#include "stm32u3xx_hal_hcd.h"
377377
#endif /* HAL_HCD_MODULE_ENABLED */
378378

379-
#ifdef HAL_HSP_MODULE_ENABLED
380-
#include "stm32u3xx_hal_hsp.h"
381-
#endif /* HAL_HSP_MODULE_ENABLED */
382-
383379
#ifdef HAL_I2C_MODULE_ENABLED
384380
#include "stm32u3xx_hal_i2c.h"
385381
#endif /* HAL_I2C_MODULE_ENABLED */

stm32cube/stm32u3xx/drivers/include/stm32u3xx_hal_flash_ex.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ extern "C" {
3939
/** @defgroup FLASHEx_Private_Constants FLASH Extended Private Constants
4040
* @{
4141
*/
42+
#if defined(FLASH_PRIVBB1R5_PRIV0)
43+
#define FLASH_BLOCKBASED_NB_REG (8U) /*!< Number of block-based registers available */
44+
#elif defined(FLASH_PRIVBB1R3_PRIV0)
4245
#define FLASH_BLOCKBASED_NB_REG (4U) /*!< Number of block-based registers available */
43-
46+
#else
47+
#define FLASH_BLOCKBASED_NB_REG (2U) /*!< Number of block-based registers available */
48+
#endif /* defined(STM32U3C5xx) || defined(STM32U3B5xx) */
4449
/**
4550
* @}
4651
*/

stm32cube/stm32u3xx/drivers/include/stm32u3xx_hal_gpio_ex.h

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extern "C" {
4444
/** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection
4545
* @{
4646
*/
47-
#if defined(STM32U385xx) || defined(STM32U375xx)
47+
#if defined(STM32U356xx) || defined(STM32U366xx) || defined(STM32U385xx) || defined(STM32U375xx) || defined(STM32U3B5xx) || defined(STM32U3C5xx)
4848
/**
4949
* @brief AF 0 selection
5050
*/
@@ -63,6 +63,9 @@ extern "C" {
6363
#define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /*!< LPTIM1 Alternate Function mapping */
6464
#define GPIO_AF1_TIM1 ((uint8_t)0x01) /*!< TIM1 Alternate Function mapping */
6565
#define GPIO_AF1_TIM2 ((uint8_t)0x01) /*!< TIM2 Alternate Function mapping */
66+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
67+
#define GPIO_AF1_TIM8 ((uint8_t)0x01) /*!< TIM8 Alternate Function mapping */
68+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
6669

6770
/**
6871
* @brief AF 2 selection
@@ -75,27 +78,44 @@ extern "C" {
7578
#define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< TIM2 Alternate Function mapping */
7679
#define GPIO_AF2_TIM3 ((uint8_t)0x02) /*!< TIM3 Alternate Function mapping */
7780
#define GPIO_AF2_TIM4 ((uint8_t)0x02) /*!< TIM4 Alternate Function mapping */
81+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
82+
#define GPIO_AF2_TIM12 ((uint8_t)0x02) /*!< TIM12 Alternate Function mapping */
83+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
7884

7985
/**
8086
* @brief AF 3 selection
8187
*/
8288
#define GPIO_AF3_ADF1 ((uint8_t)0x03) /*!< ADF1 Alternate Function mapping */
8389
#define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< I2C1 Alternate Function mapping */
90+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
8491
#define GPIO_AF3_I2C2 ((uint8_t)0x03) /*!< I2C2 Alternate Function mapping */
92+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
8593
#define GPIO_AF3_I3C1 ((uint8_t)0x03) /*!< I3C1 Alternate Function mapping */
94+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
8695
#define GPIO_AF3_I3C2 ((uint8_t)0x03) /*!< I3C2 Alternate Function mapping */
96+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
8797
#define GPIO_AF3_OCTOSPI1 ((uint8_t)0x03) /*!< OCTOSPI1 Alternate Function mapping */
98+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
8899
#define GPIO_AF3_SAI1 ((uint8_t)0x03) /*!< SAI1 Alternate Function mapping */
100+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
89101
#define GPIO_AF3_SPI2 ((uint8_t)0x03) /*!< SPI2 Alternate Function mapping */
90102
#define GPIO_AF3_TIM1 ((uint8_t)0x03) /*!< TIM1 Alternate Function mapping */
103+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
104+
#define GPIO_AF3_TIM8 ((uint8_t)0x03) /*!< TIM8 Alternate Function mapping */
105+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
91106

92107
/**
93108
* @brief AF 4 selection
94109
*/
95110
#define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< I2C1 Alternate Function mapping */
111+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
96112
#define GPIO_AF4_I2C2 ((uint8_t)0x04) /*!< I2C2 Alternate Function mapping */
113+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
97114
#define GPIO_AF4_I2C3 ((uint8_t)0x04) /*!< I2C3 Alternate Function mapping */
98115
#define GPIO_AF4_LPTIM3 ((uint8_t)0x04) /*!< LPTIM3 Alternate Function mapping */
116+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
117+
#define GPIO_AF4_USART2 ((uint8_t)0x04) /*!< USART2 Alternate Function mapping */
118+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
99119

100120
/**
101121
* @brief AF 5 selection
@@ -107,18 +127,30 @@ extern "C" {
107127
#define GPIO_AF5_SPI1 ((uint8_t)0x05) /*!< SPI1 Alternate Function mapping */
108128
#define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< SPI2 Alternate Function mapping */
109129
#define GPIO_AF5_SPI3 ((uint8_t)0x05) /*!< SPI3 Alternate Function mapping */
130+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
131+
#define GPIO_AF5_I2C4 ((uint8_t)0x05) /*!< I2C4 Alternate Function mapping */
132+
#define GPIO_AF5_SPI4 ((uint8_t)0x05) /*!< SPI4 Alternate Function mapping */
133+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
110134

111135
/**
112136
* @brief AF 6 selection
113137
*/
114138
#define GPIO_AF6_I3C1 ((uint8_t)0x06) /*!< I3C1 Alternate Function mapping */
139+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
115140
#define GPIO_AF6_I3C2 ((uint8_t)0x06) /*!< I3C2 Alternate Function mapping */
141+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
116142
#define GPIO_AF6_SPI3 ((uint8_t)0x06) /*!< SPI3 Alternate Function mapping */
143+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
144+
#define GPIO_AF6_SPI4 ((uint8_t)0x06) /*!< SPI4 Alternate Function mapping */
145+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
117146

118147
/**
119148
* @brief AF 7 selection
120149
*/
121150
#define GPIO_AF7_USART1 ((uint8_t)0x07) /*!< USART1 Alternate Function mapping */
151+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
152+
#define GPIO_AF7_USART2 ((uint8_t)0x07) /*!< USART2 Alternate Function mapping */
153+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
122154
#define GPIO_AF7_USART3 ((uint8_t)0x07) /*!< USART3 Alternate Function mapping */
123155

124156

@@ -128,12 +160,16 @@ extern "C" {
128160
#define GPIO_AF8_LPUART1 ((uint8_t)0x08) /*!< LPUART1 Alternate Function mapping */
129161
#define GPIO_AF8_UART4 ((uint8_t)0x08) /*!< UART4 Alternate Function mapping */
130162
#define GPIO_AF8_UART5 ((uint8_t)0x08) /*!< UART5 Alternate Function mapping */
163+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
131164
#define GPIO_AF8_SDMMC1 ((uint8_t)0x08) /*!< SDMMC1 Alternate Function mapping */
165+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
132166

133167
/**
134168
* @brief AF 9 selection
135169
*/
170+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
136171
#define GPIO_AF9_FDCAN1 ((uint8_t)0x09) /*!< FDCAN1 Alternate Function mapping */
172+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
137173
#define GPIO_AF9_TSC ((uint8_t)0x09) /*!< TSC Alternate Function mapping */
138174

139175
/**
@@ -147,14 +183,26 @@ extern "C" {
147183
* @brief AF 11 selection
148184
*/
149185
#define GPIO_AF11_MCO2 ((uint8_t)0x0B) /*!< MCO2 Alternate Function mapping */
186+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
187+
#define GPIO_AF11_I2C4 ((uint8_t)0x0B) /*!< I2C4 Alternate Function mapping */
188+
#define GPIO_AF11_FDCAN2 ((uint8_t)0x0B) /*!< FDCAN2 Alternate Function mapping */
189+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
190+
#if defined(STM32U356xx) || defined(STM32U366xx)
191+
#define GPIO_AF11_LCD ((uint8_t)0x0B) /*!< LCD Alternate Function mapping */
192+
#endif /* defined(STM32U356xx) || defined(STM32U366xx) */
150193

151194
/**
152195
* @brief AF 12 selection
153196
*/
154197
#define GPIO_AF12_COMP1 ((uint8_t)0x0C) /*!< COMP1 Alternate Function mapping */
155198
#define GPIO_AF12_COMP2 ((uint8_t)0x0C) /*!< COMP2 Alternate Function mapping */
199+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
156200
#define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /*!< SDMMC1 Alternate Function mapping */
201+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
157202
#define GPIO_AF12_TRACE ((uint8_t)0x0C) /*!< TRACE Alternate Function mapping */
203+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
204+
#define GPIO_AF12_I2C4 ((uint8_t)0x0C) /*!< I2C4 Alternate Function mapping */
205+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
158206

159207

160208
/**
@@ -163,7 +211,12 @@ extern "C" {
163211
#define GPIO_AF13_AUDIOCLK ((uint8_t)0x0D) /*!< AUDIOCLOCK Alternate Function mapping */
164212
#define GPIO_AF13_LPTIM2 ((uint8_t)0x0D) /*!< LPTIM2 Alternate Function mapping */
165213
#define GPIO_AF13_LPTIM4 ((uint8_t)0x0D) /*!< LPTIM4 Alternate Function mapping */
214+
#if !(defined(STM32U356xx) || defined(STM32U366xx))
166215
#define GPIO_AF13_SAI1 ((uint8_t)0x0D) /*!< SAI1 Alternate Function mapping */
216+
#endif /* !(defined(STM32U356xx) || defined(STM32U366xx)) */
217+
#if defined(STM32U3B5xx) || defined(STM32U3C5xx)
218+
#define GPIO_AF13_TIM8 ((uint8_t)0x0D) /*!< TIM8 Alternate Function mapping */
219+
#endif /* defined(STM32U3B5xx) || defined(STM32U3C5xx) */
167220

168221

169222
/**
@@ -183,7 +236,7 @@ extern "C" {
183236

184237
#define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
185238

186-
#endif /* defined(STM32U385xx) || defined(STM32U375xx) */
239+
#endif /* defined(STM32U385xx) || defined(STM32U375xx) || defined(STM32U3B5xx) || defined(STM32U3C5xx) */
187240

188241

189242
/**
@@ -202,13 +255,31 @@ extern "C" {
202255
/** @defgroup GPIOEx_Get_Port_Index GPIOEx Get Port Index
203256
* @{
204257
*/
258+
#if defined(GPIOF)
205259
#define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0UL :\
206260
((__GPIOx__) == (GPIOB))? 1UL :\
207261
((__GPIOx__) == (GPIOC))? 2UL :\
208262
((__GPIOx__) == (GPIOD))? 3UL :\
209263
((__GPIOx__) == (GPIOE))? 4UL :\
264+
((__GPIOx__) == (GPIOF))? 5UL :\
210265
((__GPIOx__) == (GPIOG))? 6UL :\
211266
((__GPIOx__) == (GPIOH))? 7UL : 16UL)
267+
#elif defined(GPIOG)
268+
#define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0UL :\
269+
((__GPIOx__) == (GPIOB))? 1UL :\
270+
((__GPIOx__) == (GPIOC))? 2UL :\
271+
((__GPIOx__) == (GPIOD))? 3UL :\
272+
((__GPIOx__) == (GPIOE))? 4UL :\
273+
((__GPIOx__) == (GPIOG))? 6UL :\
274+
((__GPIOx__) == (GPIOH))? 7UL : 16UL)
275+
#else
276+
#define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0UL :\
277+
((__GPIOx__) == (GPIOB))? 1UL :\
278+
((__GPIOx__) == (GPIOC))? 2UL :\
279+
((__GPIOx__) == (GPIOD))? 3UL :\
280+
((__GPIOx__) == (GPIOE))? 4UL :\
281+
((__GPIOx__) == (GPIOH))? 7UL : 16UL)
282+
#endif /* GPIOF */
212283

213284
/**
214285
* @}

0 commit comments

Comments
 (0)