Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdca5f9d

Browse files
committed
chore: adapt STM32_WPAN sources
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parentb792e3d commitdca5f9d

File tree

7 files changed

+85
-12
lines changed

7 files changed

+85
-12
lines changed

‎src/utility/STM32_WPAN/app_conf_default.h‎

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* USER CODE BEGIN Header */
22
/**
33
******************************************************************************
4-
* @fileapp_conf.h
4+
* @fileapp_conf_default.h
55
* @author MCD Application Team
6-
* @briefApplication configuration file for STM32WPAN Middleware.
6+
* @briefDefault application configuration file for STM32WPAN Middleware.
77
******************************************************************************
88
* @attention
99
*
@@ -19,18 +19,40 @@
1919
/* USER CODE END Header */
2020

2121
/* Define to prevent recursive inclusion -------------------------------------*/
22-
#ifndefAPP_CONF_H
23-
#defineAPP_CONF_H
22+
#ifndefAPP_CONF_DEFAULT_H
23+
#defineAPP_CONF_DEFAULT_H
2424

25+
#if0
2526
#include"hw.h"
2627
#include"hw_conf.h"
2728
#include"hw_if.h"
2829
#include"ble_bufsize.h"
30+
#endif
2931

3032
/******************************************************************************
3133
* Application Config
3234
******************************************************************************/
3335

36+
/**< generic parameters ******************************************************/
37+
/* HCI related defines */
38+
39+
#defineACI_HAL_SET_TX_POWER_LEVEL 0xFC0F
40+
#defineACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C
41+
#defineACI_READ_CONFIG_DATA_OPCODE 0xFC0D
42+
#defineMAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251)
43+
#defineHCI_RESET 0x0C03
44+
45+
#ifndefBLE_SHARED_MEM_BYTE_ORDER
46+
#defineBLE_SHARED_MEM_BYTE_ORDER MSBFIRST
47+
#endif
48+
#defineBLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
49+
50+
/**
51+
* Define Tx Power
52+
*/
53+
#defineCFG_TX_POWER (0x18)/* -0.15dBm */
54+
55+
#if0
3456
/**
3557
* Define Secure Connections Support
3658
*/
@@ -104,6 +126,7 @@
104126
#defineCFG_FW_SUBVERSION (1)
105127
#defineCFG_FW_BRANCH (0)
106128
#defineCFG_FW_BUILD (0)
129+
#endif
107130

108131
/******************************************************************************
109132
* BLE Stack
@@ -250,7 +273,7 @@
250273
* 0: LE Power Class 2-3
251274
* other bits: complete with Options_extension flag
252275
*/
253-
#defineCFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3)
276+
#defineCFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3)
254277

255278
/**
256279
* BLE stack Options_extension flags to be configured with:
@@ -299,7 +322,11 @@
299322
* This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
300323
*/
301324

302-
#defineCFG_BLE_MAX_ADV_SET_NBR (8)
325+
#if defined(STM32WB15xx)
326+
#defineCFG_BLE_MAX_ADV_SET_NBR (3)
327+
#else
328+
#defineCFG_BLE_MAX_ADV_SET_NBR (8)
329+
#endif
303330

304331
/* Maximum advertising data length (in bytes)
305332
* Range: 31 .. 1650 with limitation:
@@ -308,7 +335,11 @@
308335
* This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
309336
*/
310337

311-
#defineCFG_BLE_MAX_ADV_DATA_LEN (207)
338+
#if defined(STM32WB15xx)
339+
#defineCFG_BLE_MAX_ADV_DATA_LEN (414)
340+
#else
341+
#defineCFG_BLE_MAX_ADV_DATA_LEN (207)
342+
#endif
312343

313344
/* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
314345
* Range: -1280 .. 1280
@@ -331,6 +362,7 @@
331362

332363
#defineCFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_4)
333364

365+
#if0
334366
/******************************************************************************
335367
* Transport Layer
336368
******************************************************************************/
@@ -667,4 +699,5 @@ typedef enum
667699

668700
#defineCFG_OTP_END_ADRESS OTP_AREA_END_ADDR
669701

670-
#endif/*APP_CONF_H */
702+
#endif
703+
#endif/*APP_CONF_DEFAULT_H */

‎src/utility/STM32_WPAN/hw.h‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,23 @@ extern "C" {
2626
#endif
2727

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

3039
/******************************************************************************
3140
* HW IPCC
3241
******************************************************************************/
3342
voidHW_IPCC_Enable(void );
3443
voidHW_IPCC_Init(void );
35-
voidHW_IPCC_Rx_Handler(void );
36-
voidHW_IPCC_Tx_Handler(void );
44+
#defineHW_IPCC_Rx_Handler IPCC_C1_RX_IRQHandler
45+
#defineHW_IPCC_Tx_Handler IPCC_C1_TX_IRQHandler
3746

3847
voidHW_IPCC_BLE_Init(void );
3948
voidHW_IPCC_BLE_SendCmd(void );

‎src/utility/STM32_WPAN/hw_ipcc.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
*/
1919
/* USER CODE END Header */
2020

21+
#if defined(STM32WBxx)
2122
/* Includes ------------------------------------------------------------------*/
22-
#include"app_common.h"
23+
#include"hw.h"
2324
#include"mbox_def.h"
2425
#include"utilities_conf.h"
2526

@@ -745,3 +746,4 @@ static void HW_IPCC_TRACES_EvtHandler( void )
745746
}
746747

747748
__weakvoidHW_IPCC_TRACES_EvtNot(void ){};
749+
#endif/* STM32WBxx */

‎src/utility/STM32_WPAN/shci.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919

20+
#if defined(STM32WBxx)
2021
/* Includes ------------------------------------------------------------------*/
2122
#include"stm32_wpan_common.h"
2223

@@ -759,3 +760,4 @@ SHCI_CmdStatus_t SHCI_GetWirelessFwInfo( WirelessFwInfo_t* pWirelessInfo )
759760

760761
return (SHCI_Success);
761762
}
763+
#endif/* STM32WBxx */

‎src/utility/STM32_WPAN/shci_tl.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
*/
1818

1919

20+
#if defined(STM32WBxx)
2021
/* Includes ------------------------------------------------------------------*/
2122
#include"stm32_wpan_common.h"
2223

2324
#include"stm_list.h"
2425
#include"shci_tl.h"
26+
#include"stm32_def.h"
2527

2628
/* Private typedef -----------------------------------------------------------*/
2729
typedefenum
@@ -168,6 +170,20 @@ void shci_send( uint16_t cmd_code, uint8_t len_cmd_payload, uint8_t * p_cmd_payl
168170
return;
169171
}
170172

173+
voidshci_notify_asynch_evt(void*pdata)
174+
{
175+
UNUSED(pdata);
176+
/* Need to parse data in future version */
177+
shci_user_evt_proc();
178+
}
179+
180+
voidshci_register_io_bus(tSHciIO*fops)
181+
{
182+
/* Register IO bus services */
183+
fops->Init=TL_SYS_Init;
184+
fops->Send=TL_SYS_SendCmd;
185+
}
186+
171187
/* Private functions ---------------------------------------------------------*/
172188
staticvoidTlInit(TL_CmdPacket_t*p_cmdbuffer )
173189
{
@@ -250,3 +266,4 @@ __WEAK void shci_cmd_resp_release(uint32_t flag)
250266

251267
return;
252268
}
269+
#endif/* STM32WBxx */

‎src/utility/STM32_WPAN/stm_list.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
*/
1818

1919

20+
#if defined(STM32WBxx)
2021
/******************************************************************************
2122
* Include Files
2223
******************************************************************************/
23-
#include"utilities_common.h"
24+
#include"stdint.h"
25+
#include"cmsis_gcc.h"
26+
#include"stm32_wpan_common.h"
2427

2528
#include"stm_list.h"
2629

@@ -204,3 +207,4 @@ void LST_get_prev_node (tListNode * ref_node, tListNode ** node)
204207

205208
__set_PRIMASK(primask_bit);/**< Restore PRIMASK bit*/
206209
}
210+
#endif/* STM32WBxx */

‎src/utility/STM32_WPAN/tl_mbox.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
******************************************************************************
1717
*/
1818

19+
#if defined(STM32WBxx)
1920
/* Includes ------------------------------------------------------------------*/
2021
#include"stm32_wpan_common.h"
2122
#include"hw.h"
@@ -53,8 +54,10 @@ PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleLldTable_t TL_BleLldTable;
5354
PLACE_IN_SECTION("MB_MEM1")ALIGN(4)staticMB_SysTable_tTL_SysTable;
5455
PLACE_IN_SECTION("MB_MEM1")ALIGN(4)staticMB_MemManagerTable_tTL_MemManagerTable;
5556
PLACE_IN_SECTION("MB_MEM1")ALIGN(4)staticMB_TracesTable_tTL_TracesTable;
57+
#if0
5658
PLACE_IN_SECTION("MB_MEM1")ALIGN(4)staticMB_Mac_802_15_4_tTL_Mac_802_15_4_Table;
5759
PLACE_IN_SECTION("MB_MEM1")ALIGN(4)staticMB_ZigbeeTable_tTL_Zigbee_Table;
60+
#endif
5861

5962
/**< tables */
6063
PLACE_IN_SECTION("MB_MEM1")ALIGN(4)statictListNodeFreeBufQueue;
@@ -99,8 +102,10 @@ void TL_Init( void )
99102
TL_RefTable.p_sys_table=&TL_SysTable;
100103
TL_RefTable.p_mem_manager_table=&TL_MemManagerTable;
101104
TL_RefTable.p_traces_table=&TL_TracesTable;
105+
#if0
102106
TL_RefTable.p_mac_802_15_4_table=&TL_Mac_802_15_4_Table;
103107
TL_RefTable.p_zigbee_table=&TL_Zigbee_Table;
108+
#endif
104109
HW_IPCC_Init();
105110

106111
return;
@@ -874,3 +879,4 @@ static void OutputDbgTrace(TL_MB_PacketType_t packet_type, uint8_t* buffer)
874879

875880
return;
876881
}
882+
#endif/* STM32WBxx */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp