Skip to content

Commit ac3469e

Browse files
committed
chore: clean up and adapt STM32Cube_FW sources for STM32duino
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 370b06d commit ac3469e

File tree

13 files changed

+87
-894
lines changed

13 files changed

+87
-894
lines changed

Diff for: src/utility/STM32Cube_FW/app_conf.h

+19-371
Large diffs are not rendered by default.

Diff for: src/utility/STM32Cube_FW/ble_bufsize.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@
9090

9191
/*
9292
* BLE_FIXED_BUFFER_SIZE_BYTES:
93-
* A part of the RAM, is dinamically allocated by initilizing all the pointers
93+
* A part of the RAM, is dynamically allocated by initializing all the pointers
9494
* defined in a global context variable "mem_alloc_ctx_p".
9595
* This initialization is made in the Dynamic_allocator functions, which
96-
* assing a portion of RAM given by the external application to the above
96+
* assign a portion of RAM given by the external application to the above
9797
* mentioned "global pointers".
9898
*
9999
* The size of this Dynamic RAM is made of 2 main components:
100100
* - a part that is parameters-dependent (num of links, GATT buffers, ...),
101-
* and which value is explicited by the following macro;
101+
* and which value is defined by the following macro;
102102
* - a part, that may be considered "fixed", i.e. independent from the above
103103
* mentioned parameters.
104104
*/

Diff for: src/utility/STM32Cube_FW/hw.h

+9-19
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@ extern "C" {
2727
#endif
2828

2929
/* Includes ------------------------------------------------------------------*/
30+
#include "stm32_def.h"
31+
#include "stm32wbxx_ll_bus.h"
32+
#include "stm32wbxx_ll_exti.h"
33+
#include "stm32wbxx_ll_system.h"
34+
#include "stm32wbxx_ll_rcc.h"
35+
#include "stm32wbxx_ll_ipcc.h"
36+
#include "stm32wbxx_ll_cortex.h"
37+
#include "stm32wbxx_ll_utils.h"
38+
#include "stm32wbxx_ll_pwr.h"
3039

3140
/******************************************************************************
3241
* HW IPCC
3342
******************************************************************************/
3443
void HW_IPCC_Enable( void );
3544
void HW_IPCC_Init( void );
36-
void HW_IPCC_Rx_Handler( void );
37-
void HW_IPCC_Tx_Handler( void );
3845

3946
void HW_IPCC_BLE_Init( void );
4047
void HW_IPCC_BLE_SendCmd( void );
@@ -80,23 +87,6 @@ extern "C" {
8087

8188
void HW_IPCC_TRACES_Init( void );
8289
void HW_IPCC_TRACES_EvtNot( void );
83-
84-
void HW_IPCC_MAC_802_15_4_Init( void );
85-
void HW_IPCC_MAC_802_15_4_SendCmd( void );
86-
void HW_IPCC_MAC_802_15_4_SendAck( void );
87-
void HW_IPCC_MAC_802_15_4_CmdEvtNot( void );
88-
void HW_IPCC_MAC_802_15_4_EvtNot( void );
89-
90-
void HW_IPCC_ZIGBEE_Init( void );
91-
92-
void HW_IPCC_ZIGBEE_SendM4RequestToM0(void); /* M4 Request to M0 */
93-
void HW_IPCC_ZIGBEE_RecvAppliAckFromM0(void); /* Request ACK from M0 */
94-
95-
void HW_IPCC_ZIGBEE_RecvM0NotifyToM4(void); /* M0 Notify to M4 */
96-
void HW_IPCC_ZIGBEE_SendM4AckToM0Notify(void); /* Notify ACK from M4 */
97-
void HW_IPCC_ZIGBEE_RecvM0RequestToM4(void); /* M0 Request to M4 */
98-
void HW_IPCC_ZIGBEE_SendM4AckToM0Request(void); /* Request ACK from M4 */
99-
10090

10191
#ifdef __cplusplus
10292
}

Diff for: src/utility/STM32Cube_FW/hw_ipcc.c

+14-173
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*
1717
******************************************************************************
1818
*/
19-
19+
#if defined(STM32WBxx)
2020
/* Includes ------------------------------------------------------------------*/
21-
#include "app_common.h"
21+
#include "hw.h"
2222
#include "mbox_def.h"
2323

2424
/* Global variables ---------------------------------------------------------*/
@@ -45,35 +45,17 @@ static void HW_IPCC_THREAD_NotEvtHandler( void );
4545
static void HW_IPCC_THREAD_CliNotEvtHandler( void );
4646
#endif
4747

48-
#ifdef MAC_802_15_4_WB
49-
static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
50-
static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
51-
#endif
52-
53-
#ifdef ZIGBEE_WB
54-
static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
55-
static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
56-
static void HW_IPCC_ZIGBEE_StackM0RequestHandler( void );
57-
58-
#endif
59-
6048
/* Public function definition -----------------------------------------------*/
6149

6250
/******************************************************************************
6351
* INTERRUPT HANDLER
6452
******************************************************************************/
65-
void HW_IPCC_Rx_Handler( void )
53+
void IPCC_C1_RX_IRQHandler(void)
6654
{
6755
if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
6856
{
6957
HW_IPCC_SYS_EvtHandler();
7058
}
71-
#ifdef MAC_802_15_4_WB
72-
else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
73-
{
74-
HW_IPCC_MAC_802_15_4_NotEvtHandler();
75-
}
76-
#endif /* MAC_802_15_4_WB */
7759
#ifdef THREAD_WB
7860
else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
7961
{
@@ -84,16 +66,6 @@ void HW_IPCC_Rx_Handler( void )
8466
HW_IPCC_THREAD_CliNotEvtHandler();
8567
}
8668
#endif /* THREAD_WB */
87-
#ifdef ZIGBEE_WB
88-
else if (HW_IPCC_RX_PENDING( HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL ))
89-
{
90-
HW_IPCC_ZIGBEE_StackNotifEvtHandler();
91-
}
92-
else if (HW_IPCC_RX_PENDING( HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL ))
93-
{
94-
HW_IPCC_ZIGBEE_StackM0RequestHandler();
95-
}
96-
#endif /* ZIGBEE_WB */
9769
else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
9870
{
9971
HW_IPCC_BLE_EvtHandler();
@@ -102,34 +74,20 @@ void HW_IPCC_Rx_Handler( void )
10274
{
10375
HW_IPCC_TRACES_EvtHandler();
10476
}
105-
106-
return;
10777
}
10878

109-
void HW_IPCC_Tx_Handler( void )
79+
void IPCC_C1_TX_IRQHandler(void)
11080
{
11181
if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
11282
{
11383
HW_IPCC_SYS_CmdEvtHandler();
11484
}
115-
#ifdef MAC_802_15_4_WB
116-
else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
117-
{
118-
HW_IPCC_MAC_802_15_4_CmdEvtHandler();
119-
}
120-
#endif /* MAC_802_15_4_WB */
12185
#ifdef THREAD_WB
12286
else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
12387
{
12488
HW_IPCC_OT_CmdEvtHandler();
12589
}
12690
#endif /* THREAD_WB */
127-
#ifdef ZIGBEE_WB
128-
if (HW_IPCC_TX_PENDING( HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL ))
129-
{
130-
HW_IPCC_ZIGBEE_CmdEvtHandler();
131-
}
132-
#endif /* ZIGBEE_WB */
13391
else if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
13492
{
13593
HW_IPCC_SYS_CmdEvtHandler();
@@ -142,9 +100,8 @@ void HW_IPCC_Tx_Handler( void )
142100
{
143101
HW_IPCC_BLE_AclDataEvtHandler();
144102
}
145-
146-
return;
147103
}
104+
148105
/******************************************************************************
149106
* GENERAL
150107
******************************************************************************/
@@ -228,8 +185,8 @@ static void HW_IPCC_BLE_AclDataEvtHandler( void )
228185
return;
229186
}
230187

231-
__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
232-
__weak void HW_IPCC_BLE_RxEvtNot( void ){};
188+
__WEAK void HW_IPCC_BLE_AclDataAckNot( void ){};
189+
__WEAK void HW_IPCC_BLE_RxEvtNot( void ){};
233190

234191
/******************************************************************************
235192
* SYSTEM
@@ -267,56 +224,8 @@ static void HW_IPCC_SYS_EvtHandler( void )
267224
return;
268225
}
269226

270-
__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
271-
__weak void HW_IPCC_SYS_EvtNot( void ){};
272-
273-
/******************************************************************************
274-
* MAC 802.15.4
275-
******************************************************************************/
276-
#ifdef MAC_802_15_4_WB
277-
void HW_IPCC_MAC_802_15_4_Init( void )
278-
{
279-
LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
280-
281-
return;
282-
}
283-
284-
void HW_IPCC_MAC_802_15_4_SendCmd( void )
285-
{
286-
LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
287-
LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
288-
289-
return;
290-
}
291-
292-
void HW_IPCC_MAC_802_15_4_SendAck( void )
293-
{
294-
LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
295-
LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
296-
297-
return;
298-
}
299-
300-
static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
301-
{
302-
LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
303-
304-
HW_IPCC_MAC_802_15_4_CmdEvtNot();
305-
306-
return;
307-
}
308-
309-
static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
310-
{
311-
LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
312-
313-
HW_IPCC_MAC_802_15_4_EvtNot();
314-
315-
return;
316-
}
317-
__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
318-
__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
319-
#endif
227+
__WEAK void HW_IPCC_SYS_CmdEvtNot( void ){};
228+
__WEAK void HW_IPCC_SYS_EvtNot( void ){};
320229

321230
/******************************************************************************
322231
* THREAD
@@ -388,80 +297,12 @@ static void HW_IPCC_THREAD_CliNotEvtHandler( void )
388297
return;
389298
}
390299

391-
__weak void HW_IPCC_OT_CmdEvtNot( void ){};
392-
__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
393-
__weak void HW_IPCC_THREAD_EvtNot( void ){};
300+
__WEAK void HW_IPCC_OT_CmdEvtNot( void ){};
301+
__WEAK void HW_IPCC_CLI_CmdEvtNot( void ){};
302+
__WEAK void HW_IPCC_THREAD_EvtNot( void ){};
394303

395304
#endif /* THREAD_WB */
396305

397-
/******************************************************************************
398-
* ZIGBEE
399-
******************************************************************************/
400-
#ifdef ZIGBEE_WB
401-
void HW_IPCC_ZIGBEE_Init( void )
402-
{
403-
LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL );
404-
LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL );
405-
406-
return;
407-
}
408-
409-
void HW_IPCC_ZIGBEE_SendM4RequestToM0( void )
410-
{
411-
LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL );
412-
LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL );
413-
414-
return;
415-
}
416-
417-
void HW_IPCC_ZIGBEE_SendM4AckToM0Notify( void )
418-
{
419-
LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL );
420-
LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL );
421-
422-
return;
423-
}
424-
425-
static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
426-
{
427-
LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL );
428-
429-
HW_IPCC_ZIGBEE_RecvAppliAckFromM0();
430-
431-
return;
432-
}
433-
434-
static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
435-
{
436-
LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL );
437-
438-
HW_IPCC_ZIGBEE_RecvM0NotifyToM4();
439-
440-
return;
441-
}
442-
443-
static void HW_IPCC_ZIGBEE_StackM0RequestHandler( void )
444-
{
445-
LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL );
446-
447-
HW_IPCC_ZIGBEE_RecvM0RequestToM4();
448-
449-
return;
450-
}
451-
452-
void HW_IPCC_ZIGBEE_SendM4AckToM0Request( void )
453-
{
454-
LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL );
455-
LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL );
456-
457-
return;
458-
}
459-
460-
__weak void HW_IPCC_ZIGBEE_RecvAppliAckFromM0( void ){};
461-
__weak void HW_IPCC_ZIGBEE_RecvM0NotifyToM4( void ){};
462-
__weak void HW_IPCC_ZIGBEE_RecvM0RequestToM4( void ){};
463-
#endif /* ZIGBEE_WB */
464-
465306
/******************************************************************************
466307
* MEMORY MANAGER
467308
******************************************************************************/
@@ -512,6 +353,6 @@ static void HW_IPCC_TRACES_EvtHandler( void )
512353
return;
513354
}
514355

515-
__weak void HW_IPCC_TRACES_EvtNot( void ){};
516-
356+
__WEAK void HW_IPCC_TRACES_EvtNot( void ){};
357+
#endif /* STM32WBxx */
517358
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)