diff options
Diffstat (limited to 'Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h')
-rw-r--r-- | Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h | 239 |
1 files changed, 136 insertions, 103 deletions
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h index c7c66ffde..1c7b357fe 100644 --- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h +++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h @@ -1,26 +1,26 @@ +/* USER CODE BEGIN Header */ /** ****************************************************************************** - * @file app_conf.h - * @author MCD Application Team - * @brief Application configuration file - ****************************************************************************** - * @attention - * - * <h2><center>© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.</center></h2> - * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - + * File Name : app_conf.h + * Description : Application configuration file for STM32WPAN Middleware. + ****************************************************************************** + * @attention + * + * <h2><center>© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.</center></h2> + * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __APP_CONF_H -#define __APP_CONF_H +#ifndef APP_CONF_H +#define APP_CONF_H #include "hw.h" #include "hw_conf.h" @@ -28,33 +28,29 @@ #include "ble_bufsize.h" /****************************************************************************** - * Data Throughput Application Config + * Application Config ******************************************************************************/ /**< generic parameters ******************************************************/ /** * Define Tx Power - */ -#define CFG_TX_POWER (0x18) /**< 0dbm */ + */ +#define CFG_TX_POWER (0x18) /* -0.15dBm */ /** * Define Advertising parameters */ #define CFG_ADV_BD_ADDRESS (0x7257acd87a6c) -#define CFG_FAST_CONN_ADV_INTERVAL_MIN (0x80) /**< 80ms */ -#define CFG_FAST_CONN_ADV_INTERVAL_MAX (0xA0) /**< 100ms */ -#define CFG_LP_CONN_ADV_INTERVAL_MIN (0x640) /**< 1s */ -#define CFG_LP_CONN_ADV_INTERVAL_MAX (0xFA0) /**< 2.5s */ /** * Define IO Authentication */ -#define CFG_BONDING_MODE (1) -#define CFG_FIXED_PIN (111111) -#define CFG_USED_FIXED_PIN (0) -#define CFG_ENCRYPTION_KEY_SIZE_MAX (16) -#define CFG_ENCRYPTION_KEY_SIZE_MIN (8) +#define CFG_BONDING_MODE (1) +#define CFG_FIXED_PIN (111111) +#define CFG_USED_FIXED_PIN (1) +#define CFG_ENCRYPTION_KEY_SIZE_MAX (16) +#define CFG_ENCRYPTION_KEY_SIZE_MIN (8) /** * Define IO capabilities @@ -65,15 +61,15 @@ #define CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT (0x03) #define CFG_IO_CAPABILITY_KEYBOARD_DISPLAY (0x04) -#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_DISPLAY_YES_NO - +#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_DISPLAY_YES_NO + /** * Define MITM modes */ #define CFG_MITM_PROTECTION_NOT_REQUIRED (0x00) #define CFG_MITM_PROTECTION_REQUIRED (0x01) -#define CFG_MITM_PROTECTION CFG_MITM_PROTECTION_REQUIRED +#define CFG_MITM_PROTECTION CFG_MITM_PROTECTION_REQUIRED /** * Define Secure Connections Support @@ -99,10 +95,30 @@ #define NO (0x00) /** - * Generic Access Appearance + * Device name configuration for Generic Access Service + */ +#define CFG_GAP_DEVICE_NAME "TEMPLATE" +#define CFG_GAP_DEVICE_NAME_LENGTH (8) + +/** +* Identity root key used to derive LTK and CSRK +*/ +#define CFG_BLE_IRK {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0} + +/** +* Encryption root key used to derive LTK and CSRK +*/ +#define CFG_BLE_ERK {0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21} + +/** + * SMPS supply + * SMPS not used when Set to 0 + * SMPS used when Set to 1 */ -#define CFG_UNKNOWN_APPEARANCE (0) -#define CFG_GAP_APPEARANCE (832) +#define CFG_USE_SMPS 0 + +/* USER CODE BEGIN Generic_Parameters */ + /** * Define PHY @@ -119,26 +135,24 @@ #define RX_1M 0x01 #define RX_2M 0x02 -/** -* Identity root key used to derive LTK and CSRK -*/ -#define CFG_BLE_IRK {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0} +/* USER CODE END Generic_Parameters */ -/** -* Encryption root key used to derive LTK and CSRK -*/ -#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21} +/**< specific parameters */ +/*****************************************************/ + +#define CFG_MAX_CONNECTION 1 +#define UUID_128BIT_FORMAT 1 -/* USER CODE BEGIN Generic_Parameters */ -/** - * SMPS supply - * SMPS not used when Set to 0 - * SMPS used when Set to 1 - */ -#define CFG_USE_SMPS 0 -/* USER CODE END Generic_Parameters */ -/**< specific parameters ********************************************************/ +#define CONN_L(x) ((int)(((float)x)/0.625f)) +#define CONN_P(x) ((int)(((float)x)/1.25f)) +#define SCAN_P (0x320) +#define SCAN_L (0x320) + + + +/* USER CODE BEGIN Specific_Parameters */ + /** * Encryption enable when set to 1 * Encryption disabe when set to 0 @@ -171,20 +185,13 @@ #define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler #define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler -#define CONN_L(x) ((int)(((float)x)/0.625f)) -#define CONN_P(x) ((int)(((float)x)/1.25f)) -#define SCAN_P (0x320) -#define SCAN_L (0x320) #define CFG_DEV_ID_PERIPH_SERVER (0x88) #define CFG_FEATURE_DT (0x70) -#define UUID_128BIT_FORMAT 1 - #define MAX_HCI_CMD_EVENT_PAYLOAD_SIZE 255 #define DATA_NOTIFICATION_MAX_PACKET_SIZE 240 -#define CFG_MAX_CONNECTION 1 /** * TX PHY configuration @@ -214,6 +221,9 @@ #define CFG_ALL_PHYS ((!CFG_TX_PHY) + ((!CFG_RX_PHY)*2)) #define L2CAP_SLAVE_LATENCY 0x0000 #define L2CAP_TIMEOUT_MULTIPLIER 0x1F4 + +/* USER CODE END Specific_Parameters */ + /****************************************************************************** * BLE Stack ******************************************************************************/ @@ -240,6 +250,7 @@ /** * Maximum supported ATT_MTU size + * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1" */ #define CFG_BLE_MAX_ATT_MTU (251) @@ -257,7 +268,8 @@ #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) /** - * Prepare Write List size in terms of number of packet with ATT_MTU=23 bytes + * Prepare Write List size in terms of number of packet + * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1" */ #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) @@ -292,9 +304,9 @@ /** * Source for the low speed clock for RF wake-up - * 1 : external high speed crystal HSE/32/32 + * 1 : external high speed crystal HSE/32/32 * 0 : external low speed crystal ( no calibration ) - */ + */ #define CFG_BLE_LSE_SOURCE 0 /** @@ -316,26 +328,26 @@ /** * BLE stack Options flags to be configured with: - * - SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY - * - SHCI_C2_BLE_INIT_OPTIONS_LL_HOST - * - SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC - * - SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC - * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO - * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW - * - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1 - * - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3 - * which are used to set following configuration bits: - * (bit 0): 1: LL only + * - SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY + * - SHCI_C2_BLE_INIT_OPTIONS_LL_HOST + * - SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC + * - SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC + * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO + * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW + * - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1 + * - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3 + * which are used to set following configuration bits: + * (bit 0): 1: LL only * 0: LL + host - * (bit 1): 1: no service change desc. + * (bit 1): 1: no service change desc. * 0: with service change desc. - * (bit 2): 1: device name Read-Only + * (bit 2): 1: device name Read-Only * 0: device name R/W - * (bit 7): 1: LE Power Class 1 - * 0: LE Power Classe 2-3 + * (bit 7): 1: LE Power Class 1 + * 0: LE Power Class 2-3 * other bits: reserved (shall be set to 0) */ -#define CFG_BLE_OPTIONS SHCI_C2_BLE_INIT_OPTIONS_LL_HOST +#define CFG_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_POWER_CLASS_2_3) #define CFG_BLE_MAX_COC_INITIATOR_NBR (32) @@ -343,7 +355,6 @@ #define CFG_BLE_MAX_TX_POWER (0) - /****************************************************************************** * Transport Layer ******************************************************************************/ @@ -361,7 +372,6 @@ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout). */ #define CFG_TLBLE_EVT_QUEUE_LENGTH 5 - /** * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager. @@ -370,12 +380,10 @@ * It shall be at least 4 to receive the command status event in one frame. * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced * further depending on the application. - * */ #define CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */ #define TL_BLE_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE ) - /****************************************************************************** * UART interfaces ******************************************************************************/ @@ -383,9 +391,8 @@ /** * Select UART interfaces */ -#define CFG_UART_GUI -#define CFG_DEBUG_TRACE_UART hw_uart1 -#define CFG_CONSOLE_MENU hw_lpuart1 +#define CFG_DEBUG_TRACE_UART hw_uart1 +#define CFG_CONSOLE_MENU hw_lpuart1 /****************************************************************************** * USB interface @@ -394,7 +401,19 @@ /** * Enable/Disable USB interface */ -#define CFG_USB_INTERFACE_ENABLE 0 +#define CFG_USB_INTERFACE_ENABLE 0 + +/****************************************************************************** + * IPCC interface + ******************************************************************************/ + +/** + * The IPCC is dedicated to the communication between the CPU2 and the CPU1 + * and shall not be modified by the application + * The two following definitions shall not be modified + */ +#define HAL_IPCC_TX_IRQHandler(...) HW_IPCC_Tx_Handler( ) +#define HAL_IPCC_RX_IRQHandler(...) HW_IPCC_Rx_Handler( ) /****************************************************************************** * Low Power @@ -403,7 +422,7 @@ * When set to 1, the low power mode is enable * When set to 0, the device stays in RUN mode */ -#define CFG_LPM_SUPPORTED 1 +#define CFG_LPM_SUPPORTED 1 /****************************************************************************** * Timer Server @@ -428,6 +447,7 @@ * * The following settings are computed with LSI as input to the RTC */ + #define CFG_RTCCLK_DIVIDER_CONF 0 #if (CFG_RTCCLK_DIVIDER_CONF == 0) @@ -436,9 +456,10 @@ * It does not support 1Hz calendar * It divides the RTC CLK by 16 */ + #define CFG_RTCCLK_DIV (16) #define CFG_RTC_WUCKSEL_DIVIDER (0) -#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1) +#define CFG_RTC_ASYNCH_PRESCALER (0x0F) #define CFG_RTC_SYNCH_PRESCALER (0x7FFF) #else @@ -479,10 +500,13 @@ /** tick timer value in us */ #define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), HSE_VALUE/32 ) -//#define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE ) + typedef enum { - CFG_TIM_PROC_ID_ISR, + CFG_TIM_PROC_ID_ISR, + /* USER CODE BEGIN CFG_TimProcID_t */ + + /* USER CODE END CFG_TimProcID_t */ } CFG_TimProcID_t; /****************************************************************************** @@ -495,10 +519,7 @@ typedef enum * This shall be set to 0 in a final product * */ -#define CFG_HW_RESET_BY_FW 1 - -#define CFG_LED_SUPPORTED 1 -#define CFG_BUTTON_SUPPORTED 1 +#define CFG_HW_RESET_BY_FW 1 /** * keep debugger enabled while in any low power mode when set to 1 @@ -522,7 +543,6 @@ typedef enum #define APP_DBG_MSG PRINT_NO_MESG #endif - #if ( (CFG_DEBUG_BLE_TRACE != 0) || (CFG_DEBUG_APP_TRACE != 0) ) #define CFG_DEBUG_TRACE 1 #endif @@ -533,6 +553,7 @@ typedef enum #define CFG_LPM_SUPPORTED 0 #define CFG_DEBUGGER_SUPPORTED 1 #endif + /** * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output @@ -569,6 +590,13 @@ typedef enum #define DBG_TRACE_MSG_QUEUE_SIZE 4096 #define MAX_DBG_TRACE_MSG_SIZE 1024 +/* USER CODE BEGIN Defines */ + +#define CFG_LED_SUPPORTED 1 +#define CFG_BUTTON_SUPPORTED 1 + +/* USER CODE END Defines */ + /****************************************************************************** * Scheduler ******************************************************************************/ @@ -583,19 +611,23 @@ typedef enum /**< Add in that list all tasks that may send a ACI/HCI command */ typedef enum { + CFG_TASK_START_SCAN_ID, + CFG_TASK_CONN_DEV_1_ID, + CFG_TASK_SEARCH_SERVICE_ID, + CFG_TASK_SW1_BUTTON_PUSHED_ID, + CFG_TASK_CONN_UPDATE_ID, + CFG_TASK_HCI_ASYNCH_EVT_ID, +/* USER CODE BEGIN CFG_Task_Id_With_HCI_Cmd_t */ CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_TASK_DATA_WRITE_ID, - CFG_TASK_CONN_DEV_1_ID, CFG_TASK_BUTTON_ID, CFG_TASK_SW2_BUTTON_PUSHED_ID, CFG_TASK_SW3_BUTTON_PUSHED_ID, CFG_TASK_START_ADV_ID, - CFG_TASK_START_SCAN_ID, CFG_TASK_LINK_CONFIG_ID, CFG_TASK_APP_DATA_THROUGHPUT_ID, - CFG_TASK_CONN_UPDATE_ID, - CFG_TASK_HCI_ASYNCH_EVT_ID, +/* USER CODE END CFG_Task_Id_With_HCI_Cmd_t */ CFG_LAST_TASK_ID_WITH_HCICMD, /**< Shall be LAST in the list */ } CFG_Task_Id_With_HCI_Cmd_t; @@ -603,9 +635,10 @@ typedef enum typedef enum { CFG_FIRST_TASK_ID_WITH_NO_HCICMD = CFG_LAST_TASK_ID_WITH_HCICMD - 1, /**< Shall be FIRST in the list */ - CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID, +/* USER CODE BEGIN CFG_Task_Id_With_NO_HCI_Cmd_t */ +/* USER CODE END CFG_Task_Id_With_NO_HCI_Cmd_t */ CFG_LAST_TASK_ID_WITHO_NO_HCICMD /**< Shall be LAST in the list */ } CFG_Task_Id_With_NO_HCI_Cmd_t; #define CFG_TASK_NBR CFG_LAST_TASK_ID_WITHO_NO_HCICMD @@ -636,7 +669,7 @@ typedef enum ******************************************************************************/ /** * Supported requester to the MCU Low Power Manager - can be increased up to 32 - * It lits a bit mapping of all user of the Low Power Manager + * It list a bit mapping of all user of the Low Power Manager */ typedef enum { @@ -654,6 +687,6 @@ typedef enum #define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR -#endif /*__APP_CONF_H */ +#endif /*APP_CONF_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |