Skip to content

Commit 80312db

Browse files
raiden00plxiaoxiang781216
authored andcommitted
!arm/stm32wl5: standardize public API/type prefix to stm32_
BREAKING CHANGE: Public STM32WL5 interfaces were renamed from stm32wl5_* forms to canonical stm32_* forms across arch and board headers/sources. Public type names in STM32WL5 timer/GPIO/EXTI and related API-facing declarations were normalized to stm32_* equivalents. The STM32WL5 root family header was renamed from stm32wl5.h to stm32.h; all STM32WL5 arch/board includes were updated accordingly. Signed-off-by: raiden00pl <raiden00@railab.me>
1 parent 6e7db8d commit 80312db

46 files changed

Lines changed: 854 additions & 907 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* arch/arm/src/stm32wl5/stm32wl5.h
2+
* arch/arm/src/stm32wl5/stm32.h
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -55,13 +55,13 @@
5555
****************************************************************************/
5656

5757
/****************************************************************************
58-
* Name: stm32wl5_spidev_initialize
58+
* Name: stm32_spidev_initialize
5959
*
6060
* Description:
6161
* Called to configure SPI chip select GPIO pins.
6262
*
6363
****************************************************************************/
6464

65-
void stm32wl5_spidev_initialize(void);
65+
void stm32_spidev_initialize(void);
6666

6767
#endif /* __ARCH_ARM_SRC_STM32WL5_STM32WL5_H */

arch/arm/src/stm32wl5/stm32wl5_allocateheap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
192192

193193
/* Allow user-mode access to the user heap memory */
194194

195-
stm32wl5_mpu_uheap((uintptr_t)ubase, usize);
195+
stm32_mpu_uheap((uintptr_t)ubase, usize);
196196
#else
197197

198198
/* Return the heap settings */
@@ -270,7 +270,7 @@ void arm_addregion(void)
270270

271271
/* Allow user-mode access to the SRAM2 heap */
272272

273-
stm32wl5_mpu_uheap((uintptr_t)SRAM2_START, SRAM2_END - SRAM2_START);
273+
stm32_mpu_uheap((uintptr_t)SRAM2_START, SRAM2_END - SRAM2_START);
274274
#endif
275275

276276
/* Colorize the heap for debug */

arch/arm/src/stm32wl5/stm32wl5_exti.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern "C"
5454
****************************************************************************/
5555

5656
/****************************************************************************
57-
* Name: stm32wl5_gpiosetevent
57+
* Name: stm32_gpiosetevent
5858
*
5959
* Description:
6060
* Sets/clears GPIO based event and interrupt triggers.
@@ -73,11 +73,11 @@ extern "C"
7373
*
7474
****************************************************************************/
7575

76-
int stm32wl5_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
76+
int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
7777
bool event, xcpt_t func, void *arg);
7878

7979
/****************************************************************************
80-
* Name: stm32wl5_exti_alarm
80+
* Name: stm32_exti_alarm
8181
*
8282
* Description:
8383
* Sets/clears EXTI alarm interrupt.
@@ -95,12 +95,12 @@ int stm32wl5_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
9595
****************************************************************************/
9696

9797
#ifdef CONFIG_RTC_ALARM
98-
int stm32wl5_exti_alarm(bool risingedge, bool fallingedge, bool event,
98+
int stm32_exti_alarm(bool risingedge, bool fallingedge, bool event,
9999
xcpt_t func, void *arg);
100100
#endif
101101

102102
/****************************************************************************
103-
* Name: stm32wl5_exti_wakeup
103+
* Name: stm32_exti_wakeup
104104
*
105105
* Description:
106106
* Sets/clears EXTI wakeup interrupt.
@@ -118,12 +118,12 @@ int stm32wl5_exti_alarm(bool risingedge, bool fallingedge, bool event,
118118
****************************************************************************/
119119

120120
#ifdef CONFIG_RTC_PERIODIC
121-
int stm32wl5_exti_wakeup(bool risingedge, bool fallingedge, bool event,
121+
int stm32_exti_wakeup(bool risingedge, bool fallingedge, bool event,
122122
xcpt_t func, void *arg);
123123
#endif
124124

125125
/****************************************************************************
126-
* Name: stm32wl5_exti_comp
126+
* Name: stm32_exti_comp
127127
*
128128
* Description:
129129
* Sets/clears comparator based events and interrupt triggers.
@@ -142,7 +142,7 @@ int stm32wl5_exti_wakeup(bool risingedge, bool fallingedge, bool event,
142142
****************************************************************************/
143143

144144
#ifdef CONFIG_STM32WL5_COMP
145-
int stm32wl5_exti_comp(int cmp, bool risingedge, bool fallingedge,
145+
int stm32_exti_comp(int cmp, bool risingedge, bool fallingedge,
146146
bool event, xcpt_t func, void *arg);
147147
#endif
148148

arch/arm/src/stm32wl5/stm32wl5_exti_gpio.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static struct gpio_callback_s g_gpio_handlers[16];
6666
* Interrupt Service Routines - Dispatchers
6767
****************************************************************************/
6868

69-
static int stm32wl5_exti0_isr(int irq, void *context, void *arg)
69+
static int stm32_exti0_isr(int irq, void *context, void *arg)
7070
{
7171
int ret = OK;
7272

@@ -87,7 +87,7 @@ static int stm32wl5_exti0_isr(int irq, void *context, void *arg)
8787
return ret;
8888
}
8989

90-
static int stm32wl5_exti1_isr(int irq, void *context, void *arg)
90+
static int stm32_exti1_isr(int irq, void *context, void *arg)
9191
{
9292
int ret = OK;
9393

@@ -108,7 +108,7 @@ static int stm32wl5_exti1_isr(int irq, void *context, void *arg)
108108
return ret;
109109
}
110110

111-
static int stm32wl5_exti2_isr(int irq, void *context, void *arg)
111+
static int stm32_exti2_isr(int irq, void *context, void *arg)
112112
{
113113
int ret = OK;
114114

@@ -129,7 +129,7 @@ static int stm32wl5_exti2_isr(int irq, void *context, void *arg)
129129
return ret;
130130
}
131131

132-
static int stm32wl5_exti3_isr(int irq, void *context, void *arg)
132+
static int stm32_exti3_isr(int irq, void *context, void *arg)
133133
{
134134
int ret = OK;
135135

@@ -150,7 +150,7 @@ static int stm32wl5_exti3_isr(int irq, void *context, void *arg)
150150
return ret;
151151
}
152152

153-
static int stm32wl5_exti4_isr(int irq, void *context, void *arg)
153+
static int stm32_exti4_isr(int irq, void *context, void *arg)
154154
{
155155
int ret = OK;
156156

@@ -171,7 +171,7 @@ static int stm32wl5_exti4_isr(int irq, void *context, void *arg)
171171
return ret;
172172
}
173173

174-
static int stm32wl5_exti_multiisr(int irq, void *context, void *arg,
174+
static int stm32_exti_multiisr(int irq, void *context, void *arg,
175175
int first, int last)
176176
{
177177
uint32_t pr;
@@ -215,22 +215,22 @@ static int stm32wl5_exti_multiisr(int irq, void *context, void *arg,
215215
return ret;
216216
}
217217

218-
static int stm32wl5_exti95_isr(int irq, void *context, void *arg)
218+
static int stm32_exti95_isr(int irq, void *context, void *arg)
219219
{
220-
return stm32wl5_exti_multiisr(irq, context, arg, 5, 9);
220+
return stm32_exti_multiisr(irq, context, arg, 5, 9);
221221
}
222222

223-
static int stm32wl5_exti1510_isr(int irq, void *context, void *arg)
223+
static int stm32_exti1510_isr(int irq, void *context, void *arg)
224224
{
225-
return stm32wl5_exti_multiisr(irq, context, arg, 10, 15);
225+
return stm32_exti_multiisr(irq, context, arg, 10, 15);
226226
}
227227

228228
/****************************************************************************
229229
* Public Functions
230230
****************************************************************************/
231231

232232
/****************************************************************************
233-
* Name: stm32wl5_gpiosetevent
233+
* Name: stm32_gpiosetevent
234234
*
235235
* Description:
236236
* Sets/clears GPIO based event and interrupt triggers.
@@ -252,7 +252,7 @@ static int stm32wl5_exti1510_isr(int irq, void *context, void *arg)
252252
*
253253
****************************************************************************/
254254

255-
int stm32wl5_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
255+
int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
256256
bool event, xcpt_t func, void *arg)
257257
{
258258
struct gpio_callback_s *shared_cbs;
@@ -273,37 +273,37 @@ int stm32wl5_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
273273
switch (pin)
274274
{
275275
case 0:
276-
handler = stm32wl5_exti0_isr;
276+
handler = stm32_exti0_isr;
277277
break;
278278

279279
case 1:
280-
handler = stm32wl5_exti1_isr;
280+
handler = stm32_exti1_isr;
281281
break;
282282

283283
case 2:
284-
handler = stm32wl5_exti2_isr;
284+
handler = stm32_exti2_isr;
285285
break;
286286

287287
case 3:
288-
handler = stm32wl5_exti3_isr;
288+
handler = stm32_exti3_isr;
289289
break;
290290

291291
default:
292-
handler = stm32wl5_exti4_isr;
292+
handler = stm32_exti4_isr;
293293
break;
294294
}
295295
}
296296
else if (pin < 10)
297297
{
298298
irq = STM32_IRQ_EXTI95;
299-
handler = stm32wl5_exti95_isr;
299+
handler = stm32_exti95_isr;
300300
shared_cbs = &g_gpio_handlers[5];
301301
nshared = 5;
302302
}
303303
else
304304
{
305305
irq = STM32_IRQ_EXTI1510;
306-
handler = stm32wl5_exti1510_isr;
306+
handler = stm32_exti1510_isr;
307307
shared_cbs = &g_gpio_handlers[10];
308308
nshared = 6;
309309
}
@@ -349,7 +349,7 @@ int stm32wl5_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
349349
pinset |= GPIO_EXTI;
350350
}
351351

352-
stm32wl5_configgpio(pinset);
352+
stm32_configgpio(pinset);
353353

354354
/* Configure rising/falling edges */
355355

arch/arm/src/stm32wl5/stm32wl5_flash.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void flash_unlock(void)
9595
{
9696
while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
9797
{
98-
stm32wl5_waste();
98+
stm32_waste();
9999
}
100100

101101
if (getreg32(STM32_FLASH_CR) & FLASH_CR_LOCK)
@@ -145,7 +145,7 @@ static inline void flash_erase(size_t page)
145145

146146
while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
147147
{
148-
stm32wl5_waste();
148+
stm32_waste();
149149
}
150150

151151
modifyreg32(STM32_FLASH_CR, FLASH_CR_PAGE_ERASE, 0);
@@ -155,7 +155,7 @@ static inline void flash_erase(size_t page)
155155
* Public Functions
156156
****************************************************************************/
157157

158-
int stm32wl5_flash_unlock(void)
158+
int stm32_flash_unlock(void)
159159
{
160160
int ret;
161161

@@ -171,7 +171,7 @@ int stm32wl5_flash_unlock(void)
171171
return ret;
172172
}
173173

174-
int stm32wl5_flash_lock(void)
174+
int stm32_flash_lock(void)
175175
{
176176
int ret;
177177

@@ -188,7 +188,7 @@ int stm32wl5_flash_lock(void)
188188
}
189189

190190
/****************************************************************************
191-
* Name: stm32wl5_flash_user_optbytes
191+
* Name: stm32_flash_user_optbytes
192192
*
193193
* Description:
194194
* Modify the contents of the user option bytes (USR OPT) on the flash.
@@ -204,7 +204,7 @@ int stm32wl5_flash_lock(void)
204204
*
205205
****************************************************************************/
206206

207-
uint32_t stm32wl5_flash_user_optbytes(uint32_t clrbits, uint32_t setbits)
207+
uint32_t stm32_flash_user_optbytes(uint32_t clrbits, uint32_t setbits)
208208
{
209209
uint32_t regval;
210210
int ret;
@@ -242,7 +242,7 @@ uint32_t stm32wl5_flash_user_optbytes(uint32_t clrbits, uint32_t setbits)
242242

243243
while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
244244
{
245-
stm32wl5_waste();
245+
stm32_waste();
246246
}
247247

248248
flash_optbytes_lock();
@@ -457,7 +457,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t buflen)
457457

458458
while (getreg32(STM32_FLASH_SR) & FLASH_SR_BSY)
459459
{
460-
stm32wl5_waste();
460+
stm32_waste();
461461
}
462462

463463
/* Verify */

arch/arm/src/stm32wl5/stm32wl5_flash.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
* Public Functions Prototypes
3737
****************************************************************************/
3838

39-
int stm32wl5_flash_lock(void);
40-
int stm32wl5_flash_unlock(void);
39+
int stm32_flash_lock(void);
40+
int stm32_flash_unlock(void);
4141

4242
/****************************************************************************
43-
* Name: stm32wl5_flash_user_optbytes
43+
* Name: stm32_flash_user_optbytes
4444
*
4545
* Description:
4646
* Modify the contents of the user option bytes (USR OPT) on the flash.
@@ -56,6 +56,6 @@ int stm32wl5_flash_unlock(void);
5656
*
5757
****************************************************************************/
5858

59-
uint32_t stm32wl5_flash_user_optbytes(uint32_t clrbits, uint32_t setbits);
59+
uint32_t stm32_flash_user_optbytes(uint32_t clrbits, uint32_t setbits);
6060

6161
#endif /* __ARCH_ARM_SRC_STM32WL5_STM32WL5_FLASH_H */

0 commit comments

Comments
 (0)